Instagram Public Data API: Profiles, Posts & Reels | SandBase

Read public Instagram profiles, posts, Reels, followers, comments, and hashtags with one REST API. No Instagram OAuth or SDK — one SandBase key, built for agents.

Dark cinematic render of Instagram social data cards flowing through a glowing API conduit into an agent core

If you have ever tried to read public Instagram data programmatically, you know the first hour rarely goes into your actual feature. It goes into login walls, rotating tokens, and guessing which undocumented field holds the follower count. The data is public in a browser, yet pulling it into an agent reliably is its own small project.

The SandBase Instagram public data API removes that setup tax. It reads public Instagram profiles, posts, Reels, followers, comments, and hashtags through plain REST endpoints under /v1/api/{vendor}/{path} — one SandBase API key, synchronous JSON, no Instagram OAuth flow and no SDK. The endpoint reference only guarantees the envelope (id, status, model, and outputs[0].data); the business fields shown below are an illustrative structure, not a guaranteed schema, so confirm the exact fields against a live response. For a focused application, follow the Instagram Reels competitor-monitor workflow.

This is not Meta’s official Instagram Graph API. Use Meta’s Instagram Platform when you need to manage an authorized Business or Creator account, publish content, or read owner-only insights. Use SandBase when your workflow needs public, read-only discovery or monitoring data. Ready to try it? Get a SandBase API key and browse the Instagram endpoints.

Key takeaway

  • Read Instagram profiles, followers/following, posts, Reels, stories, comments, hashtag and location feeds through one API.
  • Each capability is its own POST /v1/api/instagram/<path> endpoint — pass only that endpoint’s params, no SDK, one SANDBASE_API_KEY.
  • Three schema versions (v1/v2/v3) exist. For one known public username, use the V2 request-only section; keep the existing V1 and V3 examples tied to their own versions.
  • It returns public, read-only data only. There is no posting, no Instagram OAuth login, and no access to private accounts; you authenticate with a SandBase API key.

Which Instagram API do you need?

Your needChooseWhy
Publish content, reply to comments, or inspect an authorized professional accountMeta Instagram Graph APIMeta’s official API is built for Business/Creator account management and owner insights.
Read public profile, post, Reel, hashtag, location, or follower dataSandBase Instagram public-data APIPlain REST calls, one SandBase key, structured JSON for read-only workflows.
Access private accounts, DMs, or login-only dataNeitherThose data types are out of scope for a public-data API.

What you can get from the Instagram API

This Instagram public data API is built for public, read-only discovery and monitoring — not account management or private data. It covers the data an analytics, monitoring, or research agent actually needs, grouped by job:

  • User data — profile and about info, brief/profile views, user ID ↔ username resolution, former usernames, followers and following lists, similar and related profiles.
  • Content — a user’s posts, Reels, tagged posts, reposts, stories, and highlights; a single post by ID, URL, or shortcode; oEmbed data.
  • Engagement — post comments, comment replies, post likes, and comment/caption translation.
  • Discovery — posts by hashtag, by location, and by music/audio; the explore feed and recommended Reels.
  • Search — users, hashtags, locations (including by coordinates), music, and reels; plus a general search.
  • Utilities — media ID ↔ shortcode conversion, and shortcode extraction from a URL.
  • Bulk — a bulk group covering profile, posts, hashtag-posts, search, and content extraction; confirm the available endpoints against the live catalog before you build on them.

You do not need to memorize the list. The pattern below is the same for every one of them.

SandBase Instagram API page: description, capability tags, and the Instagram Endpoints list Retained catalog screenshot — a historical tagged overview and endpoint list with GET paths. It is not a November 5, 2026 capture or evidence of a V2 business response.

What Instagram provides vs. what SandBase adds

Instagram is the source of the underlying public data. SandBase does not own or operate Instagram; it provides a uniform API layer for eligible public-data workflows. Concretely, SandBase turns each capability into one stable model name, normalizes auth to a single key, and returns predictable JSON, so an agent can compose “resolve a username → list followers → read their recent posts” without stitching together three different auth schemes.

Quick start: your first call

Each capability has its own REST endpoint under /v1/api/{vendor}/{path}. The path mirrors the model name, so instagram/v1/user-info-by-username is called at /v1/api/instagram/v1/user-info-by-username. There is no SandBase SDK — these are plain HTTP calls. Fetch a profile by username:

Python
import os
import requests

resp = requests.post(
    "https://api.sandbase.ai/v1/api/instagram/v1/user-info-by-username",
    headers={
        "Authorization": f"Bearer {os.environ['SANDBASE_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={"username": "nasa"},  # just the endpoint's params
)
resp.raise_for_status()
body = resp.json()  # synchronous — the JSON is the result, no polling
if not isinstance(body, dict):
    raise RuntimeError("Instagram response must be a JSON object")
if body.get("status") != "completed":
    error = body.get("error")
    message = error.get("message") if isinstance(error, dict) else None
    raise RuntimeError(
        message if isinstance(message, str) and message.strip()
        else "Instagram request did not complete"
    )

# Business fields are an illustrative shape, not a guaranteed schema — read defensively.
profile = body["outputs"][0]["data"].get("data", {}).get("user", {})
print(profile.get("username"), profile.get("edge_followed_by", {}).get("count"))
Shell
curl -X POST https://api.sandbase.ai/v1/api/instagram/v1/user-info-by-username \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "nasa"}'

username is the only required field for this endpoint. You pass only the endpoint’s own parameters in the body — the endpoint URL already identifies the capability. Data endpoints run in sync mode, so the JSON body is the answer — no task ID and no polling loop.

Every response uses the same envelope: an id, a status (completed on success), the model name, and an outputs array whose single item carries the business payload under data. Below is an illustrative response shape for user-info-by-username — the business fields are an example structure, not a guaranteed schema, and the profile object has many more fields whose live counts change over time; confirm the exact fields against a live response:

JSON
{
  "id": "1997037f-ddc0-40ab-b96f-dc32a524ebb0",
  "status": "completed",
  "model": "instagram/v1/user-info-by-username",
  "outputs": [
    {
      "data": {
        "data": {
          "user": {
            "username": "nasa",
            "full_name": "NASA",
            "is_verified": true,
            "is_private": false,
            "biography": "Making the seemingly impossible, possible. ✨",
            "external_url": "https://www.nasa.gov/",
            "edge_followed_by": { "count": 104335721 },
            "edge_follow": { "count": 89 },
            "edge_owner_to_timeline_media": { "count": 4934 }
          }
        }
      }
    }
  ]
}

A failed or timeout run carries error (with type and a sanitized message) and never outputs, so branch on status before reading outputs[0].data. Note the profile itself sits at outputs[0].data.data.user — inspect one real response and map the exact path once.

SandBase API reference for POST /v1/api/instagram/v1/user-info-by-username, showing the vendor-qualified URL, a cURL example, and the response schema Retained V1 reference screenshot showing the vendor-qualified POST route and operation-specific request fields. This historical reference does not establish the V2 response contract or a new API test.

How to get Instagram public profile data with Python

For a known public handle, use the Instagram User Profile V2 request reference. Start with one username, without @, and a SandBase key stored in your server environment. This Python requests example uses the Model API POST route, not the catalog’s GET paths, and sends only that identifier. It is a public, read-only lookup: it does not fetch a follower list or access private accounts, DMs, or owner-only insights. If you already know a numeric user ID, the reference also allows user_id as a string instead of username; the two identifiers are alternatives, not two independently required fields.

This is a request-only example, not run against the real API. Offline mocks were run on November 5, 2026 for request setup and error handling, not endpoint availability or business success. The code checks HTTP/transport errors and reads JSON for review; a successful HTTP status alone does not prove that the lookup completed. Keep raw_response in memory for authorized validation. Do not log your key or the full payload.

Python
# Request-only example: NOT RUN against the real API; offline mocks only.
import os
import requests

endpoint = "https://api.sandbase.ai/v1/api/instagram/v2/user-info"
key = os.environ["SANDBASE_API_KEY"]  # server environment; never log it
username = "nasa"  # one public handle, without @

if not key.strip():
    raise ValueError("Set SANDBASE_API_KEY in the server environment")
if not username or username.startswith("@"):
    raise ValueError("Use one username without @")

try:
    response = requests.post(
        endpoint,
        headers={
            "Authorization": f"Bearer {key}",
            "Content-Type": "application/json",
        },
        json={"username": username},
        timeout=(5, 30),
    )
    response.raise_for_status()
    raw_response = response.json()  # retain for approved schema validation only
except requests.exceptions.JSONDecodeError:
    raise RuntimeError("Response was not valid JSON") from None
except requests.Timeout:
    raise RuntimeError("Profile request timed out; no profile was validated") from None
except requests.RequestException:
    raise RuntimeError("Profile request failed at the HTTP/transport layer") from None
except ValueError:
    raise RuntimeError("Response was not valid JSON") from None

print("JSON received for review; business success and profile remain unvalidated.")

The timeout values are example client settings, not measured latency or a service SLA. JSON null, an array, or an object can all be received here without validating a profile. The JSON decoding exception is caught before the broader requests exception because it belongs to both exception families. The final message reports receipt for review, not a successful lookup.

Before adding a business parser, approve an exact, sanitized V2 success fixture and failure fixtures. Confirm the outer response type, status handling, outputs structure, and the single path to the profile. The V1 illustrative response above and the V2 reference’s trimmed payload are not substitutes for that contract. Do not reuse the V1 parser or try several nested data paths until something matches. Business parsing is intentionally not delivered here.

For a creator shortlist or brand research record, a bio, website, or category may be empty or unusable. Keep missing or null counts unknown rather than replacing them with zero; an unknown flag is not false. follower_count describes a count, not follower identities or a historical series. is_verified is a profile flag, not identity verification, and is_private grants no access to private content. Email availability is not promised.

If you later enrich Instagram usernames with Python, record failures separately from valid profiles: a timeout is not a profile with an empty bio. A client-side research record does not establish a native bulk endpoint. This single-account request needs no pagination and provides no list loop or CSV export. It makes no real-time, audience-demographic, or unlimited-free-access promise. The request and field-boundary notes follow the public V2 reference reviewed on November 5, 2026; complete response-contract approval remains pending.

Capability map

Capability clusterRepresentative endpointTypical use
User profile & IDsinstagram/v1/user-info-by-usernameResolve a handle to profile fields and user ID
Followers / followinginstagram/v3/user-followersAudience and network analysis (paginated)
Posts & Reelsinstagram/v3/user-posts, instagram/v3/user-reelsContent monitoring, engagement tracking
Comments & translationinstagram/v3/post-comments, instagram/v3/bulk-translate-commentsSentiment and multilingual comment analysis
Hashtag / location / musicinstagram/v2/hashtag-posts, instagram/v3/hashtag-postsTrend and campaign discovery
Searchinstagram/v3/search-usersFind accounts, tags, or places
ID utilitiesinstagram/v1/shortcode-to-media-idConvert a post URL to its media ID

Endpoints exist in v1, v2, and v3. For one known public handle, follow the V2 single-profile request, rather than applying a general V3 preference. The table and list examples retain their original version labels; their field paths and pagination rules must not be transferred to V2.

Common use cases

Instagram profile API for creator discovery

Resolve a handle with instagram/v1/user-info-by-username, then read edge_followed_by.count, category, and bio to shortlist creators by size and niche. Input: a username or a list of candidates. Output: a comparable profile record per creator. Endpoints: user-info-by-username, optionally instagram/v3/search-users to find candidates first. For one known public handle, see the V2 single-account request and field boundaries; this does not migrate the V1 example or add bulk input.

Instagram Reels API for competitor monitoring

Poll a competitor’s recent posts and Reels on a schedule and diff engagement over time. Input: a username. Output: a time series of posts/Reels with counts. Endpoints: instagram/v3/user-posts and instagram/v3/user-reels.

Instagram hashtag API for campaign research

Pull recent posts under a campaign or topic tag to gauge volume and surface top accounts. Input: a hashtag (without #). Output: a paginated list of tagged posts. Endpoint: instagram/v2/hashtag-posts with feed_type: top (page with pagination_token). In a 2026-10-01 test, instagram/v3/hashtag-posts behaved like a recency feed of mostly low-engagement posts, so use it when you want the newest posts rather than the top ones. For the full workflow, see how to research Instagram hashtags.

A short workflow: followers of an account

Paginated list endpoints follow one convention: omit max_id on the first request, then pass the cursor from the previous response to continue. Here is “resolve a handle, then page through its followers”:

Python
import os
import requests

BASE = "https://api.sandbase.ai/v1/api"
HEADERS = {
    "Authorization": f"Bearer {os.environ['SANDBASE_API_KEY']}",  # keep the key out of code
    "Content-Type": "application/json",
}

def call(endpoint, **params):
    resp = requests.post(f"{BASE}/{endpoint}", headers=HEADERS, json=params)
    resp.raise_for_status()
    body = resp.json()
    if not isinstance(body, dict):
        raise RuntimeError("Instagram response must be a JSON object")
    if body.get("status") != "completed":            # branch on status before reading outputs
        err = body.get("error")
        message = err.get("message") if isinstance(err, dict) else None
        raise RuntimeError(
            message if isinstance(message, str) and message.strip()
            else "Instagram request did not complete"
        )
    return body["outputs"][0]["data"]

def all_followers(username, pages=3):
    collected, cursor = [], None
    for _ in range(pages):
        params = {"username": username, "count": 100}
        if cursor:
            params["max_id"] = cursor
        data = call("instagram/v3/user-followers", **params)
        collected.extend(data.get("users", []))
        cursor = data.get("next_max_id")   # pagination cursor lives in data
        if not cursor:
            break  # no more pages
    return collected

followers = all_followers("nasa", pages=2)
print(f"Collected {len(followers)} followers")

The pagination cursor comes back as data.next_max_id; pass it as max_id on the next request and stop when it is absent. count accepts 1–100 (default 12). One thing I only learned by reading an actual response: the profile fields sit a couple of levels deep and the cursor lives inside data, not at the top level — so I inspect one real payload and map the exact path before writing the parsing code, rather than assuming it.

SandBase Instagram Endpoints list showing user-posts, location-info, user-info-by-username, user-followers and more with their paths Retained endpoint-list screenshot — historical descriptions and paths for user-followers, user-posts, user-about, and others, not proof of V2 field shape or current endpoint execution.

Limitations and boundaries

  • Public data only. These endpoints read public profiles and content. There is no posting, liking, following, or messaging, and private accounts are not accessible.
  • Rate and volume. Treat responses as best-effort reads. Handle empty results and HTTP 429 with backoff; control concurrency and pacing, and confirm the available endpoints against the live catalog before wiring in higher-volume jobs.
  • Field shape follows the source. Response fields mirror the upstream data and can vary by endpoint and version. Inspect one real response and code against what is actually there.
  • Not an official Instagram partnership. SandBase provides uniform access to public data; it does not grant rights beyond what the source data allows. Respect Instagram’s terms and applicable privacy rules for your use case.

FAQ

Do I need an Instagram token or app review? No. You authenticate to SandBase with your SANDBASE_API_KEY. You do not register an Instagram app or manage OAuth for these read endpoints.

What is the difference between v1, v2, and v3? They are schema generations for the same platform. v3 is the largest and most current set and adds pagination on most list endpoints; v1/v2 remain available for capabilities you already depend on.

How do I convert a post URL to a media ID? Extract the shortcode from the URL (the code in instagram.com/p/<shortcode>/) and call instagram/v1/shortcode-to-media-id, or use instagram/v3/extract-shortcode first if you only have the raw URL.

Is the call synchronous? Yes. Instagram data endpoints run in sync mode — the JSON response is the result, with no polling step.

How does pagination work? List endpoints that support paging take a max_id cursor. Omit it on the first request, then pass the value returned by the previous response to fetch the next page. count controls page size (up to 100 on user-followers, default 12).

Can I read private accounts or get login-only data? No. The API returns public data only. Private accounts, direct messages, and any action that requires being logged in as a user are out of scope.

Which endpoint should I call for a given task? For one known public username, start with the V2 request-only guide. For other tasks, match the task to the capability cluster and check that endpoint’s version-specific reference. The existing examples use instagram/v3/user-posts for a feed, instagram/v2/hashtag-posts (with feed_type: top) for a tag’s top posts, and instagram/v3/search-users to find accounts.

Can I get Reels, Stories, and Highlights? Yes. Use instagram/v3/user-reels for Reels, instagram/v3/user-stories for current stories, and instagram/v3/user-highlights (with highlight-stories) for saved highlights.

What happens if I hit a rate limit? Expect an HTTP 429 under heavy load. Retry with bounded exponential backoff, and control concurrency and pacing rather than looping single-item calls at full speed.

Start with one profile request

For a known public username, start with the V2 single-account request and obtain approved response fixtures before adding a parser. The original V1 reference below still belongs to the V1 Quick start example; it is not the V2 contract. When you are ready:

Found this useful? Share it