Facebook data API

Facebook Stories API

Send a stories link, a page or profile link, or a numeric profile id and get the stories it has live right now as JSON: photo and video links in HD and SD, size, length, publication and expiry times, and the page or person they belong to.

Request

GET /v1/facebook/stories · 2 credits per successful call

cURL
curl "https://api.igramapi.com/v1/facebook/stories?url=https%3A%2F%2Fwww.facebook.com%2Fstories%2F1461420177232682" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

200 OK · application/json
{
  "bucket_id": "1461420177232682",
  "user_id": "100012345678901",
  "name": "Example Studio",
  "avatar_url": "https://scontent.xx.fbcdn.net/v/example/avatar.jpg",
  "count": 2,
  "items": [
    {
      "story_id": "UzpfSVNDOjEyMzQ1Njc4OTAxMjM0NQ==",
      "type": "photo",
      "media_url": "https://scontent.xx.fbcdn.net/v/example/story-1.jpg",
      "sd_url": null,
      "thumbnail": null,
      "width": 1080,
      "height": 1920,
      "duration": null,
      "taken_at": 1761890000,
      "expires_at": 1761976400
    },
    {
      "story_id": "UzpfSVNDOjIzNDU2Nzg5MDEyMzQ1Ng==",
      "type": "video",
      "media_url": "https://video.xx.fbcdn.net/v/example/story-2-hd.mp4",
      "sd_url": "https://video.xx.fbcdn.net/v/example/story-2-sd.mp4",
      "thumbnail": "https://scontent.xx.fbcdn.net/v/example/story-2.jpg",
      "width": 720,
      "height": 1280,
      "duration": 14.5,
      "taken_at": 1761895000,
      "expires_at": 1761981400
    }
  ],
  "cached": false
}

All values above are made-up examples. Media links are temporary Facebook CDN addresses.

Parameters

NameInDescription
urlrequired query A stories link (facebook.com/stories/{id}), a page or profile link (facebook.com/{name}) or a numeric profile id.

Response fields

FieldTypeDescription
bucket_idstring | nullFacebook's id of the story set, the number in facebook.com/stories/{id}.
user_id / name / avatar_urlstring | nullThe page or profile the stories belong to, and its picture (temporary CDN link).
countintegerNumber of active stories returned.
items[].story_id / typestringStory id, and photo or video.
items[].media_url / sd_urlstring / string | nullDirect link to the photo or the best video quality, and a lower-quality video link when there is one.
items[].thumbnailstring | nullPreview image of a video story.
items[].width / height / durationinteger | null / number | nullSize in pixels, and length in seconds for videos.
items[].taken_at / expires_atinteger | nullUnix time the story was published and the time it disappears.
cachedbooleanTrue when served from the short-lived cache.

Photos and videos

Every active story with a direct CDN link: the photo, or the video in the best quality offered, plus sd_url for a lighter copy.

Expiry times

taken_at and expires_at say when each story went up and when it disappears, so you know how long the links are worth keeping.

From a link or an id

Pass a stories link, a page or profile link or a numeric id. A link to one story returns just that story.

Who posted it

name, user_id and avatar_url identify the page or person, with count for the number of active stories.

What the Facebook stories endpoint returns

The response lists the stories a page or profile has live now, oldest first. Each item has a type (photo or video), media_url, the size in pixels and, for videos, duration, thumbnail and an sd_url when Facebook offers a second quality.

A page or profile with no active story returns count: 0 and an empty items list. A link to a single story (facebook.com/stories/{id}/{story}) returns only that story, or HTTP 404 with the code story_not_found once it has expired.

Temporary links

Story links point to Facebook's CDN and are temporary, and the stories themselves disappear after 24 hours. Download the files soon after the call if you need a copy, and only save content you have the right to use. Read our Acceptable Use Policy first.

Plans and pricing

Stories work on every plan and cost 2 credits per call, including a call that finds no active story. When Facebook cannot be read, the request returns HTTP 502 with the code upstream_error and is not charged.

Frequently asked questions

What can I send as url?

A stories link such as facebook.com/stories/1461420177232682, a page or profile link such as facebook.com/examplestudio, or a numeric profile id.

Which plans include Facebook stories?

Every plan, including Free. Each call costs 2 credits.

What if the page has no story right now?

You get count: 0 and an empty items list. The call still costs 2 credits.

Can I read stories of a private profile or a friends-only story?

No. Only stories that Facebook shows publicly are returned.

Do the links expire?

Yes. They are temporary Facebook CDN links, and the stories themselves end after 24 hours. Download what you need soon after the call.

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 Stories API free

Create a key and make your first request in minutes. 100 free credits every month.