StoriesFly logo
Search endpoint

Top posts search API

The top posts and reels Instagram shows for a text (q). Pass next_cursor back as cursor for the next page.

GEThttps://storiesfly.com/api/v1/search/top
  • Price 1 request
  • Answers up to 30 minutes old

Parameters

All parameters go in the query string.

NameTypeSentDescription
qstringrequiredText to search for, 1 to 100 characters.
cursorstringoptionalThe next_cursor of the page before. Leave it out for the first page.

Example request

Put your own key in the header, or in the apiKey option of the npm client.

curl "https://storiesfly.com/api/v1/search/top?q=coffee" \
  -H "X-Api-Key: sf_live_your_key"

Example response

200 OK · X-Units-Charged: 1
{
  "posts": [
    {
      "id": "3775388867949170453",
      "shortcode": "DRk4CwrEw8V",
      "url": "https://www.instagram.com/reel/DRk4CwrEw8V/",
      "owner": {
        "id": "64267544477",
        "username": "etetecoffeedubai"
      },
      "taken_at": 1764281461,
      "taken_at_iso": "2025-11-27T22:11:01.000Z",
      "caption": "Who needs a coffee?\nTake this as your sign to order one.\n\n📍 S-14 Al Garhoud Business Center, Dubai\n🕒 Mon–Sat: 7 AM–9 PM | Sun: 9:30 AM–8 PM\n\n#EteteCoffeeDuba…",
      "media_type": "reel",
      "pinned": false,
      "thumbnail_url": "https://scontent-lga3-2.cdninstagram.com/v/t51.71878-15/587966599_698623063306634_4273417339304580414_n.jpg",
      "media": [
        {
          "id": "3775388867949170453",
          "type": "video",
          "image_url": "https://scontent-lga3-2.cdninstagram.com/v/t51.71878-15/587966599_698623063306634_4273417339304580414_n.jpg",
          "video_url": "https://scontent-lga3-1.cdninstagram.com/o1/v/t2/f2/m86/AQO1ATTj0hBOkLWaQqVxpnaOyLNnQhoCRwha8k_yi2WjyLZxJSwKFLbQXU-b7-fnJn4kTnaWWh9T9RbrRhAJNQgatjkmpaZHMZNbhLo…",
          "width": 1080,
          "height": 1920,
          "video_duration": 7.012
        }
      ],
      "likes": 26628,
      "comments": 177,
      "shares": 19412,
      "reposts": 853,
      "views": 1290459,
      "saves": null,
      "video_duration": 7.012,
      "counts_hidden": false
    },
    {
      "id": "3759329587339814426",
      "shortcode": "DQr0leHAWYa",
      "url": "https://www.instagram.com/reel/DQr0leHAWYa/",
      "owner": {
        "id": "6799563409",
        "username": "sipsbylilly"
      },
      "taken_at": 1762367056,
      "taken_at_iso": "2025-11-05T18:24:16.000Z",
      "caption": "daily affirmations 🤲\n\ndetails:\n- ice\n- butter pecan syrup\n- cinnamon\n- whole milk\n- single shot\n\n#icedcoffee #coffee #coffeeislife #homecafé #pecanpie #pecan",
      "media_type": "reel",
      "pinned": false,
      "thumbnail_url": "https://scontent-lga3-2.cdninstagram.com/v/t51.71878-15/573067920_1751584825549262_7946811511755409430_n.jpg",
      "media": [
        {
          "id": "3759329587339814426",
          "type": "video",
          "image_url": "https://scontent-lga3-2.cdninstagram.com/v/t51.71878-15/573067920_1751584825549262_7946811511755409430_n.jpg",
          "video_url": "https://scontent-lga3-1.cdninstagram.com/o1/v/t16/f2/m69/AQNFISjtXoivUMNBqisAhkcHrMM2wWPizwNTRtLWBEVSONXNjcGRCGSleKFi1KkVkQTmfLC7RedGXpvymk3ThUMv.mp4",
          "width": 1080,
          "height": 1920,
          "video_duration": 9.613
        }
      ],
      "likes": 45087,
      "comments": 198,
      "shares": 6905,
      "reposts": 1254,
      "views": 1229610,
      "saves": null,
      "video_duration": 9.613,
      "counts_hidden": false
    }
  ],
  "next_cursor": "c1.ryg6VkAgkE2BcPyGM0q6ADwLG1KAGWvXyxXcleap6rtdnm6USXXD4rRRujLUjticHxS2vixe2jbdlG4LggGvIE1ISp6sYLXI6XWcb66UIrM_RMPDKCUhQylnCgNoMsPrfzM",
  "has_more": true
}

A real answer, shortened: lists are cut to two items and long texts to 160 characters.

Price and freshness

A call takes 1 request. Free requests are spent first, then your balance. The pricing page has the rates.

Answers are kept for up to 30 minutes. Asking again inside that time returns the same answer and takes 1 request again.

Page size follows Instagram and varies by endpoint.

Errors

A failed call answers with an HTTP status and a body {error, code}. These are the codes this endpoint gives. Errors and what is charged covers all of them.

StatusCodeWhen
400bad_requestA parameter is missing or wrong. fields lists the names. Free.
401unauthorizedThe X-Api-Key header is missing or the key is wrong. Free.
402credits_exhaustedThe free requests and the balance are used up. The answer has a topup_url, and free_requests_with_telegram when the account has no Telegram linked. Top up in the dashboard. Free.
429rate_limitedMore requests in a second than your level allows. Wait for the Retry-After header. Free.
500internal_errorA fault on our side. Retry shortly. Refunded.
503upstream_unavailableOur side failed or timed out. Retry shortly. Refunded.
FAQ

Questions about this endpoint

What are the top posts?

The posts Instagram shows first for a text. Their order is Instagram's, not ours.

How do I read all the top posts for a text?

Send the next_cursor of the answer back as cursor for the next page, and stop when has_more is false. Each page takes 1 request. A cursor works only on the endpoint that returned it.

How is this different from hashtag/posts?

This takes any text. hashtag/posts takes a hashtag name and lists the posts under it.

Your first 100 requests are on us

Sign in with Google or Telegram, create a key, call any endpoint. Top up only when you need more.