---
title: "How to get Instagram data"
description: "Get any public Instagram profile, posts, reels with play counts, comments and hashtags as JSON, without a Meta app. What the Graph API allows, working code, a real response and prices."
canonical_url: https://groundsocial.dev/guides/how-to-get-instagram-data
---
# How to get Instagram data

> Get any public Instagram profile, posts, reels with play counts, comments and hashtags as JSON, without a Meta app. What the Graph API allows, working code, a real response and prices.

_Checked 2026-11-27._

Meta’s Instagram API reads your own professional account, and other Business or Creator accounts only partly, through Business Discovery and app review. A data API reads any public account for you. One GET returns an account’s posts, 12 a page with captions, likes and comment counts, 1 credit a page.

> **Checked 27 November 2026** Every request on this page was run against the live API on that date, and the sample response is from that run. Official-API facts link to the platform’s own pages.

## The official Instagram API

Meta’s Instagram Platform is built for managing your own professional account.

- The **Basic Display API**, the old way to read personal accounts, was switched off on 4 December 2024.
- **Business Discovery** returns another Business or Creator account’s follower count, media count and published media, queried through your own professional account, a Meta app and app review. Personal accounts aren’t covered.
- No official endpoint returns another account’s comments, reels with view counts, or follower list.

Sources: [Meta, “Update on Instagram Basic Display API”, 4 Sep 2024](https://developers.facebook.com/blog/post/2024/09/04/update-on-instagram-basic-display-api), [Business Discovery](https://developers.facebook.com/docs/instagram-platform/instagram-api-with-facebook-login/business-discovery).

## Quick start

1. **Get a key.** [Sign up](https://groundsocial.dev/app/sign-in?new=1) with an email code: 100 free credits, no card. An agent can sign itself up with `POST https://api.groundsocial.dev/v1/agent/signup`.
2. **Set it in your shell.** `export GROUNDSOCIAL_API_KEY=gs_live_…`
3. **Make the call.** An account’s posts: `GET /v1/instagram/users/natgeo/posts`, 1 credit.

cURL:

```bash
curl "https://api.groundsocial.dev/v1/instagram/users/natgeo/posts" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY"
```

TypeScript:

```ts
const res = await fetch('https://api.groundsocial.dev/v1/instagram/users/natgeo/posts', {
  headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` },
})
if (!res.ok) throw new Error((await res.json()).error.hint)
const data = await res.json()
```

Python:

```python
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/instagram/users/natgeo/posts",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
```

## Sample response

Trimmed from the real response on 27 November 2026: lists cut to their first items and long strings shortened. Every field is described in the [tutorial](https://groundsocial.dev/tutorials/instagram/user-posts/python).

```json
{
  "items": [
    {
      "pk": "4032379434794749057",
      "id": "4032379434794749057_787132",
      "code": "Df147tCiAyB",
      "url": "https://www.instagram.com/p/Df147tCiAyB/",
      "taken_at": 1794917109,
      "media_type": 8,
      "product_type": "carousel_container",
      "caption": {
        "text": "National Geographic photographers ventured to places far and wide to capture the year’s mo…"
      },
      "like_count": 24421,
      "comment_count": 111
    }
  ],
  "more_available": true,
  "next_cursor": "eyJzIjoicG9zdHM6bmF0Z2VvIiwiYyI6IkFRSFR0RU9ISnFIRFRucTd5MEJ6U3B2UFB6Mlo1ckN4RnJienoyWVdWME…"
}
```

## Get every page

`/v1/instagram/users/natgeo/posts` returns posts a page at a time, and each page costs 1 credit. Pass the response’s `next_cursor` back as `cursor` until it runs out.

TypeScript:

```ts
// Collect up to 5 pages of posts.
const first = 'https://api.groundsocial.dev/v1/instagram/users/natgeo/posts'
const items: unknown[] = []
let cursor: string | undefined
for (let page = 0; page < 5; page++) {
  const url = new URL(first)
  if (cursor) url.searchParams.set('cursor', cursor)
  const res = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` },
  })
  if (!res.ok) throw new Error((await res.json()).error.hint)
  const data = await res.json()
  items.push(...(data.items ?? []))
  cursor = data.more_available ? data.next_cursor : undefined
  if (!cursor) break
}
console.log(items.length, 'posts')
```

Python:

```python
import os, requests

# Collect up to 5 pages of posts.
FIRST = "https://api.groundsocial.dev/v1/instagram/users/natgeo/posts"
headers = {"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}
items, cursor = [], None
for page in range(5):
    params = {"cursor": cursor} if cursor else {}
    res = requests.get(FIRST, params=params, headers=headers)
    res.raise_for_status()
    data = res.json()
    items += data.get("items") or []
    cursor = data.get("next_cursor") if data.get("more_available") else None
    if not cursor:
        break
print(len(items), "posts")
```

## What else you can get from Instagram

| What you get | Endpoint | Credits |
| --- | --- | --- |
| [An account’s posts](https://groundsocial.dev/tutorials/instagram/user-posts/python) | `GET /v1/instagram/users/natgeo/posts` | 1 |
| [A profile with follower count](https://groundsocial.dev/tutorials/instagram/profile/python) | `GET /v1/instagram/users/natgeo` | 1 |
| [An account’s reels](https://groundsocial.dev/tutorials/instagram/user-reels/python) | `GET /v1/instagram/users/natgeo/reels` | 1 |
| [One post or reel](https://groundsocial.dev/tutorials/instagram/post/python) | `GET /v1/instagram/posts/DfAWxdIFmVB` | 1 |
| [Comments on a post](https://groundsocial.dev/tutorials/instagram/comments/python) | `GET /v1/instagram/posts/DfAWxdIFmVB/comments` | 2 |
| [Posts for a hashtag](https://groundsocial.dev/tutorials/instagram/hashtag-search/python) | `GET /v1/instagram/search/hashtag` | 1 |
| [Engagement rate over recent posts](https://groundsocial.dev/tutorials/instagram/engagement-rate/python) | `GET /v1/instagram/users/natgeo/engagement` | 2 |

Each row links to its tutorial. Every Instagram endpoint and price: [Instagram API](https://groundsocial.dev/instagram-api).

## Tips

- Usernames work with or without the `@`, or as a profile URL; a post’s shortcode is the part after `/p/` or `/reel/`.
- `media_type` 1 is a photo, 2 a video and 8 a carousel; `product_type` says `clips` for reels.
- Track growth by calling the profile daily and storing `follower_count` with the date.
- Image and video URLs are Instagram’s CDN links and expire; download what you need to keep.

## Use it from Claude or Cursor (MCP)

Every endpoint is also an MCP tool on the remote server `https://api.groundsocial.dev/mcp`. The `?platforms=instagram` below loads only the Instagram tools. The client signs in with OAuth, or send your key as a Bearer token. Tools used in this guide: `instagram_user_posts`, `instagram_user_get`, `instagram_user_reels`, `instagram_post_get`, `instagram_post_comments`, `instagram_search_hashtag`, `instagram_user_engagement`.

Claude Code:

```bash
claude mcp add --transport http groundsocial "https://api.groundsocial.dev/mcp?platforms=instagram"
```

Cursor:

```json
{
  "mcpServers": {
    "groundsocial": {
      "url": "https://api.groundsocial.dev/mcp?platforms=instagram"
    }
  }
}
```

Claude.ai:

```text
Customize → Connectors → + Add → Add custom connector
URL: https://api.groundsocial.dev/mcp?platforms=instagram
```

> **Then ask** “Get @natgeo’s last 24 Instagram posts, rank them by likes, and summarise the comments on the top one.”

Setup for ChatGPT, VS Code, Windsurf, n8n and others: [MCP client setup](https://groundsocial.dev/mcp).

## Pricing

Pay per call from prepaid credits; no subscription. 100 free credits cover the examples on this page. Costs below are at the [credit packs](https://groundsocial.dev/pricing)’ highest and lowest rates.

| Job | Credits | Cost |
| --- | --- | --- |
| Follower counts of 1,000 creators | 1,000 | $1.00 → $0.40 |
| Last ~60 posts of 100 accounts (5 pages) | 500 | $0.50 → $0.20 |
| First page of comments on 500 posts | 1,000 | $1.00 → $0.40 |

## FAQ

### Does it work for personal (non-business) accounts?

Yes, for any public account. Private accounts return their counts and bio but no posts.

### Can I get the list of an account’s followers?

No. Instagram shows follower lists only to signed-in users, and we never sign in. You get the counts, plus similar accounts and the people tagged in posts.

### Are comment replies included?

Top-level comments come with their reply counts; Instagram loads reply threads only for signed-in users.

### Are failed calls charged?

No. A target that does not exist answers `404 target_not_found`, an upstream failure answers `503`, and neither costs anything. Credits never expire.

### Is Groundsocial official?

No. Groundsocial is an independent API that reads what the platform shows a logged-out visitor. Instagram is a trademark of Instagram, LLC (Meta Platforms, Inc.). We are not affiliated with or endorsed by Instagram or Meta.

## Go deeper

- [Instagram tutorials: 25 endpoints in six languages](https://groundsocial.dev/tutorials/instagram)
- [Does Instagram have a public API?](https://groundsocial.dev/answers/does-instagram-have-a-public-api)
- [How do I get Instagram data without the official API?](https://groundsocial.dev/answers/how-to-get-instagram-data-without-api)
- [What replaced CrowdTangle?](https://groundsocial.dev/answers/what-replaced-crowdtangle)
- [Is there an MCP server for social media data?](https://groundsocial.dev/answers/social-media-mcp-server)
- [Influencer discovery API](https://groundsocial.dev/use-cases/influencer-discovery-api)
- [Comment scraping API](https://groundsocial.dev/use-cases/comment-scraping-api)

## Related guides

- [How to get TikTok data](https://groundsocial.dev/guides/how-to-get-tiktok-data)
- [How to get Threads data](https://groundsocial.dev/guides/how-to-get-threads-data)

Instagram is a trademark of Instagram, LLC (Meta Platforms, Inc.). We are not affiliated with or endorsed by Instagram or Meta.

_Canonical HTML: https://groundsocial.dev/guides/how-to-get-instagram-data_

## Site Navigation

### Global Hub
- [Home](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Endpoints](https://groundsocial.dev/endpoints.md)
- [For agents](https://groundsocial.dev/agents.md)
- [Docs](https://groundsocial.dev/docs.md)
- [Compare](https://groundsocial.dev/compare.md)
- [Blog](https://groundsocial.dev/blog.md)
- [Tutorials](https://groundsocial.dev/tutorials.md)
- [Changelog](https://groundsocial.dev/changelog.md)
- [llms.txt](https://groundsocial.dev/llms.txt)
- [Agent skill](https://groundsocial.dev/SKILL.md)

### On This Topic
- [Groundsocial: Social data in one API call](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Playground](https://groundsocial.dev/playground.md)
- [Use cases](https://groundsocial.dev/use-cases.md)
- [Brand monitoring API](https://groundsocial.dev/use-cases/brand-monitoring-api.md)
- [Social listening API](https://groundsocial.dev/use-cases/social-listening-api.md)
- [Comment scraping API](https://groundsocial.dev/use-cases/comment-scraping-api.md)
- [Influencer discovery API](https://groundsocial.dev/use-cases/influencer-discovery-api.md)
- [Video transcript API](https://groundsocial.dev/use-cases/video-transcript-api.md)
- [Ad library API](https://groundsocial.dev/use-cases/ad-library-api.md)
- [Review monitoring API](https://groundsocial.dev/use-cases/review-monitoring-api.md)
- [Trend detection API](https://groundsocial.dev/use-cases/trend-detection-api.md)
- [Social lead generation API](https://groundsocial.dev/use-cases/lead-generation-api.md)
- [Market research API](https://groundsocial.dev/use-cases/market-research-api.md)

## Structured data

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://groundsocial.dev/"},{"@type":"ListItem","position":2,"name":"Guides","item":"https://groundsocial.dev/guides"},{"@type":"ListItem","position":3,"name":"How to get Instagram data","item":"https://groundsocial.dev/guides/how-to-get-instagram-data"}]}
```
