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

POST https://scrapeapi.pangolinfo.com/api/v1/social/youtube-transcript

Request Headers

ParametersParameter valueTypeDescription
Content-Typeapplication/jsonstringData format
AuthorizationBearer xxxstringAuthorization Token

Collection takes up to approximately 75 seconds. Set your client timeout to 90 seconds.

Request Parameters

ParameterRequiredTypeDescription
targetYesstringTarget URL, supported ID or search keyword for this operation.
optionsNoobjectOptional collection settings, described below.

options Parameters

ParameterRequiredTypeDescription
langNostringSubtitle 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

FieldTypeDescription
codeintegerStatus code; 0 indicates success.
messagestringResponse message; ok on success.
pointCostnumberPoints charged for this request.
dataobjectCollected data, with fields described below.
metaobjectRequest identifier and duration in milliseconds.
billingobjectCharged units, unit price and billing rule version.

data Fields

FieldTypeDescription
typestringResult type.
videoIdstringVideo id
urlstringContent URL.
languageobject | nullSelected subtitle language.
tracksobject[]Available subtitle tracks.
segmentsobject[]Subtitle segments belonging to the selected track.
textstringText value.

data.language Fields

FieldTypeDescription
codestring | nullStatus code; 0 indicates success.
namestring | nullName
isAutoGeneratedbooleanIs auto generated
isTranslatablebooleanIs translatable

data.tracks[] Fields

FieldTypeDescription
codestring | nullStatus code; 0 indicates success.
namestring | nullName
isAutoGeneratedbooleanIs auto generated
isTranslatablebooleanIs translatable

data.segments[] Fields

FieldTypeDescription
startMsnumberSegment start time in milliseconds.
durationMsnumberDuration in milliseconds.
textstringText value.

Request Example

curl --request POST \
  --url https://scrapeapi.pangolinfo.com/api/v1/social/youtube-transcript \
  --header 'Authorization: Bearer YOUR_PANGOLINFO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "target": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}'

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.

{
  "code": 0,
  "message": "ok",
  "pointCost": 0.8,
  "data": {
    "type": "transcript",
    "videoId": "dQw4w9WgXcQ",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "language": {
      "code": "en",
      "name": "English",
      "isAutoGenerated": false,
      "isTranslatable": true
    },
    "tracks": [
      {
        "code": "en",
        "name": "English",
        "isAutoGenerated": false,
        "isTranslatable": true
      }
    ],
    "segments": [
      {
        "startMs": 1360,
        "durationMs": 1680,
        "text": "[♪♪♪]"
      }
    ],
    "text": "[♪♪♪]\n♪ We're no strangers to love ♪\n♪ You know the rules and so do I ♪\n♪ A full commitment's what I'm thinking of ♪\n♪ You wouldn't get this from any other g..."
  },
  "meta": {
    "requestId": "pg-audit-r1-youtube-transcript-1793954279655693700",
    "durationMs": 5817
  },
  "billing": {
    "unitPrice": 0.8,
    "ruleVersion": "social-primary-v2",
    "billedCount": 1,
    "pointCost": 0.8
  }
}

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.

Try it