CoreViz
Studio API

Listing Your Media

Retrieve a paginated list of media items from a dataset

Listing Your Media

Retrieve a paginated list of media items from a specific dataset.

Endpoint

GET /api/dataset/{datasetId}/media

Path Parameters

ParameterTypeDescription
datasetIdstringThe unique identifier of the dataset

Query Parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo10Maximum number of media items to return
offsetintegerNo0Number of items to skip for pagination
sortDirectionstringNoascSort order: asc or desc

Headers

HeaderValueRequired
x-api-keyYour API keyYes

Example Request

curl -H "x-api-key: YOUR_API_KEY" \
  "https://lab.coreviz.io/api/dataset/ecf33096-0d69-410b-a8cc-856caa3fba6c/media?limit=9&offset=0&sortDirection=desc"

Response

Status Code: 200 OK

Response Body:

{
  "media": [
    {
      "id": "7938b58d-d60a-43d8-953f-4f56b3cd8410",
      "name": "entities/d5979219-6891-4514-8096-0aa7d8898d33/media/convert.webp",
      "type": "image",
      "blob": "https://3vxmbaxifmu58irw.public.blob.vercel-storage.com/entities/d5979219-6891-4514-8096-0aa7d8898d33/media/convert-WjWBdnEdxK4ZtfEnZa8gV9cdy7N7aU.webp",
      "entityId": "d5979219-6891-4514-8096-0aa7d8898d33",
      "width": 2000,
      "height": 1161,
      "duration": null,
      "sizeBytes": 100120,
      "exif": {
        "tags": {}
      },
      "createdAt": "2025-11-22T01:27:59.555Z",
      "updatedAt": "2025-11-22T01:27:59.555Z",
      "metadata": {
        "tags": {
          "Tags": ["24"]
        },
        "moderation": {
          "status": "approved",
          "categories": [],
          "moderatedAt": "2025-11-22T01:27:59.520Z"
        }
      },
      "createdById": "3752284a-3d51-400b-957c-cb8e03d937f2",
      "updatedById": null,
      "status": "active",
      "frames": [
        {
          "id": "c56a0b9d-0d8f-49fc-9c01-1d0387ca5f7b",
          "timestamp": "0",
          "blob": "https://3vxmbaxifmu58irw.public.blob.vercel-storage.com/entities/d5979219-6891-4514-8096-0aa7d8898d33/media/7938b58d-d60a-43d8-953f-4f56b3cd8410/processed-zOXhoEHIJAfIyZEq6yeLHekBn2a6yL.jpg",
          "width": 1860,
          "height": 1080,
          "createdAt": "2025-11-22T01:28:07.863Z",
          "updatedAt": "2025-11-22T01:28:07.863Z",
          "status": "active",
          "createdById": "3752284a-3d51-400b-957c-cb8e03d937f2",
          "metadata": {
            "moderation": {
              "status": "approved",
              "categories": [],
              "moderatedAt": "2025-11-22T01:27:59.520Z"
            }
          },
          "mediaId": "7938b58d-d60a-43d8-953f-4f56b3cd8410",
          "captions": [
            {
              "id": "19a28556-b279-4a79-85d8-2762546f9320",
              "text": "A dark-skinned man with dark curly hair wears a green football jersey with the number 24 in white and gold lettering. He holds a brown football with a white stripe in his right hand and points with his left hand. He wears green gloves. The background is a large green and tan banner with a stylized \"Tampa\" logo.",
              "frameId": "c56a0b9d-0d8f-49fc-9c01-1d0387ca5f7b",
              "createdAt": "2025-11-22T01:28:19.597Z",
              "updatedAt": "2025-11-22T01:28:19.597Z",
              "status": "active",
              "createdById": "3752284a-3d51-400b-957c-cb8e03d937f2",
              "metadata": {},
            }
          ],
          "objects": []
        }
      ]
    }
  ],
  "pagination": {
    "total": 6,
    "limit": 9,
    "offset": 0,
    "hasMore": false
  }
}

Response Fields

Media Object

FieldTypeDescription
idstringUnique identifier for the media item
namestringFile path/name of the media
typestringMedia type: image or video
blobstringURL to the media file
entityIdstringID of the entity this media belongs to
widthintegerWidth in pixels (for images/videos)
heightintegerHeight in pixels (for images/videos)
durationnumber | nullDuration in seconds (for videos, null for images)
sizeBytesintegerFile size in bytes
exifobjectEXIF metadata from the file
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update
metadataobjectAdditional metadata including tags and moderation status
createdByIdstringID of the user who created this media
updatedByIdstring | nullID of the user who last updated this media
statusstringStatus of the media item (e.g., active)
framesarrayArray of frame objects (for videos or processed images)

Frame Object

FieldTypeDescription
idstringUnique identifier for the frame
timestampstringTimestamp within the video (or "0" for images)
blobstringURL to the processed frame image
widthintegerFrame width in pixels
heightintegerFrame height in pixels
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update
statusstringStatus of the frame
createdByIdstringID of the user who created this frame
metadataobjectFrame-specific metadata
mediaIdstringID of the parent media item
captionsarrayArray of caption objects generated by AI
objectsarrayArray of detected objects in the frame

Caption Object

FieldTypeDescription
idstringUnique identifier for the caption
textstringThe caption text
frameIdstringID of the frame this caption describes
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update
statusstringStatus of the caption
createdByIdstringID of the user who created this caption
metadataobjectAdditional caption metadata
modelstringAI model used to generate the caption

Pagination Object

FieldTypeDescription
totalintegerTotal number of media items in the dataset
limitintegerMaximum number of items requested
offsetintegerNumber of items skipped
hasMorebooleanWhether there are more items available

Error Responses

401 Unauthorized

Invalid or missing API key:

{
  "error": "Unauthorized",
  "message": "Invalid or missing API key"
}

404 Not Found

Dataset not found:

{
  "error": "Not Found",
  "message": "Dataset not found"
}

400 Bad Request

Invalid query parameters:

{
  "error": "Bad Request",
  "message": "Invalid query parameters"
}

Example Usage

JavaScript/TypeScript

const datasetId = 'ecf33096-0d69-410b-a8cc-856caa3fba6c';
const apiKey = 'YOUR_API_KEY';

const response = await fetch(
  `https://lab.coreviz.io/api/dataset/${datasetId}/media?limit=9&offset=0&sortDirection=desc`,
  {
    headers: {
      'x-api-key': apiKey,
    },
  }
);

const data = await response.json();
console.log(data.media);
console.log(data.pagination);

Python

import requests

dataset_id = 'ecf33096-0d69-410b-a8cc-856caa3fba6c'
api_key = 'YOUR_API_KEY'

response = requests.get(
    f'https://lab.coreviz.io/api/dataset/{dataset_id}/media',
    headers={'x-api-key': api_key},
    params={
        'limit': 9,
        'offset': 0,
        'sortDirection': 'desc'
    }
)

data = response.json()
print(data['media'])
print(data['pagination'])

Pagination

Use the limit and offset parameters to paginate through results:

  • First page: limit=9&offset=0
  • Second page: limit=9&offset=9
  • Third page: limit=9&offset=18

Check the hasMore field in the pagination object to determine if more results are available.

Notes

  • Media items are returned with their associated frames, captions, and detected objects
  • The blob URLs are publicly accessible and can be used directly in your applications
  • Frames are generated for videos and processed images, containing extracted or processed versions
  • Captions are generated by AI models and provide descriptive text about the content
  • The metadata object contains tags and moderation information that can be used for filtering and organization