> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gbox.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get media detail

> Get detailed information about a specific media file



## OpenAPI

````yaml get /boxes/{boxId}/media/albums/{albumName}/media/{mediaName}
openapi: 3.0.0
info:
  title: GBOX Open API
  description: GBOX Open API Documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://gbox.ai/api/v1
    description: Production Server
security: []
tags: []
paths:
  /boxes/{boxId}/media/albums/{albumName}/media/{mediaName}:
    get:
      tags:
        - Media
      summary: Get media detail
      description: Get detailed information about a specific media file
      operationId: MediaController_getMediaDetail
      parameters:
        - name: boxId
          required: true
          in: path
          description: Box ID
          schema:
            example: c9bdc193-b54b-4ddb-a035-5ac0c598d32d
            type: string
        - name: albumName
          required: true
          in: path
          description: Album name
          schema:
            example: Pictures
            type: string
        - name: mediaName
          required: true
          in: path
          description: Media name
          schema:
            example: IMG_001.jpg
            type: string
      responses:
        '200':
          description: Media detail
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Photo'
                  - $ref: '#/components/schemas/Video'
      security:
        - bearer: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import GboxSDK from "gbox-sdk";

            const gboxSDK = new GboxSDK({
              apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
            });

            async function main() {
              const box = await gboxSDK.create({ type: "android" });

              // prepare: take a screenshot and save to album
              await box.action.screenshot({
                saveToAlbum: true
              })

              const screenshotsAlbum = await box.media.getAlbum("Screenshots");

              const targetMediaName = (await screenshotsAlbum.listMedia())[0].data.name;

              
              // example: get media info
              const mediaInfo = await screenshotsAlbum.getMediaInfo(targetMediaName);

              console.info(`media info: ${JSON.stringify(mediaInfo, null, 2)}`);


              // example: download media
              const media = await screenshotsAlbum.getMedia(targetMediaName);

              await media.download(`./my-screenshot.png`);

              console.info(`media downloaded to ./my-screenshot.png`);

            }

            main();
        - lang: Python
          source: |-
            import os
            import json
            from gbox_sdk import GboxSDK

            def main():
                # Initialize GboxSDK with API key from environment variable
                gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])

                # Create an Android box for media operations
                box = gbox_sdk.create(type="android")

                # prepare: take a screenshot and save to album
                box.action.screenshot(save_to_album=True)

                screenshots_album = box.media.get_album("Screenshots")

                target_media_name = screenshots_album.list_media()[0].data.name

                # example: get media info
                media_info = screenshots_album.get_media_info(target_media_name)
                
                print(f"media info: {media_info}")

                # example: download media
                media = screenshots_album.get_media(target_media_name)
                
                media.download("./my-screenshot.png")
                
                print("media downloaded to ./my-screenshot.png")

            if __name__ == "__main__":
                main()
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/gbox/gbox-sdk-go\"\n)\n\nfunc main() {\n\t// Initialize GboxSDK with API key from environment variable\n\tgboxSDK := gbox.NewGboxSDK(os.Getenv(\"GBOX_API_KEY\"))\n\n\t// Create an Android box for media operations\n\tbox, err := gboxSDK.Create(context.Background(), gbox.CreateOptions{Type: \"android\"})\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create android box: %v\", err)\n\t}\n\n\t// prepare: take a screenshot and save to album\n\terr = box.Action.Screenshot(context.Background(), gbox.ScreenshotOptions{\n\t\tSaveToAlbum: true,\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to take screenshot: %v\", err)\n\t}\n\n\tscreenshotsAlbum, err := box.Media.GetAlbum(context.Background(), \"Screenshots\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to get Screenshots album: %v\", err)\n\t}\n\n\tmediaList, err := screenshotsAlbum.ListMedia(context.Background())\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to list media: %v\", err)\n\t}\n\ttargetMediaName := mediaList[0].Data.Name\n\n\t// example: get media info\n\tmediaInfo, err := screenshotsAlbum.GetMediaInfo(context.Background(), targetMediaName)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to get media info: %v\", err)\n\t}\n\t\n\tmediaInfoJSON, _ := json.MarshalIndent(mediaInfo, \"\", \"  \")\n\tfmt.Printf(\"media info: %s\\n\", mediaInfoJSON)\n\n\t// example: download media\n\tmedia, err := screenshotsAlbum.GetMedia(context.Background(), targetMediaName)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to get media: %v\", err)\n\t}\n\t\n\terr = media.Download(context.Background(), \"./my-screenshot.png\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to download media: %v\", err)\n\t}\n\t\n\tfmt.Println(\"media downloaded to ./my-screenshot.png\")\n}"
components:
  schemas:
    Photo:
      type: object
      properties:
        type:
          type: string
          enum:
            - photo
          description: Photo type indicator
          title: Photo
        mimeType:
          type: string
          description: MIME type of the photo
          title: Photo
          example: image/jpeg
        name:
          type: string
          description: Name of the photo
          title: Photo
          example: IMG_001.jpg
        path:
          type: string
          description: Full path to the photo in the box
          title: Photo
          example: /sdcard/albums/vacation/IMG_001.jpg
        size:
          type: string
          description: Size of the photo
          title: Photo
          example: 2.5MB
        lastModified:
          format: date-time
          type: string
          description: Last modified time of the photo
          title: Photo
          example: '2021-01-01T00:00:00Z'
      title: Photo
      description: Photo representation
      required:
        - type
        - mimeType
        - name
        - path
        - size
        - lastModified
    Video:
      type: object
      properties:
        type:
          type: string
          enum:
            - video
          description: Video type indicator
          title: Video
        mimeType:
          type: string
          description: MIME type of the video
          title: Video
          example: video/mp4
        name:
          type: string
          description: Name of the video
          title: Video
          example: VID_001.mp4
        path:
          type: string
          description: Full path to the video in the box
          title: Video
          example: /sdcard/albums/vacation/VID_001.mp4
        size:
          type: string
          description: Size of the video
          title: Video
          example: 100MB
        lastModified:
          format: date-time
          type: string
          description: Last modified time of the video
          title: Video
          example: '2021-01-01T00:00:00Z'
      title: Video
      description: Video representation
      required:
        - type
        - mimeType
        - name
        - path
        - size
        - lastModified
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        Enter your API Key in the format: Bearer <token>. Get it from
        https://gbox.ai

````