Facebook Transcripts API
Read Facebook’s own text for a public video or reel. Native captions include start times and durations in seconds. When Facebook identifies the caption language, locale gives the selected track’s locale. Untimed text has no timestamps. A confirmed absence returns HTTP 200 with an error and costs one credit. A retrieval failure returns HTTP 503 without a charge.
Use videos[].id from the Facebook Video Search API as video_id.
API Parameters
Search Parameters
-
- Name
-
video_id - Required
- Required
- Description
-
Numeric ID of the public video or reel, such as videos[].id from Facebook Video Search.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Timed captions (response excerpt)
https://www.searchapi.io/api/v1/search?engine=facebook_transcripts&video_id=1646958220139239
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "facebook_transcripts",
"video_id": "1646958220139239"
}
response = requests.get(url, params=params)
print(response.text)
{
"source": "native_captions",
"locale": "en_US",
"transcripts": [
{
"text": "I love a beautiful roast dinner as much as the next person but",
"start": 0.0,
"duration": 3.161
},
{
"text": "this one pound wonder is going to blow your mind. It's a",
"start": 3.161,
"duration": 3.28
}
]
}
Untimed text (response excerpt)
https://www.searchapi.io/api/v1/search?engine=facebook_transcripts&video_id=2170463026877514
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "facebook_transcripts",
"video_id": "2170463026877514"
}
response = requests.get(url, params=params)
print(response.text)
{
"source": "untimed_text",
"transcripts": [
{
"text": "Top three must try dishes."
}
]
}
Unavailable transcript
https://www.searchapi.io/api/v1/search?engine=facebook_transcripts&video_id=1191953823653843
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "facebook_transcripts",
"video_id": "1191953823653843"
}
response = requests.get(url, params=params)
print(response.text)
{
"error": "Facebook has no public transcript for this video."
}