Table of contents

Captions API

The Captions API allows users to view, add, or delete caption files from an item. This is useful for managing multiple caption files for a single item.

Get all captions for an item

GET /api/data/v3/items/{item_id}/captions
  • {item_id} - (string) ID of Item to set categories.

Response

{
    "captions": {
        "captions": [
            {
                "id": "5b20557199bf28c679bbecbf1f94a2e0",
                "source": "captions",
                "language": {
                  "language" : "eng",
                  "confidence": 0.99
                },
                "added_at": 1570136199,
                "transcript": [
                    {
                        "end_at": 3.269,
                        "start_at": 1.7349999999999999,
                        "text": "Mom,"
                    },
                    {
                        "end_at": 4.204,
                        "start_at": 3.304,
                        "text": "I may not have the words"
                    },
                    {
                        "end_at": 5.672,
                        "start_at": 4.2379999999999995,
                        "text": "to thank you for everything"
                    },
                    {
                        "end_at": 8.641,
                        "start_at": 5.7059999999999995,
                        "text": "you've done for me -"
                    },
                    {
                        "end_at": 10.943999999999999,
                        "start_at": 8.676,
                        "text": "the sacrifices you've made,"
                    },
                    {
                        "end_at": 13.947,
                        "start_at": 10.978,
                        "text": "the love and care you've given..."
                    },
                    {
                        "end_at": 15.482,
                        "start_at": 13.981,
                        "text": "But no matter what,"
                    },
                    {
                        "end_at": 17.884,
                        "start_at": 15.516,
                        "text": "you'll always have my respect,"
                    },
                    {
                        "end_at": 20.787,
                        "start_at": 17.918,
                        "text": "my gratitude"
                    },
                    {
                        "end_at": 23.423,
                        "start_at": 20.821,
                        "text": "and most especially,"
                    },
                    {
                        "end_at": 25.558,
                        "start_at": 23.457,
                        "text": "my love."
                    },
                    {
                        "end_at": 28.962,
                        "start_at": 25.593,
                        "text": "Happy Mother's day."
                    }
                ]
            }
        ]
    }
}

Download a caption file

GET /api/data/v3/items/{item_id}/captions/download?caption_id={caption_id}

Captions that were extraced from the contents embedded in video files will be downloaded as .SRT files. Captions that were uploaded to existing items will be download in the format of the original file.

  • {item_id} - (string) ID of Item to set categories.
  • {caption_id} - (string) ID of the Item Captions to be downloaded.

Add a caption file

POST  /api/data/v3/items/{item_id}/captions
form-data: (key="caption_file" file="caption.SRT")
  • {item_id} - (string) ID of Item to set categories.

Delete a caption file

DELETE /api/data/v3/items/{item_id}/captions?caption_id={caption_id}
  • {item_id} - (string) ID of Item to set categories.
  • {caption_id} - (string) ID of the Item Captions to be deleted.

This documentation is generated from the latest version of GrayMeta Platform. For documentation relevant to your own deployed version, please use the documentation inside the application.