# Klupt API documentation

> The Klupt API returns public Instagram profiles, followers and following in newest-first order, recent posts and user search as JSON. One API key, cursor pagination, pay only for successful calls.

The Klupt API gives you **public Instagram data as clean JSON**: profiles, followers and following in real **newest-first** order, posts, reels, stories, highlights, comments, likers, hashtags, places, audio and search. You authenticate with one API key, page through lists with cursors, and pay only for successful calls.

- Base URL: `https://api.klupt.io/v1`
- Auth: `X-Api-Key: kd_live_…` header ([Authentication](/docs/authentication))
- Sandbox: `kd_test_…` keys return realistic sample data, unlimited and at no cost ([Sandbox](/docs/sandbox)). Every endpoint page has a **Try it** panel.
- Price: 1 credit per successful call (2 for a following page of up to about 200 accounts), from $2.00 per 1,000 credits ([Pricing](/pricing))
- **Public accounts only.** Private accounts answer `private_account`.

## Quickstart

1. [Create a business account](/signup) (company, website, use case) and confirm your email. Sandbox keys work at once.
2. Accounts that pass our automatic checks can create a live key and buy the two smallest packs right away, with 25 live test calls to start. A person reviews the rest within a business day; approval opens larger packs, plans, higher limits and adds 50 test calls. See [account access](/docs/authentication#account-access).
3. Create a key under **API keys** in the dashboard (it is shown once) and call the API:

```bash
# Who did @natgeo follow most recently? Newest first.
curl "https://api.klupt.io/v1/users/natgeo/following" \
  -H "X-Api-Key: $KLUPT_API_KEY"
```

```python
import os, requests

r = requests.get(
    "https://api.klupt.io/v1/users/natgeo/followers",
    headers={"X-Api-Key": os.environ["KLUPT_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
body = r.json()
newest = body["data"][0]          # position 1 = most recent follower
print(newest["username"], body["meta"]["order"])
```

```javascript
const res = await fetch("https://api.klupt.io/v1/users/natgeo/posts", {
  headers: { "X-Api-Key": process.env.KLUPT_API_KEY },
});
const { data, pagination, meta } = await res.json();
```

## Endpoints

| Endpoint | What it returns | Docs |
|---|---|---|
| `GET /v1/users/by-username/{username}` | Profile by username (includes the user id) | [User ID lookup](/docs/instagram-user-id-api) |
| `GET /v1/users/by-id/{id}` | Profile by numeric user id | [Profile API](/docs/instagram-profile-api) |
| `GET /v1/users/{user}` | Profile by username or id | [Profile API](/docs/instagram-profile-api) |
| `GET /v1/users/{user}/followers` | Followers, newest first, 25 a page | [Followers API](/docs/instagram-followers-api) |
| `GET /v1/users/{user}/following` | Following, newest first, ~200 a page | [Following API](/docs/instagram-following-api) |
| `GET /v1/users/{user}/posts` | Recent posts | [Posts API](/docs/instagram-posts-api) |
| `GET /v1/search/users?q=` | Accounts matching a name, up to ~40 | [User search API](/docs/instagram-user-search-api) |
| `GET /v1/users/{user}/reels` | Reels with views, newest or most viewed | [Reels API](/docs/instagram-reels-api) |
| `GET /v1/users/{user}/stories` · `/v1/stories/{story}` | Live stories | [Stories API](/docs/instagram-stories-api) |
| `GET /v1/users/{user}/highlights` · `/v1/highlights/{highlight}` | Highlights and their stories | [Highlights API](/docs/instagram-highlights-api) |
| `GET /v1/users/{user}/tagged` · `/reposts` | Posts an account is tagged in or reposted | [Tagged posts API](/docs/instagram-tagged-posts-api) |
| `GET /v1/users/{user}/related` | Similar accounts | [Similar accounts API](/docs/instagram-similar-accounts-api) |
| `GET /v1/users/{user}/account-details` | Join date, country, username changes | [Account details API](/docs/instagram-account-details-api) |
| `GET /v1/posts/{post}` · `/v1/posts/stats?ids=` | One post by URL or shortcode; counts for 20 posts | [Post API](/docs/instagram-post-api) |
| `GET /v1/posts/{post}/comments` · `/v1/comments/{comment}/replies` | Comments and replies | [Comments API](/docs/instagram-comments-api) |
| `GET /v1/posts/{post}/likers` | Who liked a post | [Likers API](/docs/instagram-likers-api) |
| `GET /v1/hashtags/{tag}` · `/posts` · `/v1/search/hashtags` | Hashtags and their top posts | [Hashtag API](/docs/instagram-hashtag-api) |
| `GET /v1/places/{place}` · `/posts` · `/v1/search/places` | Places and their posts | [Location API](/docs/instagram-location-api) |
| `GET /v1/audio/{audio}` · `/reels` · `/v1/audio/trending` · `/v1/search/audio` | Songs, sounds and the reels using them | [Audio API](/docs/instagram-audio-api) |
| `GET /v1/resolve?url=` | Any Instagram link to ids (free) | [URL resolver](/docs/instagram-url-resolver) |
| `GET /v1/status` | Service status (no key) | |
| `GET /v1/account` | Your balance, limits and key (free) | [Authentication](/docs/authentication#account-endpoint) |

`{user}` is a username or a numeric user id. Every success looks like `{ data, pagination?, meta }`, and `meta` always carries `request_id`, `cached`, `credits_charged` and `credits_remaining`.

## Machine-readable files

- OpenAPI 3.1: [https://api.klupt.io/openapi.json](https://api.klupt.io/openapi.json)
- For LLMs and agents: [/llms.txt](/llms.txt) and [/llms-full.txt](/llms-full.txt)
- Every docs page as Markdown: add `.md` to its URL, for example [/docs/instagram-followers-api.md](/docs/instagram-followers-api.md)

## FAQ

### Is there an API for Instagram followers in chronological order?
Yes. The Klupt API returns a public account's followers and following newest first, with a `position` field (1 = most recent) and `meta.order: "newest_first"` on every list response.

### Does the Klupt API work on private Instagram accounts?
No. It only covers public accounts and publicly visible data. Private accounts answer `403 private_account`, and that call is free.

### Do I need an Instagram login?
No. You authenticate with a Klupt API key. The accounts you look up are never notified.
