Skip to Content
Developer APISubtitle Extraction API

Subtitle Extraction API

Note

API Overview

This API is used to extract video subtitles. Currently, only YouTube is supported. If you need support for other platforms, please contact customer service.

🎯 Basic Information

ItemDetails
Endpointhttps://api.meowload.net/openapi/extract/subtitles
MethodPOST
Content-Typeapplication/json

📋 Request Parameters

Headers

ParameterTypeRequiredDescription
x-api-keystringYesAPI key, obtained from the Developer Management Center 
accept-languagestring-Error message language, defaults to en
Supported: zh, en, ja, es, de, etc.

Request Body

ParameterTypeRequiredDescription
urlstringYesVideo share link URL

Request Example

curl -X POST https://api.meowload.net/openapi/extract/subtitles \ -H "Content-Type: application/json" \ -H "x-api-key: your-api-key-here" \ -H "accept-language: zh" \ -d '{ "url": "https://www.youtube.com/watch?v=bdLEBN6JKPY" }'

🟢 Success Response

HTTP Status Code: 200 OK

Response Example

{ "id": "bdLEBN6JKPY", "text": "Germán Santillán: A taste of Mexico's ancient chocolate-making tradition | TED", "description": "Dating back more than 800 years, chocolate is deeply woven into the Indigenous history of Oaxaca, Mexico. TED Fellow Germán Santillán talks about his work reviving the Mixtec technique used to prepare this ancient delicacy by training a new generation of local farmers -- helping create economic opportunity and preserve a delicious legacy at the same time.", "duration": 363, "published_at": "2021-09-13T08:00:32-07:00", "thumbnail_url": "https://i.ytimg.com/vi_webp/bdLEBN6JKPY/maxresdefault.webp", "subtitles": [ { "language_name": "Chinese (China)", "language_tag": "zh-CN", "urls": [ { "url": "https://www.youtube.com/api/timedtext?fmt=srt&lang=zh-CN&v=bdLEBN6JKPY", "format": "srt" }, { "url": "https://www.youtube.com/api/timedtext?fmt=vtt&lang=zh-CN&v=bdLEBN6JKPY", "format": "vtt" } ] }, { "language_name": "English", "language_tag": "en", "urls": [ { "url": "https://www.youtube.com/api/timedtext?fmt=srt&lang=en&v=bdLEBN6JKPY", "format": "srt" }, { "url": "https://www.youtube.com/api/timedtext?fmt=vtt&lang=en&v=bdLEBN6JKPY", "format": "vtt" } ] } ] }

Response Field Descriptions

FieldTypeAlways ReturnedDescription
idstring-Video ID
textstringYesVideo title
descriptionstring-Detailed video description
durationnumber-Video duration (seconds)
published_atstring-Video publish time
thumbnail_urlstring-Video thumbnail URL
subtitlesarrayYesSubtitle list array

subtitles Array Fields

FieldTypeAlways ReturnedDescription
language_namestringYesLanguage name (e.g., “Chinese (China)“)
language_tagstringYesLanguage tag (e.g., “zh-CN”)
urlsarrayYesSubtitle download links in various formats for this language

urls Array Fields

FieldTypeAlways ReturnedDescription
formatstringYesSubtitle format
srt, vtt, ttml, json3, srv1, srv2, srv3
urlstringYesSubtitle file download URL

🔴 Error Response

HTTP Status Code: non-200 (e.g., 400, 401, 402, 422, 500)

Error Response Example

{ "message": "链接格式错误" }

HTTP Status Code Reference

Status CodeDescriptionCommon CauseSolution
200Success--
400Business ErrorExtraction failed, link contains no valid mediaCheck if the link is correct and contains video/images, etc.
401Authentication FailedInvalid or expired API KeyVerify that x-api-key is correct
402Credits ExhaustedAPI call quota used upVisit the Management Center  to top up
422Parameter ErrorIncorrect link formatCheck the url parameter format
500Server ErrorInternal server errorContact technical support

💻 Code Examples

Python

import requests api_url = "https://api.meowload.net/openapi/extract/subtitles" api_key = "your-api-key-here" payload = { "url": "https://www.youtube.com/watch?v=bdLEBN6JKPY" } headers = { "x-api-key": api_key, "accept-language": "zh" } response = requests.post(api_url, json=payload, headers=headers) if response.status_code == 200: data = response.json() print(f"✅ Extraction successful!") print(f"Video title: {data['text']}") print(f"Subtitle languages: {len(data['subtitles'])}") # Download the first language's SRT subtitle if data['subtitles']: first_lang = data['subtitles'][0] print(f"\nDownloading {first_lang['language_name']} subtitles...") # Find the SRT format srt_url = next( (u['url'] for u in first_lang['urls'] if u['format'] == 'srt'), None ) if srt_url: subtitle_response = requests.get(srt_url) with open(f"{first_lang['language_tag']}.srt", 'wb') as f: f.write(subtitle_response.content) print(f"✅ Subtitle saved: {first_lang['language_tag']}.srt") else: error = response.json() print(f"❌ Request failed: {error['message']}")

Golang

package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" "os" ) type SubtitlesRequest struct { URL string `json:"url"` } type SubtitleURL struct { URL string `json:"url"` Format string `json:"format"` } type Subtitle struct { LanguageName string `json:"language_name"` LanguageTag string `json:"language_tag"` URLs []SubtitleURL `json:"urls"` } type SubtitlesResponse struct { ID string `json:"id"` Text string `json:"text"` Description string `json:"description"` Duration int `json:"duration"` PublishedAt string `json:"published_at"` ThumbnailURL string `json:"thumbnail_url"` Subtitles []Subtitle `json:"subtitles"` } func main() { apiURL := "https://api.meowload.net/openapi/extract/subtitles" apiKey := "your-api-key-here" requestBody := SubtitlesRequest{ URL: "https://www.youtube.com/watch?v=bdLEBN6JKPY", } jsonData, _ := json.Marshal(requestBody) req, _ := http.NewRequest("POST", apiURL, bytes.NewBuffer(jsonData)) req.Header.Set("Content-Type", "application/json") req.Header.Set("x-api-key", apiKey) req.Header.Set("accept-language", "zh") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Printf("❌ Request failed: %v\n", err) return } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) if resp.StatusCode == 200 { var result SubtitlesResponse json.Unmarshal(body, &result) fmt.Println("✅ Extraction successful!") fmt.Printf("Video title: %s\n", result.Text) fmt.Printf("Subtitle languages: %d\n", len(result.Subtitles)) // Download the first language's SRT subtitle if len(result.Subtitles) > 0 { firstLang := result.Subtitles[0] fmt.Printf("\nDownloading %s subtitles...\n", firstLang.LanguageName) // Find the SRT format var srtURL string for _, urlInfo := range firstLang.URLs { if urlInfo.Format == "srt" { srtURL = urlInfo.URL break } } if srtURL != "" { subtitleResp, _ := http.Get(srtURL) defer subtitleResp.Body.Close() subtitleData, _ := io.ReadAll(subtitleResp.Body) filename := firstLang.LanguageTag + ".srt" os.WriteFile(filename, subtitleData, 0644) fmt.Printf("✅ Subtitle saved: %s\n", filename) } } } else { fmt.Printf("- Request failed (%d)\n", resp.StatusCode) } }

💡 Tips

1. Batch Download All Language Subtitles

def download_all_subtitles(video_url, api_key, format='srt', output_dir='subtitles'): import os os.makedirs(output_dir, exist_ok=True) # Get subtitle information response = requests.post( "https://api.meowload.net/openapi/extract/subtitles", json={"url": video_url}, headers={"x-api-key": api_key} ) if response.status_code != 200: print(f"❌ Fetch failed: {response.json()['message']}") return data = response.json() # Download the specified format subtitle for all languages for subtitle in data['subtitles']: lang_tag = subtitle['language_tag'] lang_name = subtitle['language_name'] # Find the URL for the specified format url_info = next( (u for u in subtitle['urls'] if u['format'] == format), None ) if url_info: subtitle_resp = requests.get(url_info['url']) filename = f"{lang_tag}.{format}" filepath = os.path.join(output_dir, filename) with open(filepath, 'wb') as f: f.write(subtitle_resp.content) print(f"✅ Download complete: {lang_name} ({filename})") # Usage example download_all_subtitles( "https://www.youtube.com/watch?v=bdLEBN6JKPY", "your-api-key-here", format='srt', output_dir='my_subtitles' )

2. Check for a Specific Language Subtitle

def has_subtitle_language(subtitles, language_tag): """Check if subtitles are available in a specific language""" return any(s['language_tag'] == language_tag for s in subtitles) # Usage example if has_subtitle_language(data['subtitles'], 'zh-CN'): print("✅ Chinese subtitles available") else: print("❌ Chinese subtitles not available")

3. Subtitle Format Reference

FormatFull NameDescriptionRecommended Use Case
srtSubRip TextMost commonly used subtitle formatGeneral media players
vttWebVTTWeb video subtitle formatHTML5 video players
ttmlTTMLXML-based subtitle formatProfessional video editing
json3YouTube JSONJSON format with metadataProgrammatic processing
srv1YouTube Server Format 1YouTube server format 1YouTube internal use
srv2YouTube Server Format 2YouTube server format 2YouTube internal use
srv3YouTube Server Format 3YouTube server format 3YouTube internal use
Tip

Format Selection Guide

  • General download: Recommended to use srt format for best compatibility
  • Web playback: Recommended to use vtt format with native HTML5 support
  • Professional editing: Recommended to use ttml format for the richest feature set
  • Programmatic processing: Recommended to use json3 format for easy parsing
  • srv series: For special use cases only; most users can ignore these