# Instagram User Search API

> Search Instagram accounts by name or username and get matching users as JSON, up to about 40 results per search. 1 credit per page.

**Find Instagram accounts by name or username.** Returns matching users (id, username, name, verified and private flags, picture). Instagram caps a search at about 40 results.

```
GET https://api.klupt.io/v1/search/users?q={query}
```

**Cost:** 1 credit per page (0.5 from cache).

## Parameters

| Parameter | In | Description |
|---|---|---|
| `q` | query | What to search for, 1 to 64 characters. |
| `cursor` | query | `pagination.next_cursor` from the previous page. |
| `fresh` | query | `true` skips the cache (full price). |

## Response

```json
{
  "data": [
    { "id": "787132", "username": "natgeo", "full_name": "National Geographic", "is_private": false, "is_verified": true, "profile_pic_url": "https://scontent.cdninstagram.com/…" }
  ],
  "pagination": { "next_cursor": null, "has_more": false, "page_size": 1 },
  "meta": { "request_id": "req_…", "cached": false, "cache_age_seconds": 0, "credits_charged": 1, "credits_remaining": 26944.5 }
}
```

## Examples

```bash
curl -G "https://api.klupt.io/v1/search/users" --data-urlencode "q=national geographic" -H "X-Api-Key: $KLUPT_API_KEY"
```

```python
import os, requests
users = requests.get("https://api.klupt.io/v1/search/users", params={"q": "coffee roasters"},
                     headers={"X-Api-Key": os.environ["KLUPT_API_KEY"]}, timeout=30).json()["data"]
```

```javascript
const url = new URL("https://api.klupt.io/v1/search/users");
url.searchParams.set("q", "coffee roasters");
const { data } = await (await fetch(url, { headers: { "X-Api-Key": process.env.KLUPT_API_KEY } })).json();
```

## FAQ

### How many results does Instagram user search return?
About 40 at most per search, which is Instagram's own cap. Narrow the query for better matches.
