# Instagram API docs

A read-only REST API for public Instagram data. Every endpoint is a `GET` request that returns JSON.

- Base URL: `https://data.fastsocial.co`
- Auth: `X-API-Key: YOUR_API_KEY`
- Cost: 0 to 3 credits per call
- Free plan: 50 credits a month, 10 requests a minute
- Docs: https://fastsocial.co/instagram-api/docs
- OpenAPI: https://fastsocial.co/instagram-api/openapi.json

## Authentication

Send your key in a request header. Keys start with `fsd_`.

| Header | Value |
|---|---|
| `X-API-Key` | `YOUR_API_KEY` |
| `Authorization` | `Bearer YOUR_API_KEY` |

The API reads keys from headers only. A key in the query string is ignored, and the call returns `401 missing_key`.

## Responses

Every success has the same envelope: `{"ok": true, "data": {...}, "meta": {...}}`.

| Field | Type | Description |
|---|---|---|
| `meta.cache` | string | `hit`, `miss`, `stale` or `stale-ratelimited`. |
| `meta.age_seconds` | integer | Age of the data in seconds. |
| `meta.stale` | boolean | Whether Instagram was unreachable and you got the last good copy. |
| `meta.credits` | integer | Credits this call used. |
| `meta.credits_remaining` | integer | Credits left, including packs. |

The same numbers come back as headers: `X-Cache`, `X-Credits-Used` and `X-Credits-Remaining`. Timestamps such as `taken_at` are Unix seconds in UTC.

## Errors

Errors return `{"ok": false, "error": {"code": "...", "message": "..."}}` with the status below. Only `404 not_found` and `422 private_account` use credits. Every other error is free.

| Status | Code | When | Charged |
|---|---|---|---|
| 400 | `invalid_username` | `username` is not 1-30 letters, digits, `.` or `_`. | No |
| 400 | `invalid_user_id` | `user_id` is not a numeric ID. | No |
| 400 | `missing_user` | Neither `username` nor `user_id` was sent. | No |
| 400 | `invalid_post` | `url` is not a post, reel or IGTV link, or `shortcode` is malformed. | No |
| 400 | `invalid_id` | `id` or `comment_id` is missing or not numeric. | No |
| 400 | `invalid_cursor` | `cursor` did not come from a previous page of the same request. | No |
| 400 | `invalid_query` | `q` is empty or longer than 80 characters. | No |
| 400 | `invalid_tag` | `tag` has spaces or characters a hashtag can't have. | No |
| 400 | `invalid_param` | A `/v1/top` filter has a value it doesn't accept. The message lists the valid ones. | No |
| 401 | `missing_key` | No key in `X-API-Key` or `Authorization`. | No |
| 401 | `invalid_key` | The key is wrong or disabled. | No |
| 401 | `invalid_token` | An MCP sign-in token expired or was revoked. Reconnect the app. | No |
| 404 | `not_found` | The account, post, location or audio doesn't exist or isn't public. | Yes |
| 404 | `no_such_endpoint` | The path doesn't exist. | No |
| 405 | `method_not_allowed` | The method isn't `GET`. | No |
| 422 | `private_account` | The account is private, so the endpoint has nothing to return. | Yes |
| 422 | `not_enough_history` | `/v1/top` doesn't have enough days yet for that `window`. | No |
| 429 | `rate_limited` | Over the per-minute limit. Retry after `Retry-After` seconds. | No |
| 429 | `quota_exceeded` | No credits left this month. The body adds `plan` and `upgrade_url`. | No |
| 429 | `fair_use_limit` | The plan's fair-use share for heavy endpoints is used up. | No |
| 451 | `opted_out` | The account owner asked to be excluded. | No |
| 500 | `internal` | Unexpected error on our side. | No |
| 502 | `upstream_error` | Instagram didn't respond. Retry shortly. | No |
| 503 | `capacity` | This endpoint's data capacity for the month is used up. | No |
| 503 | `unavailable` | The endpoint is switched off, or Top Charts is updating. | No |
| 503 | `maintenance` | The API is paused for maintenance. | No |

## Credits and plans

Each call costs the credits shown on its endpoint. Plan credits reset at 00:00 UTC on the 1st of each month.

| Credits | Endpoints |
|---|---|
| 0 | `/v1/top`, `/v1/usage` |
| 1 | `/v1/profile`, `/v1/user-id`, `/v1/check`, `/v1/posts`, `/v1/reels`, `/v1/tagged`, `/v1/post`, `/v1/media`, `/v1/similar`, `/v1/search`, `/v1/hashtag`, `/v1/place-posts`, `/v1/audio` |
| 2 | `/v1/username`, `/v1/insights` |
| 3 | `/v1/comments`, `/v1/comment-replies`, `/v1/likers`, `/v1/followers`, `/v1/following`, `/v1/stories`, `/v1/highlights`, `/v1/highlight`, `/v1/place`, `/v1/audio-search`, `/v1/reels-search` |

| Plan | Price | Credits / month | Requests / minute | Fair-use share |
|---|---|---|---|---|
| Free | $0 / month | 50 | 10 | No cap |
| Starter | $5 / month | 5,000 | 30 | 1,000 |
| Pro | $15 / month | 20,000 | 60 | 4,000 |
| Ultra | $50 / month | 70,000 | 120 | 14,000 |
| Insanity | $150 / month | 225,000 | 180 | 45,000 |

- Fair use: on paid plans, fair-use endpoints can spend up to the share above. Past it they return `429 fair_use_limit`; the rest keep working.
- Credit packs: 5,000 credits for $6, 20,000 credits for $19, 65,000 credits for $59. Packs last 365 days and are spent after the month's plan credits.
- No overage: when credits run out, calls return `429 quota_exceeded` until the 1st or until you add credits.
- `GET /v1/usage` returns your balance for free.

## Rate limits

Limits are per key, per minute, and depend on the plan (table above).

- Over the limit, a request with a cached answer still returns `200`, free, with `meta.cache: "stale-ratelimited"`.
- With nothing cached, or past 3 times the limit, you get `429 rate_limited` and a `Retry-After` header in seconds.
- More than 30 failed key checks a minute from one IP address also return `429`.

## Pagination

Paged endpoints return `next_cursor`. Send it back as `cursor`, with the same other parameters, for the next page.

When `next_cursor` is `null`, there are no more pages. A cursor from a different request returns `400 invalid_cursor`.

Paged: `/v1/posts`, `/v1/reels`, `/v1/tagged`, `/v1/comment-replies`, `/v1/followers`, `/v1/following`, `/v1/hashtag`, `/v1/place-posts`, `/v1/reels-search`. `/v1/top` pages with `limit` and `offset`.

## Data freshness

| Data | Maximum age |
|---|---|
| Anything with counts: followers, likes, views, comments | 5 minutes |
| Stories | 15 minutes |
| Highlights | 12 hours |
| Locations | 24 hours |
| Accounts and posts that don't exist | 6 hours |

If Instagram doesn't respond, you get the last good copy with `meta.stale: true`. Counts are never older than 5 minutes, even then.

## AI apps (MCP)

The same data is an MCP server at `https://data.fastsocial.co/mcp`. Add it to your app and sign in once in the browser; there is no key to paste.

- Claude Code: `claude mcp add --transport http instagram-data https://data.fastsocial.co/mcp`
- Claude: Settings, Connectors, Add custom connector. Paste the URL and sign in.
- ChatGPT: Settings, Connectors. Turn on developer mode under Advanced, create a connector with the URL and sign in.
- Cursor: `~/.cursor/mcp.json`: `{"mcpServers": {"instagram-data": {"url": "https://data.fastsocial.co/mcp"}}}`
- VS Code: `.vscode/mcp.json`: `{"servers": {"instagram-data": {"type": "http", "url": "https://data.fastsocial.co/mcp"}}}`

Tool names are `instagram_` plus the endpoint, such as `instagram_profile`. Each tool costs the same as its endpoint; `instagram_top_accounts` and `instagram_usage` are free.

## Profiles

### Get a profile

`GET /v1/profile` | 1 credit

Returns follower, following and post counts, bio, links, category, verification and avatar URL.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |

| Case | Status | Credits |
|---|---|---|
| Private account | 200, `is_private: true` | 1 |
| Account doesn't exist | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/profile?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/profile",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/profile");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "id": "528817151",
    "username": "nasa",
    "full_name": "NASA",
    "biography": "Making the seemingly impossible, possible. ✨",
    "external_url": null,
    "bio_links": [
      "https://www.nasa.gov",
      "https://www.nasa.gov/maxpower"
    ],
    "followers": 104373201,
    "following": 90,
    "posts_count": 4968,
    "is_private": false,
    "is_verified": true,
    "is_business": false,
    "category": null,
    "avatar_url": "https://scontent.cdninstagram.com/v/t51.2885-19/…/avatar.jpg?…"
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 23
  }
}
```

### Convert a username to an ID

`GET /v1/user-id` | 1 credit

Returns the numeric user ID for a handle.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |

- Most endpoints take `user_id` directly. `check`, `insights`, `stories` and `highlights` take `username` only.

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/user-id?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/user-id",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/user-id");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "id": "528817151",
    "username": "nasa"
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 99,
    "stale": false,
    "credits": 1,
    "credits_remaining": 4
  }
}
```

### Convert an ID to a username

`GET /v1/username` | 2 credits | fair-use

Returns the current handle for a user ID.

| Name | Type | Required | Description |
|---|---|---|---|
| `user_id` | string | Required | Numeric Instagram user ID. `id` is accepted too. |

- Use it to follow an account after it renames itself.

| Case | Status | Credits |
|---|---|---|
| No account with that ID | 404 `not_found` | 2 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/username?user_id=528817151" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/username",
    params={"user_id": "528817151"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/username");
url.search = new URLSearchParams({ user_id: "528817151" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "id": "528817151",
    "username": "nasa"
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 2,
    "credits_remaining": 2
  }
}
```

### Check a handle

`GET /v1/check` | 1 credit

Returns whether a handle exists and is public.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | Required | Instagram handle, with or without `@`. A profile URL also works. |

- `state` is one of `ok`, `not_found`, `private`, `deactivated`, `memorialized`, `age_restricted`, `restricted_minor`.
- Exact matches only, so a typo never resolves to another account.

| Case | Status | Credits |
|---|---|---|
| Handle doesn't exist | 200, `exists: false` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/check?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/check",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/check");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "exists": true,
    "state": "ok",
    "public": true,
    "followers": 104373201,
    "is_verified": true
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 26,
    "stale": false,
    "credits": 1,
    "credits_remaining": 18
  }
}
```

## Posts & reels

### List posts

`GET /v1/posts` | 1 credit | paged | fair-use

Returns 12 posts per page with counts, caption and media URLs.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

- Pinned posts come first, with `pinned: true`. The rest are newest first.

| Case | Status | Credits |
|---|---|---|
| Private account | 200, empty `posts`, `is_private: true` | 1 |
| Account doesn't exist | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/posts?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/posts",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/posts");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "user_id": "528817151",
    "posts": [
      {
        "shortcode": "DeTUk4sDSp-",
        "url": "https://www.instagram.com/p/DeTUk4sDSp-/",
        "taken_at": 1791645302,
        "format": "reel",
        "likes": 715212,
        "comments": 7117,
        "views": 3105489,
        "caption": "POV: you're watching the Earth set\n\nWe just released hundreds of new images…",
        "image_url": "https://scontent.cdninstagram.com/…/cover.jpg?…",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4?…",
        "pinned": true,
        "owner_username": "nasa",
        "owner_id": "528817151"
      },
      {
        "shortcode": "DesCOtRjETH",
        "url": "https://www.instagram.com/p/DesCOtRjETH/",
        "taken_at": 1792438960,
        "format": "image",
        "likes": 151349,
        "comments": 760,
        "views": null,
        "caption": "Night lights 💡\n\nIn this photo, taken from the @ISS…",
        "image_url": "https://scontent.cdninstagram.com/…/1080.jpg?…",
        "video_url": null,
        "pinned": false,
        "owner_username": "nasa",
        "owner_id": "528817151"
      }
    ],
    "next_cursor": "YTpRVkZFVEcxRWFGTkdiMnh3…x9sSxuFZG1Bf6JXbW2BKuA"
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 22
  }
}
```

### List reels

`GET /v1/reels` | 1 credit | paged | fair-use

Returns the account's reels tab with play counts, likes, comments and video URLs.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 1 |
| Private account | 422 `private_account` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/reels?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/reels",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/reels");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "user_id": "528817151",
    "posts": [
      {
        "shortcode": "DeTUk4sDSp-",
        "url": "https://www.instagram.com/p/DeTUk4sDSp-/",
        "taken_at": 1791645302,
        "format": "reel",
        "likes": 715215,
        "comments": 7117,
        "views": 10427133,
        "caption": "POV: you're watching the Earth set\n\nWe just released hundreds of new images…",
        "image_url": "https://scontent.cdninstagram.com/…/cover.jpg?…",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4?…",
        "pinned": true,
        "owner_username": "nasa",
        "owner_id": "528817151"
      }
    ],
    "next_cursor": "YTpRVkZEYlhaa2JrTmtaakpN…s_KgEbWv3X0eUhk7fkhU4g"
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 5
  }
}
```

### List tagged posts

`GET /v1/tagged` | 1 credit | paged | fair-use

Returns public posts by other accounts that tag this account.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 1 |
| Private account | 422 `private_account` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/tagged?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/tagged",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/tagged");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "user_id": "528817151",
    "posts": [
      {
        "shortcode": "C8x1abcDEF0",
        "url": "https://www.instagram.com/p/C8x1abcDEF0/",
        "taken_at": 1758600000,
        "format": "reel",
        "likes": 412000,
        "comments": 1900,
        "views": 5400000,
        "caption": "Sunrise over the Pacific, seen from the station.",
        "image_url": "https://scontent.cdninstagram.com/…/1080.jpg",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4",
        "pinned": false,
        "owner_username": "nasa",
        "owner_id": "528817151"
      }
    ],
    "next_cursor": "QVFE…",
    "is_private": false
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 1,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### Get a post

`GET /v1/post` | 1 credit

Returns counts, caption, owner and media URLs for one post, reel or IGTV video.

| Name | Type | Required | Description |
|---|---|---|---|
| `url` | string | One of | Post, reel or IGTV URL. |
| `shortcode` | string | One of | Code from the post URL: `instagram.com/p/{shortcode}/`. |

- `owner_id` is the owner's user ID, the same `id` that `/v1/profile` returns.

| Case | Status | Credits |
|---|---|---|
| Post deleted, missing or private | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/post?shortcode=DeTUk4sDSp-" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/post",
    params={"shortcode": "DeTUk4sDSp-"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/post");
url.search = new URLSearchParams({ shortcode: "DeTUk4sDSp-" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "shortcode": "DeTUk4sDSp-",
    "url": "https://www.instagram.com/p/DeTUk4sDSp-/",
    "taken_at": 1791645302,
    "format": "reel",
    "likes": 715212,
    "comments": 7117,
    "views": 10426997,
    "caption": "POV: you're watching the Earth set\n\nWe just released hundreds of new images…",
    "image_url": "https://scontent.cdninstagram.com/…/cover.jpg?…",
    "video_url": "https://scontent.cdninstagram.com/…/clip.mp4?…",
    "pinned": false,
    "owner_username": "nasa",
    "owner_id": "528817151"
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 21
  }
}
```

### Get media files

`GET /v1/media` | 1 credit

Returns direct image and video URLs for every slide, in the best quality available.

| Name | Type | Required | Description |
|---|---|---|---|
| `url` | string | One of | Post, reel or IGTV URL. |
| `shortcode` | string | One of | Code from the post URL: `instagram.com/p/{shortcode}/`. |

- URLs are signed Instagram CDN links. They expire after a few hours.

| Case | Status | Credits |
|---|---|---|
| Post deleted, missing or private | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/media?shortcode=DeAYvsnn4la" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/media",
    params={"shortcode": "DeAYvsnn4la"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/media");
url.search = new URLSearchParams({ shortcode: "DeAYvsnn4la" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "shortcode": "DeAYvsnn4la",
    "owner_username": "nasa",
    "files": [
      {
        "type": "image",
        "url": "https://scontent.cdninstagram.com/…/slide1.jpg?…",
        "thumbnail_url": null
      },
      {
        "type": "image",
        "url": "https://scontent.cdninstagram.com/…/slide2.jpg?…",
        "thumbnail_url": null
      }
    ]
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 12
  }
}
```

## Engagement

### List comments

`GET /v1/comments` | 3 credits

Returns one page of comments with author, text, time, likes and reply count, plus the total.

| Name | Type | Required | Description |
|---|---|---|---|
| `url` | string | One of | Post, reel or IGTV URL. |
| `shortcode` | string | One of | Code from the post URL: `instagram.com/p/{shortcode}/`. |

- Newest first. No cursor: one page per call. `replies` can be `null`.

| Case | Status | Credits |
|---|---|---|
| Post deleted, missing or private | 404 `not_found` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/comments?shortcode=DeTUk4sDSp-" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/comments",
    params={"shortcode": "DeTUk4sDSp-"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/comments");
url.search = new URLSearchParams({ shortcode: "DeTUk4sDSp-" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "shortcode": "DeTUk4sDSp-",
    "total": 7117,
    "comments": [
      {
        "id": "17956804323270146",
        "text": "Paz 🕊️ e amor ❤️",
        "created_at": 1792470219,
        "likes": 1,
        "replies": null,
        "user": {
          "id": "36190672589",
          "username": "joaogabriel872026",
          "full_name": "",
          "is_private": false,
          "is_verified": false,
          "avatar_url": "https://scontent.cdninstagram.com/v/t51.2885-19/…/avatar.jpg?…"
        }
      }
    ]
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 3,
    "credits_remaining": 13
  }
}
```

### List comment replies

`GET /v1/comment-replies` | 3 credits | paged | fair-use

Returns replies under one comment.

| Name | Type | Required | Description |
|---|---|---|---|
| `url` | string | One of | Post, reel or IGTV URL. |
| `shortcode` | string | One of | Code from the post URL: `instagram.com/p/{shortcode}/`. |
| `comment_id` | string | Required | Numeric comment ID from `/v1/comments`. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

| Case | Status | Credits |
|---|---|---|
| Post deleted, missing or private | 404 `not_found` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/comment-replies?url=https://www.instagram.com/reel/DdhFkS7KGkZ/&comment_id=17935912383123296" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/comment-replies",
    params={"url": "https://www.instagram.com/reel/DdhFkS7KGkZ/", "comment_id": "17935912383123296"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/comment-replies");
url.search = new URLSearchParams({ url: "https://www.instagram.com/reel/DdhFkS7KGkZ/", comment_id: "17935912383123296" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "shortcode": "C8x1abcDEF0",
    "comment_id": "…",
    "comments": 1900,
    "next_cursor": "QVFE…"
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### List likers

`GET /v1/likers` | 3 credits | fair-use

Returns a sample of accounts that liked a post, plus the total like count.

| Name | Type | Required | Description |
|---|---|---|---|
| `url` | string | One of | Post, reel or IGTV URL. |
| `shortcode` | string | One of | Code from the post URL: `instagram.com/p/{shortcode}/`. |

- One page, no cursor. It is not the full list of likers.

| Case | Status | Credits |
|---|---|---|
| Post deleted, missing or private | 404 `not_found` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/likers?url=https://www.instagram.com/reel/DdhFkS7KGkZ/" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/likers",
    params={"url": "https://www.instagram.com/reel/DdhFkS7KGkZ/"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/likers");
url.search = new URLSearchParams({ url: "https://www.instagram.com/reel/DdhFkS7KGkZ/" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "user_id": "528817151",
    "total": 581,
    "users": [
      {
        "id": "528817151",
        "username": "nasa",
        "full_name": "NASA",
        "is_private": false,
        "is_verified": true,
        "avatar_url": "https://scontent.cdninstagram.com/…/avatar.jpg"
      }
    ],
    "next_cursor": "QVFE…"
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### Get engagement insights

`GET /v1/insights` | 2 credits | fair-use

Returns engagement rate (mean and median), posts per week, format mix and best posting hours.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | Required | Instagram handle, with or without `@`. A profile URL also works. |

- Built from the latest 12 posts, pinned posts excluded, so `sample_size` can be lower than 12.
- `confidence` is `good`, `low` or `insufficient`. `benchmark_percentile` is `null` when no benchmark covers the account.

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 2 |
| Private account | 422 `private_account` | 2 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/insights?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/insights",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/insights");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "followers": 104373201,
    "follower_bucket": "1m+",
    "sample_size": 8,
    "confidence": "low",
    "avg_likes": 489667.5,
    "avg_comments": 1953,
    "engagement_rate_pct": 0.471,
    "engagement_rate_median_pct": 0.275,
    "posts_per_week": 4.82,
    "format_share": {
      "image": 0.75,
      "carousel": 0.125,
      "reel": 0.125
    },
    "best_hours_utc": [
      {
        "hour_utc": 19,
        "posts": 3,
        "score": 1.23
      },
      {
        "hour_utc": 16,
        "posts": 1,
        "score": 1.02
      },
      {
        "hour_utc": 14,
        "posts": 2,
        "score": 0.86
      }
    ],
    "last_post_at": 1792438960,
    "benchmark_percentile": null,
    "benchmark_month": null
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 4,
    "stale": false,
    "credits": 2,
    "credits_remaining": 19
  }
}
```

## Network

### List followers

`GET /v1/followers` | 3 credits | paged | fair-use

Returns one page of accounts that follow a public account, plus the follower total.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

- When `next_cursor` is `null`, no further pages are available.

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 3 |
| Private account | 422 `private_account` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/followers?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/followers",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/followers");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "user_id": "528817151",
    "total": 104372632,
    "users": [
      {
        "id": "58824308498",
        "username": "stackedsky",
        "full_name": "alec",
        "is_private": false,
        "is_verified": false,
        "avatar_url": "https://scontent.cdninstagram.com/v/t51.2885-19/…/avatar.jpg?…"
      },
      {
        "id": "66024340570",
        "username": "sh.nab_",
        "full_name": "",
        "is_private": true,
        "is_verified": false,
        "avatar_url": "https://scontent.cdninstagram.com/v/t51.2885-19/…/avatar.jpg?…"
      }
    ],
    "next_cursor": null
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 3,
    "credits_remaining": 9
  }
}
```

### List following

`GET /v1/following` | 3 credits | paged | fair-use

Returns one page of accounts a public account follows, plus the total.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

- When `next_cursor` is `null`, no further pages are available.

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 3 |
| Private account | 422 `private_account` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/following?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/following",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/following");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "user_id": "528817151",
    "total": 581,
    "users": [
      {
        "id": "528817151",
        "username": "nasa",
        "full_name": "NASA",
        "is_private": false,
        "is_verified": true,
        "avatar_url": "https://scontent.cdninstagram.com/…/avatar.jpg"
      }
    ],
    "next_cursor": "QVFE…"
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### List similar accounts

`GET /v1/similar` | 1 credit | fair-use

Returns accounts Instagram treats as related to this one.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | One of | Instagram handle, with or without `@`. A profile URL also works. |
| `user_id` | string | One of | Numeric Instagram user ID. |

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/similar?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/similar",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/similar");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "user_id": "528817151",
    "users": [
      {
        "id": "1029649300",
        "username": "natgeoanimals",
        "full_name": "National Geographic Animals",
        "is_private": false,
        "is_verified": true,
        "avatar_url": "https://scontent.cdninstagram.com/v/t51.2885-19/…/avatar.jpg?…"
      }
    ]
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 1
  }
}
```

## Stories & highlights

### List stories

`GET /v1/stories` | 3 credits | fair-use

Returns stories from the last 24 hours with image and video URLs.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | Required | Instagram handle, with or without `@`. A profile URL also works. |

- URLs are signed CDN links that expire after a few hours.

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/stories?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/stories",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/stories");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "count": 3,
    "stories": [
      {
        "id": "3474581261890123456",
        "is_video": false,
        "image_url": "https://scontent.cdninstagram.com/…/1080.jpg",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4",
        "taken_at": 1758600000,
        "expires_at": 1758686400,
        "width": 1080,
        "height": 1920
      }
    ]
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### List highlights

`GET /v1/highlights` | 3 credits

Returns the title, cover and item count of each highlight.

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | Required | Instagram handle, with or without `@`. A profile URL also works. |

- Pass an `id` to `/v1/highlight` for its items. `item_count` can be `null`.

| Case | Status | Credits |
|---|---|---|
| Account doesn't exist | 404 `not_found` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/highlights?username=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/highlights",
    params={"username": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/highlights");
url.search = new URLSearchParams({ username: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "username": "nasa",
    "count": 5,
    "highlights": [
      {
        "id": "highlight:18195781759377100",
        "title": "Roman",
        "cover_url": "https://scontent.cdninstagram.com/…/cover.jpg?…",
        "item_count": null
      },
      {
        "id": "highlight:18131565715482962",
        "title": "Artemis II",
        "cover_url": "https://scontent.cdninstagram.com/…/cover.jpg?…",
        "item_count": null
      }
    ]
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 3,
    "credits_remaining": 6
  }
}
```

### Get a highlight

`GET /v1/highlight` | 3 credits | fair-use

Returns every photo and video in one highlight, with signed CDN URLs.

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Required | Highlight ID from `/v1/highlights`, with or without the `highlight:` prefix. |

| Case | Status | Credits |
|---|---|---|
| Another highlight of the same account within 15 minutes | 200 | 0 |
| Unknown ID | 404 `not_found` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/highlight?id=highlight:17960293069066406" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/highlight",
    params={"id": "highlight:17960293069066406"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/highlight");
url.search = new URLSearchParams({ id: "highlight:17960293069066406" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "id": "highlight:17960293069066406",
    "count": 3,
    "items": [
      {
        "id": "3474581261890123456",
        "is_video": false,
        "image_url": "https://scontent.cdninstagram.com/…/1080.jpg",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4",
        "taken_at": 1758600000,
        "expires_at": 1758686400,
        "width": 1080,
        "height": 1920
      }
    ]
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

## Discovery

### Search

`GET /v1/search` | 1 credit | fair-use

Returns matching accounts, hashtags with post counts, and places with location IDs.

| Name | Type | Required | Description |
|---|---|---|---|
| `q` | string | Required | Search text, 1-80 characters. |

| Case | Status | Credits |
|---|---|---|
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/search?q=nasa" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/search",
    params={"q": "nasa"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/search");
url.search = new URLSearchParams({ q: "nasa" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "query": "nasa",
    "users": [
      {
        "id": "528817151",
        "username": "nasa",
        "full_name": "NASA",
        "is_private": false,
        "is_verified": true,
        "avatar_url": "https://scontent.cdninstagram.com/v/t51.2885-19/…/avatar.jpg?…"
      },
      {
        "id": "15230646745",
        "username": "nasa_es",
        "full_name": "NASA en Español",
        "is_private": false,
        "is_verified": true,
        "avatar_url": "https://scontent.cdninstagram.com/v/t51.2885-19/…/avatar.jpg?…"
      }
    ],
    "hashtags": [],
    "places": []
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 17
  }
}
```

### List hashtag posts

`GET /v1/hashtag` | 1 credit | paged | fair-use

Returns recent posts under a hashtag and its total post count.

| Name | Type | Required | Description |
|---|---|---|---|
| `tag` | string | Required | Hashtag, with or without `#`. Letters, digits and `_`, up to 100. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

- `owner_username` can be `null` here; `owner_id` is set.

| Case | Status | Credits |
|---|---|---|
| Hashtag not found | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/hashtag?tag=space" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/hashtag",
    params={"tag": "space"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/hashtag");
url.search = new URLSearchParams({ tag: "space" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "tag": "space",
    "hashtag": {
      "id": "17843804908006812",
      "name": "space",
      "media_count": 25259553
    },
    "posts": [
      {
        "shortcode": "DeuAi8tN1s9",
        "url": "https://www.instagram.com/p/DeuAi8tN1s9/",
        "taken_at": 1792505379,
        "format": "image",
        "likes": 1,
        "comments": 0,
        "views": null,
        "caption": "The Sailboat Cluster (NGC 225) and surrounding dust…",
        "image_url": "https://scontent.cdninstagram.com/…/1080.jpg?…",
        "video_url": null,
        "pinned": false,
        "owner_username": null,
        "owner_id": "369923529"
      }
    ],
    "next_cursor": "YTpRVkZDY25GTmNUWnBO…6dIHxl9Si_fRf6-LEiV2ZQ"
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 16
  }
}
```

### Get a location

`GET /v1/place` | 3 credits

Returns name, category, address, coordinates, phone, website and post count of a location.

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Required | Numeric location ID. Find one with `/v1/search`. |

| Case | Status | Credits |
|---|---|---|
| Unknown ID | 404 `not_found` | 3 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/place?id=311693088" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/place",
    params={"id": "311693088"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/place");
url.search = new URLSearchParams({ id: "311693088" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "id": "311693088",
    "name": "NASA Johnson Space Center",
    "category": "Government organization",
    "address": "2101 E NASA Pkwy",
    "city": "Houston, TX",
    "zip": "77058",
    "lat": 29.5519,
    "lng": -95.0981,
    "phone": "+1 281-483-0123",
    "website": "https://www.nasa.gov",
    "media_count": 28604
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### List location posts

`GET /v1/place-posts` | 1 credit | paged

Returns recent posts geotagged at a location.

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Required | Numeric location ID. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

| Case | Status | Credits |
|---|---|---|
| Unknown ID | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/place-posts?id=311693088" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/place-posts",
    params={"id": "311693088"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/place-posts");
url.search = new URLSearchParams({ id: "311693088" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "place_id": "311693088",
    "posts": [
      {
        "shortcode": "C8x1abcDEF0",
        "url": "https://www.instagram.com/p/C8x1abcDEF0/",
        "taken_at": 1758600000,
        "format": "reel",
        "likes": 412000,
        "comments": 1900,
        "views": 5400000,
        "caption": "Sunrise over the Pacific, seen from the station.",
        "image_url": "https://scontent.cdninstagram.com/…/1080.jpg",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4",
        "pinned": false,
        "owner_username": "nasa",
        "owner_id": "528817151"
      }
    ],
    "next_cursor": "QVFE…"
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 1,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### Get an audio track

`GET /v1/audio` | 1 credit | fair-use

Returns title, artist, duration and preview URL of a song or original sound, plus reels that use it.

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Required | Numeric audio ID, from a reel or `/v1/audio-search`. |

| Case | Status | Credits |
|---|---|---|
| Unknown ID | 404 `not_found` | 1 |
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/audio?id=28784844067777520" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/audio",
    params={"id": "28784844067777520"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/audio");
url.search = new URLSearchParams({ id: "28784844067777520" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "audio": {
      "id": "28784844067777520",
      "title": "Original audio",
      "artist": "ravens",
      "duration_ms": 23000,
      "is_original": true,
      "is_explicit": false,
      "cover_url": null,
      "audio_url": "https://scontent.cdninstagram.com/…/audio.mp4?…"
    },
    "posts": [
      {
        "shortcode": "DdhFkS7KGkZ",
        "url": "https://www.instagram.com/p/DdhFkS7KGkZ/",
        "taken_at": 1789924800,
        "format": "reel",
        "likes": 49423,
        "comments": 618,
        "views": 7456668,
        "caption": "Our first Leader of the Uprising 🔥…",
        "image_url": "https://scontent.cdninstagram.com/…/cover.jpg?…",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4?…",
        "pinned": false,
        "owner_username": "ravens",
        "owner_id": "231432514"
      }
    ]
  },
  "meta": {
    "cache": "miss",
    "age_seconds": 0,
    "stale": false,
    "credits": 1,
    "credits_remaining": 0
  }
}
```

### Search audio

`GET /v1/audio-search` | 3 credits | fair-use

Returns songs and sounds matching a title or artist, with IDs for `/v1/audio`.

| Name | Type | Required | Description |
|---|---|---|---|
| `q` | string | Required | Search text, 1-80 characters. |

| Case | Status | Credits |
|---|---|---|
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/audio-search?q=believer" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/audio-search",
    params={"q": "believer"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/audio-search");
url.search = new URLSearchParams({ q: "believer" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "query": "nasa",
    "tracks": [
      {
        "id": "528817151",
        "title": "Artemis",
        "artist": "Imagine Dragons",
        "duration_ms": 204345,
        "is_original": false,
        "is_explicit": false,
        "cover_url": "https://scontent.cdninstagram.com/…/cover.jpg",
        "audio_url": "https://scontent.cdninstagram.com/…/audio.mp4"
      }
    ]
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

### Search reels

`GET /v1/reels-search` | 3 credits | paged | fair-use

Returns reels matching a keyword.

| Name | Type | Required | Description |
|---|---|---|---|
| `q` | string | Required | Search text, 1-80 characters. |
| `cursor` | string | Optional | `next_cursor` from the previous page of the same request. |

| Case | Status | Credits |
|---|---|---|
| Any other error | 4xx or 5xx | 0 |

```bash
curl "https://data.fastsocial.co/v1/reels-search?q=space" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/reels-search",
    params={"q": "space"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/reels-search");
url.search = new URLSearchParams({ q: "space" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response (example values):

```json
{
  "ok": true,
  "data": {
    "query": "nasa",
    "posts": [
      {
        "shortcode": "C8x1abcDEF0",
        "url": "https://www.instagram.com/p/C8x1abcDEF0/",
        "taken_at": 1758600000,
        "format": "reel",
        "likes": 412000,
        "comments": 1900,
        "views": 5400000,
        "caption": "Sunrise over the Pacific, seen from the station.",
        "image_url": "https://scontent.cdninstagram.com/…/1080.jpg",
        "video_url": "https://scontent.cdninstagram.com/…/clip.mp4",
        "pinned": false,
        "owner_username": "nasa",
        "owner_id": "528817151"
      }
    ],
    "next_cursor": "QVFE…"
  },
  "meta": {
    "cache": "hit",
    "age_seconds": 212,
    "stale": false,
    "credits": 3,
    "credits_remaining": 4812,
    "retry_after": 0
  }
}
```

## Top charts

### List top accounts

`GET /v1/top` | Free

Returns the most-followed Instagram accounts, ranked daily, with 1, 7 and 30-day follower changes.

| Name | Type | Required | Description |
|---|---|---|---|
| `sort` | string | Optional | `followers`, `gainers`, `losers` or `milestones`. Defaults to `followers`. |
| `window` | integer | Optional | `1`, `7` or `30` days, for gainers and losers. Defaults to `7` when available. |
| `country` | string | Optional | Two-letter country code, such as `US` or `BR`. |
| `category` | string | Optional | `sports`, `music`, `film_tv`, `creators`, `fashion_beauty`, `brands`, `media`, `public_figures` or `other`. |
| `limit` | integer | Optional | Accounts per page, 1-100. Defaults to `50`. |
| `offset` | integer | Optional | Accounts to skip, up to 5,000. Defaults to `0`. |

- Same data as [Instagram Top Charts](/most-followed-instagram-accounts). Licensed CC BY 4.0: credit FastSocial and link the source.
- Pages with `limit` and `offset`, not a cursor.

```bash
curl "https://data.fastsocial.co/v1/top?limit=2" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/top",
    params={"limit": "2"},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/top");
url.search = new URLSearchParams({ limit: "2" });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "sort": "followers",
    "window_days": 7,
    "country": null,
    "category": null,
    "total": 2000,
    "offset": 0,
    "limit": 2,
    "accounts": [
      {
        "rank": 1,
        "username": "instagram",
        "name": "Instagram",
        "followers": 686552402,
        "change_1d": 0,
        "change_7d": -48107,
        "change_30d": -169280,
        "country": "US",
        "category": "brands",
        "is_verified": true,
        "engagement_rate": 0.000617,
        "next_milestone": 700000000,
        "milestone_projected": null
      },
      {
        "rank": 2,
        "username": "cristiano",
        "name": "Cristiano Ronaldo",
        "followers": 679966924,
        "change_1d": 0,
        "change_7d": -224150,
        "change_30d": 521622,
        "country": "PT",
        "category": "sports",
        "is_verified": true,
        "engagement_rate": 0.009951,
        "next_milestone": 700000000,
        "milestone_projected": null
      }
    ],
    "updated_at": "2026-10-20T12:27:03+00:00",
    "day": "2026-10-20",
    "tracking_since": "2026-09-25",
    "windows_available": [
      1,
      7,
      30
    ],
    "source": "https://fastsocial.co/most-followed-instagram-accounts",
    "license": "CC BY 4.0: credit FastSocial and link to the source URL"
  },
  "meta": {
    "cache": "hit",
    "credits": 0
  }
}
```

## Account

### Get usage

`GET /v1/usage` | Free

Returns your plan, credits used and credits left this month.

- `pack_credits` appears when you hold unused credit packs. The response has no `meta` block.

```bash
curl "https://data.fastsocial.co/v1/usage" \
  -H "X-API-Key: $FASTSOCIAL_API_KEY"
```

```python
import os
import requests

r = requests.get(
    "https://data.fastsocial.co/v1/usage",
    params={},
    headers={"X-API-Key": os.environ["FASTSOCIAL_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

```javascript
// Node 18+ (built-in fetch). Run as an ES module: node app.mjs
const url = new URL("https://data.fastsocial.co/v1/usage");
url.search = new URLSearchParams({  });

const res = await fetch(url, { headers: { "X-API-Key": process.env.FASTSOCIAL_API_KEY } });
const { ok, data, error } = await res.json();
if (!ok) throw new Error(error.code);
console.log(data);
```

Response:

```json
{
  "ok": true,
  "data": {
    "plan": "free",
    "month": "2026-10",
    "credits_used": 26,
    "calls": 16,
    "credits_limit": 50,
    "credits_remaining": 24
  }
}
```

## Use policy

Public data only. Don't use the API to track or harass people, to spam them, to resell their data, or to collect data about minors. Account owners can opt out; after that the API returns `451 opted_out` for that account.

We log what data was pulled and the result, but we never store who pulled it. We work with data, and data pulled by others helps our operations.
