Tutorial · Instagram · cURL, Python, Node.js, PHP, Go, Ruby

Get one Instagram story by its id

One story by id. Complete code for GET /v1/instagram/stories/{story} in six languages and both official SDKs, each tested against the documented response.

Short answer. One call returns one story: media_type, thumbnail_url, video_url, duration_seconds, taken_at, expires_at and its owner. Expired stories answer 404.

Facts checked 2 December 2026. Prices change: follow the links before you decide.

Why call it

  • Turn a story link a user shares into its media and owner.
  • Re-fetch one stored story without reading the whole stories list.
  • Attach a campaign story's media and timing to a client report.

The request

GET https://api.handlehaul.com/v1/instagram/stories/{story} with your key in the X-Api-Key header. One story by id. One story by id. 1 credit. Docs: https://api.handlehaul.com/docs/instagram-stories-api

Parameters for One story by id
ParameterInDescription
story requiredpathNumeric story id.
freshquerytrue skips the cache (full price).

Code in 6 languages

Each sample is a complete program: it reads the key from HANDLEHAUL_API_KEY, waits and retries when the API answers 429 (using Retry-After), stops with the error code on anything else. The SDK versions do the retries for you.

instagram-story.sh

# One story by id. --retry waits out a 429 using its Retry-After header;
# --fail exits with code 22 on any other error (drop it to read the error JSON).
curl -sS --fail --retry 3 "https://api.handlehaul.com/v1/instagram/stories/4169566713557935031" \
  -H "X-Api-Key: $HANDLEHAUL_API_KEY"
Generated from the OpenAPI spec (2026-12-02); every sample was syntax-checked and run against a local mock serving the response below. Language guides: Python, Node.js, PHP, Go, Ruby, cURL.

Response

One object in data and meta with what the call cost. Example values; one story object, as in the stories rows, from the API docs. Lists are cut to two rows here.

200 · application/json
{
  "data": {
    "id": "4169566713557935031",
    "taken_at": "2026-11-28T12:00:00.000Z",
    "expires_at": "2026-11-29T12:00:00.000Z",
    "media_type": "photo",
    "thumbnail_url": "https://scontent.cdninstagram.com/…/4169566713557935031.jpg",
    "video_url": null,
    "duration_seconds": null,
    "owner": {
      "id": "4555656181",
      "username": "sage_sage52",
      "full_name": "Sage Sage",
      "is_private": false,
      "is_verified": false,
      "profile_pic_url": "https://scontent.cdninstagram.com/…/4555656181.jpg"
    }
  },
  "meta": {
    "request_id": "req_…",
    "cached": false,
    "cache_age_seconds": 0,
    "credits_charged": 1,
    "credits_remaining": 26943
  }
}

Cost, cache and limits

  • 1 credit per call. At $1.40 to $0.80 per 1,000 calls. Cache hits, failed calls and 429 answers are free; meta.credits_charged says what each call cost.
  • Cache. Identical calls that arrive while an answer is cached are served from it. Add fresh=true to force a live call (billed).
  • Speed. Over your plan's requests-per-second limit the API answers 429 rate_limited with Retry-After; the samples wait that long and retry.
  • Testing. A kd_test_ key returns sample data in this exact shape at no cost, so you can run the code before you spend anything.

Things to know

  • story is the numeric story id, from a story URL or a stories list row.
  • Once expires_at has passed, the call answers 404.
  • Check media_type: photo stories have video_url: null.

Next steps

Instagram story by id API: questions

What happens if I request an expired Instagram story?
You get 404. Stories are live for 24 hours; for stories the account saved, use the highlights routes.
How do I get an Instagram story id from a link?
Pass the link to GET /v1/instagram/resolve?url=. It returns type: "story" with the ids and costs nothing.

Run it on real data

One key for Instagram and TikTok. $1.40 to $0.80 per 1,000 calls; failed calls and cache hits are free.

Want to test first? Sandbox keys are free and unlimited, with sample data in the live schema.