Getting Started
IGPAPI is a REST API that lets you access public Instagram user profiles and post feeds. Built on top of a multi-account session pool, it handles authentication, rate limiting, and session management automatically.
Authentication
Include your API key in every request using the X-API-Key header. Keys are prefixed with igapi_.
X-API-Key: igapi_your_key_here
Base URL
All API calls are made to your server's base URL. Replace the domain with your deployment address:
https://your-domain.com/api
Plans & Rate Limits
Choose a plan based on your monthly request volume. Each plan also has a per-minute rate limit to prevent bursting.
| Plan | Requests / Month | Rate Limit | Price |
|---|---|---|---|
| Starter | 10,000 | 10 req/min | Free |
| Pro | 50,000 | 30 req/min | Contact |
| Business | 100,000 | 60 req/min | Contact |
Rate Limit Behavior
When you exceed the per-minute rate limit, the API returns a 429 response with a retryAfterMs field indicating when you can retry.
{ "error": "rate_limit_exceeded", "limit": 10, "current": 11, "retryAfterMs": 38400 }
Returns public profile information for an Instagram user. Requires a valid API key.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| username required | path |
string | Instagram username (no @ prefix, max 30 chars) |
Response — 200 OK
{
"pk": "25025320",
"username": "instagram",
"full_name": "Instagram",
"biography": "Discovering — and telling — stories from around the world.",
"follower_count": 672000000,
"following_count": 81,
"posts": 1044,
"reels": 290,
"is_verified": true,
"is_private": false,
"is_business": false,
"profile_pic": "https://...",
"has_stories": true,
"external_url": "",
"city": ""
}
Returns the most recent posts for a public Instagram account. Supports cursor-based pagination.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| username required | path |
string | Instagram username |
| max_id optional | query |
string | Pagination cursor from previous response's pagination.nextMaxId |
Response — 200 OK
{
"user": {
"pk": "25025320",
"username": "instagram",
"fullName": "Instagram",
"profilePic": "https://...",
"isPrivate": false,
"isVerified": true
},
"posts": [
{
"id": "3567890123456789_25025320",
"pk": "3567890123456789",
"shortcode": "CxYZ123abc",
"type": "image",
"timestamp": 1743000000,
"caption": "Hello world",
"likeCount": 124000,
"commentCount": 320,
"mediaUrl": "https://...",
"thumbnailUrl": "https://..."
}
],
"pagination": {
"hasMore": true,
"nextMaxId": "3567890123456789_25025320",
"count": 12
}
}
Error Handling
All errors follow a consistent JSON format:
{
"error": "error_code",
"message": "Human-readable description"
}
retryAfterMs in the response to know when to retry.Code Examples
Example requests for fetching a user profile. Replace igapi_your_key and instagram with your values.
curl -X GET \ -H "X-API-Key: igapi_your_key" \ "https://your-domain.com/api/userinfo/instagram"
curl -H "X-API-Key: igapi_your_key" \ "https://your-domain.com/api/feed/instagram?max_id=CURSOR"
const API_KEY = 'igapi_your_key'; async function getUserInfo(username) { const res = await fetch( `https://your-domain.com/api/userinfo/${username}`, { headers: { 'X-API-Key': API_KEY } } ); if (!res.ok) throw new Error(`Error ${res.status}`); return res.json(); } async function getFeed(username, maxId = null) { let url = `https://your-domain.com/api/feed/${username}`; if (maxId) url += `?max_id=${maxId}`; const res = await fetch(url, { headers: { 'X-API-Key': API_KEY } }); return res.json(); }
import requests API_KEY = "igapi_your_key" BASE = "https://your-domain.com/api" headers = {"X-API-Key": API_KEY} # Fetch profile r = requests.get(f"{BASE}/userinfo/instagram", headers=headers) r.raise_for_status() profile = r.json() print(profile["username"], profile["follower_count"]) # Fetch feed r2 = requests.get(f"{BASE}/feed/instagram", headers=headers) feed = r2.json() for post in feed["posts"]: print(post["type"], post["likeCount"])
<?php function igapi_get($endpoint) { $ch = curl_init("https://your-domain.com/api" . $endpoint); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ["X-API-Key: igapi_your_key"], CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 15, ]); $body = curl_exec($ch); curl_close($ch); return json_decode($body, true); } $profile = igapi_get("/userinfo/instagram"); echo $profile["username"] . "\n"; $feed = igapi_get("/feed/instagram"); foreach ($feed["posts"] as $post) { echo $post["likeCount"] . "\n"; }
Try It Live
Send a real request directly from this page. Your API key is never stored.