Facebook Video API
Send the link of a Facebook video, a Watch link, a link of the form facebook.com/{page}/videos/{id} or an fb.watch short link and get the video as JSON: caption, publication time, counters, the page behind it, and direct HD and SD MP4 links.
Request
GET /v1/facebook/videos ·
1 credit per successful call
curl "https://api.igramapi.com/v1/facebook/videos?url=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D2345678901234567" \
-H "Authorization: Bearer YOUR_API_KEY" import requests
response = requests.get(
"https://api.igramapi.com/v1/facebook/videos?url=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D2345678901234567",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
response.raise_for_status()
print(response.json()) const response = await fetch("https://api.igramapi.com/v1/facebook/videos?url=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D2345678901234567", {
method: "GET",
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
});
if (!response.ok) throw new Error((await response.json()).error.message);
console.log(await response.json()); <?php
$ch = curl_init("https://api.igramapi.com/v1/facebook/videos?url=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D2345678901234567");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data); Response
{
"id": "2345678901234567",
"url": "https://www.facebook.com/watch/?v=2345678901234567",
"caption": "How we set up the new studio, start to finish",
"created_at": 1761800000,
"video": {
"hd_url": "https://video.xx.fbcdn.net/v/example/clip-hd.mp4",
"sd_url": "https://video.xx.fbcdn.net/v/example/clip-sd.mp4",
"width": 1920,
"height": 1080,
"duration": 74.304,
"thumbnail_url": "https://scontent.xx.fbcdn.net/v/example/thumb.jpg",
"dash_manifest": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><MPD xmlns=\"urn:mpeg:dash:schema:mpd:2011\" …>…</MPD>"
},
"author": {
"id": "100012345678901",
"name": "Example Studio",
"url": "https://www.facebook.com/examplestudio",
"avatar_url": "https://scontent.xx.fbcdn.net/v/example/avatar.jpg",
"is_verified": true
},
"soundtrack": null,
"stats": {
"likes": 19288,
"comments": 719,
"shares": null,
"views_str": "1.5M"
},
"cached": false
} All values above are made-up examples. Media links are temporary Facebook CDN addresses.
Parameters
| Name | In | Description |
|---|---|---|
urlrequired | query | The video's link: a facebook.com/watch/?v= link, a /{page}/videos/{id} link, an fb.watch link or a facebook.com/share/v/ link. |
Response fields
| Field | Type | Description |
|---|---|---|
id / url | string | Video id and its canonical link. |
caption / created_at | string | null / integer | null | Caption and the Unix time it was published. |
video.hd_url / video.sd_url | string | null | Direct MP4 links in HD and SD (temporary CDN links). Either can be null when Facebook offers one quality only. |
video.width / height / duration | integer / number | Picture size in pixels and length in seconds. |
video.thumbnail_url | string | null | Preview image (temporary CDN link). |
video.dash_manifest | string | null | The full DASH manifest as an XML string, for adaptive players. About 12 to 15 KB, so skip it if you only need the MP4 links. |
author | object | id, name, url, avatar_url and is_verified of the page or person. |
soundtrack | object | null | Music credit, when Facebook shows one. |
stats | object | likes (all reactions), comments, shares and views_str (a formatted string such as 1.5M). |
cached | boolean | True when served from the short-lived cache. |
Watch and page videos
Long videos from Facebook Watch and from pages, not only short reels.
MP4 links in HD and SD
Progressive links you can play or download, plus the DASH manifest for adaptive players.
Counters and caption
Reactions, comments, shares and the view count as Facebook formats it, with the caption and publication time.
Same shape as reels
One response format for reels and videos, so one parser handles both.
What the Facebook video endpoint returns
The response describes one video: caption, created_at, a video object with the links, size, length and thumbnail, the author, and stats. A video that Facebook publishes in one quality only has either hd_url or sd_url set and the other null.
soundtrack is only filled when Facebook shows a music credit. A video without one returns null there.
Links and temporary files
Links copied from the app are often short links such as https://fb.watch/abc123/. They are followed for you.
Video and thumbnail links in the response are temporary CDN addresses. Download the file soon after the call instead of storing the link, and only save content you have the right to use.
Frequently asked questions
Which video links does it accept?
Watch links (/watch/?v=), page video links (/{page}/videos/{id}), reel links, fb.watch short links and facebook.com/share/ links.
What is the difference from the Reel API?
The response has the same shape. Use the Video API for Watch and page videos and the Reel API for reels. Both accept either kind of link, so a reel link sent to the Video API is understood.
Do the MP4 links expire?
Yes. They are temporary Facebook CDN links, so download the file soon after the call.
What if the video is private or deleted?
The API returns HTTP 404 with the code video_not_found.
Our errors cost nothing. Failures on our side (status 500 or above) and invalid requests (400, 422) are refunded, and every error has the same shape. See error handling and credits and rate limits.
Try the Facebook Video API free
Create a key and make your first request in minutes. 100 free credits every month.