This guide covers fetching captions (subtitles) for YouTube videos using the Poix.io API.

Request examples

In this request, we are fetching data for the YouTube video with the ID dQw4w9WgXcQ. You can provide up to 1k video IDs in the ids array to fetch data for multiple videos.

Response example

[
  {
    "text": "[Music]",
    "duration": 14.65,
    "offset": 0,
    "lang": "en",
    "wordCount": 1,
    "speechRate": 5
  },
  {
    "text": "we're no strangers to",
    "duration": 7.239,
    "offset": 18.8,
    "lang": "en",
    "wordCount": 7,
    "speechRate": 59
  },
  // ...
  {
    "text": "goodbye",
    "duration": 5.32,
    "offset": 208.68,
    "lang": "en",
    "wordCount": 1,
    "speechRate": 12
  },
  {
    "text": "and",
    "duration": 3,
    "offset": 211,
    "lang": "en",
    "wordCount": 1,
    "speechRate": 20
  }
]

The response contains an array of caption objects, each representing a caption line.

Make your first request in playground on docs at Get video captions.