# Functions > **NOTE** > > The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import ```ts import { photoAccessHelper } from '@kit.MediaLibraryKit'; ``` ## photoAccessHelper.getPhotoAccessHelper getPhotoAccessHelper(context: Context): PhotoAccessHelper Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album. **Model restriction**: This API can be used only in the stage model. **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.FileManagement.PhotoAccessHelper.Core **Parameters** | Name | Type | Mandatory| Description | | ------- | ------- | ---- | -------------------------- | | context | [Context](../apis-ability-kit/js-apis-inner-application-context.md) | Yes | Context of the ability instance.| **Return value** | Type | Description | | ----------------------------- | :---- | | [PhotoAccessHelper](arkts-apis-photoAccessHelper-PhotoAccessHelper.md) | PhotoAccessHelper instance obtained.| **Error codes** For details about the error codes, see [Universal Error Codes](../errorcode-universal.md). | ID| Error Message| | -------- | ---------------------------------------- | | 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | **Example** ```ts // The phAccessHelper instance obtained is a global object. It is used by default in subsequent operations. If the code snippet is not added, an error will be reported indicating that phAccessHelper is not defined. // Obtain the context from the component and ensure that the return value of this.getUiContext().getHostContext() is UIAbilityContext. import { common } from '@kit.AbilityKit'; @Entry @Component struct Index { build() { Row() { Button("example").onClick(async () => { let context: Context = this.getUIContext().getHostContext() as common.UIAbilityContext; let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context); }).width('100%') } .height('90%') } } ```