YouTube Transcript API
Collect subtitle text, timed segments and language information for a YouTube video.
API Description
YouTube Transcript API — Collect subtitle text, timed segments and language information for a YouTube video.
Authenticate with your Pangolinfo API Key to receive structured JSON data.
Request URL
Request Headers
| Parameters | Parameter value | Type | Description |
|---|---|---|---|
| Content-Type | application/json | string | Data format |
| Authorization | Bearer xxx | string | Authorization Token |
Collection takes up to approximately 75 seconds. Set your client timeout to 90 seconds.
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| target | Yes | string | Target URL, supported ID or search keyword for this operation. |
| options | No | object | Optional collection settings, described below. |
options Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| lang | No | string | Subtitle language code, e.g. en. Manual captions take priority. If unavailable, the default track is returned. |
Only the request parameters listed on this page are used; other fields are ignored. Pass pagination cursors back unchanged, without encoding, decoding or conversion.
Response Fields
| Field | Type | Description |
|---|---|---|
| code | integer | Status code; 0 indicates success. |
| message | string | Response message; ok on success. |
| pointCost | number | Points charged for this request. |
| data | object | Collected data, with fields described below. |
| meta | object | Request identifier and duration in milliseconds. |
| billing | object | Charged units, unit price and billing rule version. |
data Fields
| Field | Type | Description |
|---|---|---|
| type | string | Result type. |
| videoId | string | Video id |
| url | string | Content URL. |
| language | object | null | Selected subtitle language. |
| tracks | object[] | Available subtitle tracks. |
| segments | object[] | Subtitle segments belonging to the selected track. |
| text | string | Text value. |
data.language Fields
| Field | Type | Description |
|---|---|---|
| code | string | null | Status code; 0 indicates success. |
| name | string | null | Name |
| isAutoGenerated | boolean | Is auto generated |
| isTranslatable | boolean | Is translatable |
data.tracks[] Fields
| Field | Type | Description |
|---|---|---|
| code | string | null | Status code; 0 indicates success. |
| name | string | null | Name |
| isAutoGenerated | boolean | Is auto generated |
| isTranslatable | boolean | Is translatable |
data.segments[] Fields
| Field | Type | Description |
|---|---|---|
| startMs | number | Segment start time in milliseconds. |
| durationMs | number | Duration in milliseconds. |
| text | string | Text value. |
Request Example
Response Example
This excerpt shows the first item of each list. Long text and URLs are shortened; pointCost is the charge for the complete response. The playground contains the full schema.
Points Usage
0.8 points per non-empty subtitle track. Segments within the track are not charged separately.
Empty results and failed requests are not charged. Duplicate IDs are counted once within a response. Separate calls and pages are billed separately. See Social Media Reviews API billing.

