Social Media

How do you scrape Instagram profiles via API without getting blocked?

Call ReefAPI's instagram profile action with a username and read follower counts, bio, verification, both user ids and the twelve most recent posts back as JSON in one call. No login. The behaviour to code around: a username that does not exist comes back as a retryable block rather than as a not-found.

Instagram Public Data engineLive JSON5 steps1,000 free credits

This guide demonstrates the real Instagram Public Data API engine with a captured response from . The example is only published because the engine passed the SEO snapshot gate.

Use case

Creator analytics, influencer vetting, brand monitoring and social listening.

Step by step

Call the live endpoint

  1. 1

    Resolve the handle once, then key on user_id

    profile returns user_id and fbid alongside the username. Store the numeric id; handles change hands and your history follows the id, not the name.

  2. 2

    Take recent_posts from the profile call

    Twelve posts with likes, comments, timestamps and media type arrive inline. Only call posts separately when you need to page further back.

  3. 3

    Split metrics by media_type before averaging

    video_view_count exists only on videos. Images and carousels have likes and comments. A mixed-feed average across those is not comparable.

  4. 4

    Re-host images rather than hotlinking

    Instagram's CDN URLs are signed with an expiry. Download what you need to keep; the URL alone is not durable storage.

  5. 5

    Cap retries per username

    A nonexistent handle returns TARGET_BLOCKED with retryable true. Two or three failures on the same handle means the account is gone, not that the target is busy.

Code

Copy the request

These snippets use the captured request params for instagram/v1/profile.

curl -X POST https://api.reefapi.com/instagram/v1/profile \
  -H "x-api-key: $REEF_KEY" \
  -H "content-type: application/json" \
  -d '{"username":"nike"}'
MCP one-liner
Ask your MCP-connected assistant: call reefapi.instagram.profile with {"username":"nike"}.
Real response

Captured output from ReefAPI

Captured on UTC. The response below is the committed snapshot, including the API envelope and metadata.

Captured request
{
  "method": "POST",
  "url": "https://api.reefapi.com/instagram/v1/profile",
  "headers": {
    "x-api-key": "$REEF_KEY",
    "content-type": "application/json"
  },
  "body": {
    "username": "nike"
  }
}
Captured response
{
  "ok": true,
  "meta": {
    "api": "instagram",
    "endpoint": "profile",
    "mode": "live",
    "latency_ms": 3094,
    "record_count": 1,
    "bytes": 19335,
    "cache_hit": false,
    "content_type": "application/json",
    "status": 200,
    "charged_credits": 1,
    "version": "0.1.0"
  },
  "data": {
    "username": "nike",
    "full_name": "Nike",
    "biography": "Just Do It.",
    "bio_links": [
      {
        "url": "http://empli.fi/nike",
        "link_type": "external"
      }
    ],
    "pronouns": [],
    "follower_count": 291153768,
    "following_count": 266,
    "is_verified": true,
    "is_private": false,
    "is_business": false,
    "bio_mentions": [],
    "bio_hashtags": [],
    "profile_pic": "https://scontent-mia3-3.cdninstagram.com/v/t51.82787-19/551608484_18567162979020081_1135468084872726555_n.jpg?_nc_cat=1&ccb=7-5&_nc_sid=bf7eb4&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4zOTkuQzMifQ%3D%3D&_nc_ohc=l3wg8iAkAc4Q7kNvwGrv800&_nc_oc=AdqsIB_UOVqhBZnp6TJTqHBH1XRZljJXcvBXfKI_9-ttkC0MUWZB6sM08v-_LGymyWE&_nc_zt=24&_nc_ht=scontent-mia3-3.cdninstagram.com&_nc_gid=sbg46OqaQb5lcAz2cmF4xQ&_nc_ss=7fa8c&oh=00_AQJHYUHf-MOZmJSq0zMFg4S_plavbGYKu5DepYJDjpTNMw&oe=6ABA30FA",
    "external_url": "http://empli.fi/nike",
    "user_id": "13460080",
    "fbid": "17841400602400210",
    "is_regulated_c18": false,
    "recent_posts": [
      {
        "media_id": "3991849403537918302",
        "shortcode": "Ddl5eH-u4le",
        "media_type": "video",
        "product_type": "clips",
        "caption": "*Just a normal day for @caitlinclark22.\n\nWake up. Eat cereal. Lace up the Caitlin 1. Sell out arenas. Repeat.",
        "accessibility_caption": "Video by Nike on September 22, 2026. May be an image of text.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/809201733_18666457525020081_2045154896762681305_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=106&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=m52AhuHtrL0Q7kNvwE-cB_0&_nc_oc=Ado5_OotZvfMHfOg-jv6DFj47RMIf7ym8bNxWqIdJ5FD3TgQOfvKgGTFmHQVIu-EQpQ&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQJc0g1w_beKo84ePao6wNvGReRZtaNIxVGsWz6AhmNUUw&oe=6ABA1FFB",
        "is_video": true,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3989102691637366197",
        "shortcode": "DdcI8NLmY21",
        "media_type": "carousel",
        "product_type": "carousel_container",
        "caption": "Nike Atelier for Sha’Carri Richardson reflects the beauty of London after rainfall through luminous details, weathered textures, and sculptural silhouettes defined by strength and movement.\n\nThe bespoke look debuts on the red carpet at @athlos A26 in London. \n\nBuilt to push beyond convention, the Nike FlyWeb bra uses computational design to engineer fit and support down to the millimeter. Precision-made for an athlete redefining power on and off the track.\n\nThe Nike Atelier Vomero Premium takes a performance silhouette into new territory, embellished with hand-set Swarovski® Crystals shimmering like water droplets above reflective Air Zoom units.\n\n“You don’t have to choose one version of yourself. Every side of you can be powerful.”\n\nSha’Carri Richardson\n\nLight and movement shape every detail of the Nike Atelier jacket, with hand-set Swarovski® Crystals that catch the light like raindrops across the reflective outer layer.\n\nMade in Japan from premium crackled leather, the Nike Atelier Duffel Mini is accessorized with oversized custom charms that celebrate Sha’Carri’s connection to the track.\n\nNike Atelier. One of One.",
        "accessibility_caption": "Photo by Nike on September 18, 2026. May be an image of text that says 'NIKE NIKEATELIER ATELIER'.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/796460834_18665219536020081_4779922114140616445_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=1&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0FST1VTRUxfSVRFTS5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=YlZ6-T_wry4Q7kNvwFIMtmx&_nc_oc=AdpRdR4k9xAESwxtb1g1SpRu0Tj39RhdI3xeuDPVJN7LYKmbnJKhOA3iflt-k0MiQ_M&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQIW71i4FrdpF3anZ42fuxOlUwRSC-ys7IS0fQyQSMuaQw&oe=6ABA143B",
        "is_video": false,
        "carousel_media_count": 7,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3984877986863034700",
        "shortcode": "DdNIWqQPrFM",
        "media_type": "image",
        "product_type": "feed",
        "caption": "Respectfully brutal. @bokrugby tough out a series only rugby’s greatest can produce.",
        "accessibility_caption": "Photo by Nike on September 12, 2026. May be an image of football, ball, sports equipment and text that says 'รรร Grecn and gold. The last thing you see before it goes all black.'.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/808535567_18663415465020081_8300401525546067823_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=106&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiRkVFRC5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=snAr8GCGKeoQ7kNvwGy6SIk&_nc_oc=AdrgR4qwzX1u22_miZbdiqOM9_mAB_lD7guFhf-SPyo5-2vw7XOSVb42EUlUh-5msMM&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQJIvzFWpfWhjsKnKQ6z_Ybx6KKlgNZpus0pAfJ6pEIx7Q&oe=6ABA3255",
        "is_video": false,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3984692633858210943",
        "shortcode": "DdMeNa0O_x_",
        "media_type": "image",
        "product_type": "feed",
        "caption": "New York, Paris, Melbourne, and London have one thing in common. @nielsvink goes four for four on the year, securing the calendar year Grand Slam, by winning major titles in every corner of the globe.",
        "accessibility_caption": "Niels Vink celebrates a point in New York in a wheelchair, tongue out, wearing a black Nike tennis kit. Headline \"Won all 4. Hungry for more.\" and the Nike logo.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/806299551_18663322408020081_1997829106507125055_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=1&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiRkVFRC5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=MZGYYjwo-iUQ7kNvwFNOJ4w&_nc_oc=Adr1r7GSgqdwMplrldAtSMATpQocDqVIqU84VH28_pgaOt4P1r2og94fP4EQBM-PMj0&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQLNculwOdRy6yBiV9JMoAm0wQziL5hMAmBHZZF6wt9Etg&oe=6ABA1C8E",
        "is_video": false,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3977354183208478944",
        "shortcode": "DcyZo6EDijg",
        "media_type": "carousel",
        "product_type": "carousel_container",
        "caption": "No moment is too small to win.\n\nGrab the Sabrina 4 “The Switch” launching 9.5",
        "accessibility_caption": "Photo by Nike Basketball on September 02, 2026. May be an image of text.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/791144760_18627521548035900_8030782657832792891_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=106&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0FST1VTRUxfSVRFTS5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=7qTi-KvZvmYQ7kNvwEPGb51&_nc_oc=Adq3arDygwl7rc2RhRx5VtOpUyi8_PxU6ZLHI0lq8-BGXihLXEHrHz4AxaoVXDU0UFg&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQI7Lxp_vsJkV6Elshnhpz5paYM5_R7AzEC2RLGnrr300g&oe=6ABA278A",
        "is_video": false,
        "carousel_media_count": 4,
        "user": {
          "user_id": "306787899",
          "username": "nikebasketball"
        }
      },
      {
        "media_id": "3976711603135381072",
        "shortcode": "DcwHiIvDv5Q",
        "media_type": "carousel",
        "product_type": "carousel_container",
        "caption": "These games mean more than just the standings. \n\nThe 2026 Nike x NFL Rivalries Collection. Built from competition and inspired by communities that make up the AFC South and NFC North. \n\nAvailable now.",
        "accessibility_caption": "Photo by Nike on September 01, 2026. May be an image of text.",
        "display_url": "https://scontent-lax3-1.cdninstagram.com/v/t51.82787-15/793028537_18659928706020081_2345019189057705402_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=108&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0FST1VTRUxfSVRFTS5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=-RuiD_kbZUwQ7kNvwEjAHzK&_nc_oc=Adpedy-TJhxkmYxMEVBDRJw5kJ8Ipl0ZdeslqBAxVcITPnScL91N-fbEbCIIjvjsIas&_nc_zt=23&_nc_ht=scontent-lax3-1.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQK78QDmRjJ7_PsDpceVvxkMM17hhPMqCvSl6C8hZQIsJw&oe=6ABA3139",
        "is_video": false,
        "carousel_media_count": 8,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3975901976486041392",
        "shortcode": "DctPchKOVcw",
        "media_type": "video",
        "product_type": "clips",
        "caption": "If you’re going to play, play with fire.\n\n@carlitosalcarazz is back and coming in hot.",
        "accessibility_caption": "Video by Nike on August 31, 2026. May be an image of tennis, racket and text.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/791906938_18659541199020081_1978858658127689682_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=106&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=WkSeclJk2LwQ7kNvwEPoeyM&_nc_oc=Adry6xOcEZ6tDjoMNWjccQENWVFGpdcsFZG9vFwC60LZpYpGeyam2_GmFt_cPcL-UTA&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQJD2xh8PXNcpHkjYdnxIAbv9DE9uqLeE0Mqve-X84dh2g&oe=6ABA03B3",
        "is_video": true,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3973168148123211095",
        "shortcode": "Dcjh2FFx9VX",
        "media_type": "video",
        "product_type": "clips",
        "caption": "New record just dropped.\n\nThe 100M hurdles World Record belongs to @masai_russell. And it’s flying off the shelves.",
        "accessibility_caption": "Video by Nike on August 27, 2026. May be an image of record player, record and text.",
        "display_url": "https://scontent-lax7-1.cdninstagram.com/v/t51.82787-15/788562814_18658305418020081_8049223232898323984_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=105&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=Gt1xwlxQuGUQ7kNvwGhGCEo&_nc_oc=AdosNCTMFsRZ4uG_2HlRImxicbGm33UMQBkjcArd6JsNZ-IUTMVmHjMS9PPDB7znSNA&_nc_zt=23&_nc_ht=scontent-lax7-1.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQJbXs2nEFiqyVeHmWvdVg1Ri-uBkVQadCiY6zXEJ1Ua9Q&oe=6ABA33DB",
        "is_video": true,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3969188148291564527",
        "shortcode": "DcVY5dZm_Pv",
        "media_type": "carousel",
        "product_type": "carousel_container",
        "caption": "The most powerful muscle is the one above your shoulders. \n\n@bokrugby play a game they keep reinventing. \n\nFour tests. Everything on the line.",
        "accessibility_caption": "Photo by Nike on August 22, 2026. May be an image of ‎text that says '‎OUTTHINK YESTERDAY لحر‎'‎.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/784252020_18656598970020081_4373176743203571146_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=111&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0FST1VTRUxfSVRFTS5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=SiMJCRIQOewQ7kNvwEt8E7A&_nc_oc=AdrrUccECiW9t_5Gk2YqUVeB1z2hUD4J-hPwRdHZaTdSePTzfeJklR7MYI50R5Z4J7o&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQKg4l2KqV0-VV2wBcGeiw6sgQo7nGJSozus8nEqJrOEGg&oe=6ABA2F50",
        "is_video": false,
        "carousel_media_count": 2,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3965098051206886784",
        "shortcode": "DcG26tpx7WA",
        "media_type": "video",
        "product_type": "clips",
        "caption": "Just look up. \n\nThe All-Time Leading Scorer’s number 3 is headed to the rafters. Diana Taurasi, forever part of Phoenix Mercury history.",
        "accessibility_caption": "Video by Nike on August 16, 2026. May be a black-and-white image of one or more people and text.",
        "display_url": "https://scontent-lax7-1.cdninstagram.com/v/t51.82787-15/773820927_18654615157020081_5228882958429413387_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=105&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=OP749EKbxqMQ7kNvwG-_maF&_nc_oc=Adpj6xWMxswfvpaLJMcKkzbt1y5FcfrxPyB-cvwTQSK-U1V0eHzS_qJdxwXTYfozL_Y&_nc_zt=23&_nc_ht=scontent-lax7-1.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQLPVPuGAevEg0h-T7AbFfkpO7Z9acFS1QrHjOfs2bpAAQ&oe=6ABA1C0B",
        "is_video": true,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3961499929595472898",
        "shortcode": "Db6EzJxRewC",
        "media_type": "video",
        "product_type": "clips",
        "caption": "Don’t Sleep on Ja. This is your wakeup call.\n\nJa 4 ‘Nightmare’ arrives on 8.13.",
        "accessibility_caption": "Video by Nike on August 11, 2026. May be an image of digital watch, timer and text.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/772101971_18652763158020081_7353952094575095987_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=103&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=TI3Jsi6F7dYQ7kNvwGuMJTn&_nc_oc=Adpn33XcXQYg25nzZ82aaOIfvR-dlVvzJtuTwduDk9b4NDwfBmmR1qF253K-dhQCoKk&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQKArx7EkllXVWa4o7266nWWZcF5q5AyrWvdohhhobZHog&oe=6ABA2F12",
        "is_video": true,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      },
      {
        "media_id": "3953495852743039876",
        "shortcode": "Dbdo4gTupuE",
        "media_type": "video",
        "product_type": "clips",
        "caption": "The game looks different from here.",
        "accessibility_caption": "Video by Nike on July 31, 2026. May be an image of text.",
        "display_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/762586131_18649234189020081_1896116944945693077_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=100&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=xyGxhaNxHd4Q7kNvwFLT5dC&_nc_oc=AdqKXwKMm7UGfHcTHgW4B0-ipGQDEarocR9Cvpl6zVxfW0fOg1HIDTX9JvtH5D2isT0&_nc_zt=23&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_gid=cjyCyOR_pnVchGF7cIwh2g&_nc_ss=7f289&oh=00_AQKwRdhjbNT2Sg23KKJC9VmdllzJ-kbY6ZRUL1CgFacnsQ&oe=6ABA1656",
        "is_video": true,
        "user": {
          "user_id": "13460080",
          "username": "nike"
        }
      }
    ],
    "timeline_page_info": {
      "has_next_page": true,
      "end_cursor": "AQHTUhTjfuWr15bemUTyV0v8DpJnnyoA3FSEQPoWwfBCgQhhTSnUBsaIzT6wNo78B0hZ7E6FKFxD8Egde9dlx_tzNw",
      "next_max_id": "AQHTUhTjfuWr15bemUTyV0v8DpJnnyoA3FSEQPoWwfBCgQhhTSnUBsaIzT6wNo78B0hZ7E6FKFxD8Egde9dlx_tzNw",
      "max_id": "AQHTUhTjfuWr15bemUTyV0v8DpJnnyoA3FSEQPoWwfBCgQhhTSnUBsaIzT6wNo78B0hZ7E6FKFxD8Egde9dlx_tzNw"
    }
  }
}
Manual way

Why this is hard manually

Instagram identity is two numbers and a name, and picking the wrong one costs you your dataset later. A profile returns user_id ('787132' for @natgeo), fbid ('17841400573960012') and the handle itself. Handles get changed and resold; the numeric id does not move. Any monitoring table keyed on username will silently start tracking a different person the day an account is renamed.

The second thing is that every image URL Instagram hands out is signed and expires. The profile picture and post display URLs come with oe and _nc_ohc parameters that stop working after a while. Storing the URL and rendering it a week later gives your users broken images; storing the bytes does not.

The third is that a mistyped username does not look like a mistyped username.

ReefAPI way

Why ReefAPI solves it

A username that does not exist returns TARGET_BLOCKED with retryable true, not NOT_FOUND. We tested it deliberately: a nonsense handle came back as 'instagram profile temporarily unavailable, retry shortly'. That is our own mislabel and it matters operationally, because a retry loop driven by the retryable flag will hammer a typo forever. Cap retries per username and treat repeated TARGET_BLOCKED on the same handle as 'this account probably does not exist'.

The profile call is not just a profile. It returns the twelve most recent posts inline in recent_posts, each with media_id, shortcode, media_type ('image', 'video' or 'carousel'), like_count, comment_count, taken_at_timestamp, dimensions, tagged_users and, on videos, video_view_count. For creator vetting that is one call instead of two, and it is enough to compute an engagement rate on the spot.

Follower counts are exact, not rounded. @natgeo returned follower_count 268703320 - the real integer, not a '268M' string parsed back into a number. That is a meaningful difference from platforms that only publish an abbreviated figure, and it means week-over-week follower deltas are actually measurable rather than lost inside a rounding band.

Engagement fields differ by media type in a way that will skew any average you take carelessly. video_view_count exists only on videos - one @natgeo reel returned 988,545 views against 208,841 likes - while image and carousel posts have likes and comments only. Averaging 'views' across a mixed feed silently divides by the wrong denominator.

shortcode is the id that builds a URL (instagram.com/p/Dbru79IAdH-); media_id ('3957463127796339198') is the internal one that post_info, post_comments and likes all accept. Keep both: the shortcode is what a human can verify, the media_id is what survives.

bio_links is an array with a link_type, and external_url duplicates the first entry for backwards compatibility - @natgeo returned two links where the legacy single-link field showed one. tagged_users come with x and y coordinates giving their position in the image, which is how you tell a genuine collaboration tag from a caption mention. Fourteen actions share the engine: profile, posts, reels, similar_accounts, search, users_search, hashtag_search, post_info, post_comments, audio_media, highlights, followers, following and likes - all on public content, with no login. Profile answered in about 4.5 seconds, posts in 1.5.

FAQ

Questions developers ask

Do I need an Instagram login or a Meta app?

No. You send a ReefAPI key and a public username. There is no Instagram login, no Meta app review and no Graph API permission to request. Only public content is available - private accounts return is_private true and no posts.

Why does a wrong username return TARGET_BLOCKED instead of NOT_FOUND?

Because we collapse a missing profile into a block error, which is a mislabel on our side. The message reads 'temporarily unavailable, retry shortly' and retryable is true. Cap your retries per handle - a handle that fails three times is almost certainly gone.

Should I store user_id or username?

user_id. It is stable; handles get renamed and resold. fbid is a second Meta-side identifier returned alongside it. Keeping the username as a display label is fine, as a key it is not.

Are the follower counts rounded?

No. @natgeo returned 268703320 exactly. That precision is what makes small week-over-week movements measurable instead of hidden inside an abbreviation.

Why do my saved image URLs stop working?

Because Instagram signs them with an expiry - the oe and _nc_ohc parameters in the URL. Fetch and store the bytes if you need the image to survive; the URL will not.

Do I need a second call to get someone's recent posts?

No. profile returns the twelve most recent inline with likes, comments, timestamps, dimensions and tagged users. The posts action is for paging further back than that.

What is the difference between shortcode and media_id?

shortcode builds the public URL (instagram.com/p/<shortcode>); media_id is the internal identifier that post_info, post_comments and likes accept. Store both - one is verifiable by a human, the other is what the API takes.