Instagram API for Node.js
Call public Instagram data from Node.js, Bun, Deno, Next.js, or Cloudflare Workers with the built-in fetch. No Puppeteer, no instagram-private-api sessions, and no proxies to run.
50 free credits on signup · no card required
curl "https://api.profilequery.com/v1/profile?handle=nike" \
-H "Authorization: Bearer $PROFILEQUERY_KEY"What you get
Structured JSON, not raw HTML
- ▹Built-in fetch only, with zero dependencies
- ▹Works in server routes, serverless functions, edge workers, and cron jobs
- ▹Typed-friendly flat JSON with consistent field names across endpoints
- ▹Keep the key server-side: never call it from the browser
- ▹Cursor pagination with async generators
- ▹Pay per request with no subscription
Tutorial
Get Instagram data with Node.js
1. A tiny client
const API = "https://api.profilequery.com/v1";
export async function ig<T = any>(path: string, params: Record<string, string> = {}): Promise<T> {
const url = `${API}/${path}?${new URLSearchParams(params)}`;
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.PROFILEQUERY_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error?.code}: ${body.error?.message}`);
return body.data;
}
const profile = await ig("profile", { handle: "nike" });
console.log(profile.username, profile.followers);2. Paginate with an async generator
export async function* paginate(path: string, params: Record<string, string>, maxPages = 5) {
let cursor: string | null = null;
for (let i = 0; i < maxPages; i++) {
const page = await ig(path, cursor ? { ...params, cursor } : params);
yield* page.items;
cursor = page.next_cursor;
if (!cursor) break;
}
}
for await (const reel of paginate("profile/reels", { handle: "nike" }, 3)) {
console.log(reel.shortcode, reel.view_count);
}3. Use it in a Next.js route handler
Keep your API key on the server. A route handler proxies just the data your frontend needs.
// app/api/instagram/[handle]/route.ts
import { ig } from "@/lib/ig";
export async function GET(_req: Request, { params }: { params: Promise<{ handle: string }> }) {
const { handle } = await params;
const p = await ig("profile", { handle });
return Response.json({ username: p.username, followers: p.followers, pic: p.profile_pic_url });
}Endpoints
Every endpoint behind this page
Example response
What comes back
{
"data": {
"id": "13460080",
"username": "nike",
"full_name": "Nike",
"biography": "Just Do It.",
"is_verified": true,
"is_private": false,
"is_business": true,
"category": null,
"followers": 291952375,
"following": 264,
"posts": 1657,
"external_url": "http://empli.fi/nike",
"profile_pic_url": "https://instagram.com/.../nike.jpg",
"public_email": null,
"public_phone_number": null
}
}Response fields
Fields returned by GET /v1/profile
| Field | Description |
|---|---|
| id | Numeric account id (stable even if the username changes). |
| username | The account's @handle. |
| full_name | Display name shown on the profile. |
| biography | The profile's bio text. |
| is_verified | Whether the account has a verified badge. |
| is_private | Whether the account is private. |
| is_business | Whether this is a business/professional account. |
| category | Business category label when set (e.g. "Sportswear"); null otherwise. |
| followers | Number of accounts following this account. |
| following | Number of accounts this account follows. |
| posts | Total number of posts on the profile. |
| external_url | The clickable link in the bio, if any. |
| profile_pic_url | URL of the account's profile picture. |
| public_email | Public contact email, if the account exposes one; null otherwise. |
| public_phone_number | Public contact phone number, if exposed; null otherwise. |
No login required
Nothing to authenticate but your API key
No OAuth flow
One static API key in an Authorization: Bearer header. No redirect, no refresh tokens, no expiring session.
No Meta app review
Never touch Meta's developer platform, Business Verification, or a connected Facebook Page. Sign up directly with Profile Query.
Public data only
Every endpoint returns only what's already visible on Instagram without logging in. Private accounts are never accessible.
Pricing
1 credit per request. Credits start at $8.00 per 1,000 and drop to $6.00 per 1,000 at volume — no subscription, no minimums. New accounts get 50 free credits.
See full pricingFAQ
Instagram API for Node.js, explained
Do I need an npm package?
No. It's plain HTTPS + JSON, so the fetch built into Node 18+, Bun, and Deno is enough.
Can I call it from the browser?
Don't. Your API key would be visible to anyone. Call it from a server route, serverless function, or worker, and send only the fields you need to the client.
Is this an alternative to instagram-private-api or Puppeteer scraping?
Yes, for reading public data. You don't log in to Instagram, run a headless browser, or rotate proxies. Breakage on Instagram's side is fixed upstream without a redeploy on yours.
What does it cost?
Most calls are 1–2 credits, from $8.00 per 1,000. New accounts get 50 free credits.
Related
More ways to pull Instagram data
Instagram API in Java
Get public Instagram data in Java with the built-in HttpClient: profiles, posts, comments and followers as JSON. Copy-paste examples, pagination and Jackson parsing. No login or SDK.
Instagram API in Python
Get public Instagram data in Python with plain requests: profiles, posts, reels, comments, and hashtags as JSON. Copy-paste examples with pagination, retries, and pandas. No login or instagrapi session.
Instagram public data to BigQuery
Load public Instagram profiles, posts, and reels into Google BigQuery. Table schemas, a copy-paste Python loader, daily scheduling on Cloud Run, and ready-made SQL for engagement and follower growth.
Instagram data to Google Sheets
Pull public Instagram follower counts, profiles, and recent posts into Google Sheets with a short Apps Script. Custom =INSTAGRAM_FOLLOWERS() formula, daily snapshots, and no add-on subscription.
Instagram scraper API
A hosted Instagram scraper API — pull public profiles, posts, and reels through a clean REST API. No proxies, no browser automation, no CAPTCHAs to solve. Pay per request.
Instagram API without login
Get public Instagram data without logging in, without OAuth, and without Meta app review. One API key, instant access to profiles, posts, reels, and more.
Start pulling node.js data
Create a free key and make your first request in under a minute — 50 credits on us.