API Documentation

Extract Instagram and TikTok data with simple REST API calls. Profiles, posts, stories, reels, comments, hashtags, locations, and more.

74
Instagram Endpoints
17
TikTok Endpoints
0-3
Credits per Call

Quick Start

1

Sign Up

Create a free account and get 100 credits

2

Get API Key

Generate your key from the dashboard

3

Make Requests

Call any endpoint with your key

Here's your first API call — fetch any Instagram profile in seconds:

curl -H "Authorization: Bearer gs_your_key" \
  "https://gramscraper.com/api/instagram/v1/user/by/username?username=instagram"
import requests

response = requests.get(
    "https://gramscraper.com/api/instagram/v1/user/by/username",
    params={"username": "instagram"},
    headers={"Authorization": "Bearer gs_your_key"}
)
user = response.json()
print(f"{user['data']['username']} — {user['data']['follower_count']} followers")
const response = await fetch(
  "https://gramscraper.com/api/instagram/v1/user/by/username?username=instagram",
  { headers: { Authorization: "Bearer gs_your_key" } }
);
const { data } = await response.json();
console.log(`${data.username} — ${data.follower_count} followers`);

Authentication

All API requests require a Bearer token in the Authorization header.

Authorization: Bearer gs_your_api_key
API keys start with gs_. Get yours from the dashboard. Free accounts include 100 credits to start — no credit card required.

Base URLs

All endpoints are relative to the platform base URL:

Instagram  https://gramscraper.com/api/instagram
TikTok     https://gramscraper.com/api/tiktok

Credits System

Each call costs 0–3 credits and every endpoint below shows its exact price. Direct ID lookups cost 1 credit; endpoints that resolve a username first (e.g. /stories/by/username) cost 2–3 because they make multiple upstream calls; utility converters are free.

Credits never expire. Buy once, use whenever you need them.

Rate Limits

Requests are rate-limited per API key for fair use. If you hit the limit, you'll receive a 429 Too Many Requests response. Back off and retry after a short delay.

Error Codes

StatusMeaning
400Bad Request — missing or invalid parameters
401Unauthorized — invalid or missing API key
402Payment Required — insufficient credits
404Not Found — endpoint or resource doesn't exist
429Too Many Requests — rate limit exceeded
500Internal Server Error — something went wrong on our end

All error responses return JSON:

{ "error": "Insufficient credits", "credits_remaining": 0 }

AI assistants (MCP)

GramScraper runs a hosted Model Context Protocol server, so Claude, Cursor, VS Code and other MCP clients can look up public Instagram and TikTok data for you. Tool calls spend credits from your balance at the same prices as the API.

https://gramscraper.com/mcp

Add that URL as a remote MCP server in your client. The client opens a GramScraper page where you log in and approve access. You don’t need to copy an API key.

Settings → Connectors → Add custom connector
Name: GramScraper
URL:  https://gramscraper.com/mcp
Then choose Connect and approve access on gramscraper.com.
claude mcp add --transport http gramscraper https://gramscraper.com/mcp
# then run /mcp inside Claude Code and choose Authenticate
# ~/.cursor/mcp.json
{
  "mcpServers": {
    "gramscraper": { "url": "https://gramscraper.com/mcp" }
  }
}

If your client doesn’t support OAuth, send an API key in a header instead: Authorization: Bearer gs_your_api_key.

ToolReturnsCredits
get_profileBio, follower counts, verification, category and links1
get_user_postsRecent feed posts, paginated with cursor2 / page
get_user_reelsRecent reels with view counts, paginated2, then 1 / page
get_tagged_postsPosts the account is tagged in, paginated2, then 1 / page
get_user_storiesStories live right now3
get_user_highlightsStory highlight reels3
get_postOne post or reel: caption, engagement, media URLs1
get_post_commentsComments on a post or reel2
get_hashtag_top_postsTop posts under a hashtag, paginated1 / page
search_hashtagsHashtags matching a keyword, with post counts1
search_placesPlaces by name1
find_places_nearbyPlaces near a latitude/longitude1
get_place_top_postsTop posts tagged at a place1
tiktok_get_profileTikTok bio, followers, likes and video count1
tiktok_get_videoOne TikTok video: plays, likes, shares, hashtags, music1
tiktok_get_video_commentsComments on a TikTok video, paginated1 / page
tiktok_get_hashtagTikTok hashtag video and view counts1
tiktok_get_hashtag_videosPopular videos under a TikTok hashtag, paginated2, then 1 / page
get_credit_balanceCredits left on the accountFree
Approving a client creates an API key named MCP · <app name>. To disconnect, revoke that key under Account → API keys. Each connection is limited to 30 tool calls a minute. Only publicly available information is accessible.

Instagram User Profile

7 endpoints

User Media

10 endpoints

Stories & Highlights

14 endpoints

Post Details

13 endpoints

Comments

5 endpoints

Hashtags

6 endpoints

Audio

3 endpoints

Location

7 endpoints

Share Links

3 endpoints

TikTok User

3 endpoints

Media

8 endpoints

Hashtag

2 endpoints

Start with 100 free credits

No credit card required. Standard is $45 for 25,000 credits and Business is $300 for 320,000 — one-time purchases, and credits never expire.

Create a free account