instapi.co

API Docs

Search Instagram, look up profiles and fetch posts, with every image and video parsed to text by AI. Use it over REST or through the hosted Instagram MCP server. Same key, same credits.

Base URL: https://instapi.co. Agents can read the machine version of this page at /api/help (JSON).

Quick start

# 1. Sign up (returns a JWT and 10 free credits)
curl -X POST https://instapi.co/api/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "password": "..."}'

# 2. Create an API key with the JWT
curl -X POST https://instapi.co/api/keys \
  -H "Authorization: Bearer jwt_instapi_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "my-agent"}'

# 3. Query Instagram with the key
curl "https://instapi.co/api/instagram/search?q=nasa" \
  -H "Authorization: Bearer sk_instapi_..."

Prefer a UI? Get an API key in the dashboard.

Authentication

Every authenticated call uses an Authorization: Bearer header.

GET /api/instagram/search?q={query}

Search Instagram users, hashtags and places by keyword. Costs 1 credit.

curl "https://instapi.co/api/instagram/search?q=nasa" \
  -H "Authorization: Bearer sk_instapi_..."
{
  "meta": { "credits_remaining": 9 },
  "users": [
    {
      "username": "nasa",
      "fullName": "NASA",
      "profilePicUrl": "https://...",
      "isPrivate": false,
      "isVerified": true,
      "userId": "..."
    }
  ],
  "hashtags": [{ "name": "nasa", "mediaCount": 1234567, "id": "..." }],
  "places": [{ "title": "...", "subtitle": "...", "location": { ... } }]
}

Get a user's profile

GET /api/instagram/users/{username}

Public profile for an Instagram account: bio, links, follower, following and post counts, verified, private and business flags, category and public contact info. Works for private accounts too. username can be a bare name, an @handle or a profile URL. Costs 1 credit, not charged if the user doesn't exist.

curl "https://instapi.co/api/instagram/users/nasa" \
  -H "Authorization: Bearer sk_instapi_..."
FieldDescription
username, fullName, idIdentity
biographyBio text
externalUrl, bioLinks[]Links in bio (title, url)
followerCount, followingCount, postCountCounts
isVerified, isPrivate, isBusinessFlags
accountTypepersonal, business or creator
categoryBusiness category, if set
contactPublic email, phone, address, if shown
profilePicUrlProfile picture

Get a user's posts

GET /api/instagram/users/{username}/posts?count={n}

Recent posts for a public Instagram account, newest first. Each image and video is described in text by AI (parsedContent), so an agent can read what's in a post without vision. Costs 1 credit.

curl "https://instapi.co/api/instagram/users/nasa/posts?count=3" \
  -H "Authorization: Bearer sk_instapi_..."
FieldDescription
shortcodeInstagram post code
urlPost URL on instagram.com
typeimage, video or carousel
takenAtPost time, ISO 8601
pinnedPinned to the profile grid
likeCountLikes
commentCountComments
captionCaption text
media[]type, imageUrl, videoUrl, width, height, parsedContent (AI text description)

MCP server

The same data is available as MCP tools at https://instapi.co/mcp (streamable HTTP): get_started (free), instagram_search, instagram_user_profile and instagram_user_posts (1 credit each). Setup for Claude, Cursor, VS Code and Codex is on the Instagram MCP page.

Account endpoints

EndpointAuthDescription
GET /api/startnoneService info and onboarding steps
POST /api/signupnoneCreate an account: {email, password} (min 8 chars). Returns a JWT and 10 free credits.
POST /api/loginnoneReturns a JWT and credit balance
GET /api/statusJWTCredits, API keys, purchase history
GET /api/keysJWTList active API keys
POST /api/keysJWTCreate a key: {name}. Shown once.
DELETE /api/keys/:idJWTRevoke a key
POST /api/checkoutJWTStripe payment link: {amountCents} (min 100, steps of 100)

Responses and errors

Every response has a meta object. Successful data calls include meta.credits_remaining. Many responses include meta.next_steps, a list of the next calls to make, so an agent can work through signup, keys and queries on its own. Errors include meta.error and a machine-readable meta.reason. Failed calls are refunded.

StatusMeaning
400Missing or invalid parameter, e.g. invalid_username
401Missing or invalid token or API key
402Out of credits. meta.next_steps points to checkout.
404user_not_found, or private_account for posts on a private account. Not charged.
429Rate limited. Retry later.
502upstream_error: Instagram didn't answer. Refunded, safe to retry.

Pricing