# TikTok Followers and Following API

> List the followers and the accounts followed by a public TikTok account, about 30 a page with their counts, plus the accounts TikTok suggests alongside it. 1 credit per page.

**List who follows a public TikTok account and who it follows**, about 30 accounts a page, each with its handle, ids, avatar, verified flag and follower / video counts. Plus **similar accounts**: the ones TikTok suggests alongside it.

```
GET https://api.handlehaul.com/v1/tiktok/users/{user}/followers
GET https://api.handlehaul.com/v1/tiktok/users/{user}/following
GET https://api.handlehaul.com/v1/tiktok/users/{user}/suggested
```

- `GET /v1/tiktok/users/{user}/followers`: followers (about 30 a page)
- `GET /v1/tiktok/users/{user}/following`: accounts it follows (about 30 a page)
- `GET /v1/tiktok/users/{user}/suggested`: similar accounts (up to about 30, one page)

**Cost:** 1 credit per page (free from cache). Failed calls and private accounts are free.

**Handles and ids:** list endpoints work on the account's `secUid`. Send a handle we have not looked up in the last 7 days and we look it up first, which adds **1 credit** (`meta.lookup_credits`, `X-Credits-Lookup`). A `secUid`, a numeric id, a handle we already know and later pages never pay it. Every profile and list item returns `id` and `sec_uid`: store them.

## Parameters

| Parameter | In | Description |
|---|---|---|
| `user` | path | TikTok handle (`mila.studio`, with or without `@`), numeric user id, or `secUid` (`MS4wLjABAAAA…`). All digits means an id; write `@12345` for a handle made only of digits. |
| `cursor` | query | `pagination.next_cursor` from the previous page. |
| `fresh` | query | `true` skips the cache. |
| `raw` | query | `true` returns TikTok's own JSON in `data` instead of our fields (same price). |

## Response

```json
{
  "data": [
    {
      "id": "6800816061066175854",
      "sec_uid": "MS4wLjABAAAAwqygALAganfhe4jZpzulcXsnpJBzOO7RGirtKtKB5Mk",
      "handle": "wren.wren16",
      "nickname": "Wren Wren",
      "avatar_url": "https://p16-sign.tiktokcdn-us.com/…/avatar/6800816061066175854~c5_1080x1080.jpeg",
      "is_verified": false,
      "is_private": false,
      "url": "https://www.tiktok.com/@wren.wren16",
      "counts": {
        "followers": 1360658,
        "following": 878,
        "likes": 42180398,
        "videos": 898
      }
    }
  ],
  "pagination": {
    "next_cursor": "eyJ2…sealed…",
    "has_more": true,
    "page_size": 30
  },
  "meta": {
    "request_id": "req_…",
    "list_hidden": false,
    "cached": false,
    "cache_age_seconds": 0,
    "credits_charged": 1,
    "credits_remaining": 26943
  }
}
```

- **Order:** in our checks TikTok returned followers most recent first, but TikTok does not promise an order and shares no follow dates, so we do not guarantee one (there is no `meta.order` on TikTok lists).
- An account can hide its follow lists: the page is then empty and `meta.list_hidden` is `true`.
- Lists are TikTok's snapshot at the time of the call; accounts join and leave while you page.

## Examples

```bash
curl "https://api.handlehaul.com/v1/tiktok/users/mila.studio/followers" -H "X-Api-Key: $HANDLEHAUL_API_KEY"
```

```python
import os, requests
r = requests.get("https://api.handlehaul.com/v1/tiktok/users/mila.studio/followers",
                 headers={"X-Api-Key": os.environ["HANDLEHAUL_API_KEY"]}, timeout=60)
r.raise_for_status()
for u in r.json()["data"]:
    print(u["handle"], u["counts"]["followers"] if u["counts"] else None)
```

```javascript
const res = await fetch("https://api.handlehaul.com/v1/tiktok/users/mila.studio/followers", {
  headers: { "X-Api-Key": process.env.HANDLEHAUL_API_KEY },
});
const { data, meta } = await res.json();
```

```php
$ch = curl_init("https://api.handlehaul.com/v1/tiktok/users/mila.studio/followers");
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ["X-Api-Key: " . getenv("HANDLEHAUL_API_KEY")],
    CURLOPT_RETURNTRANSFER => true,
]);
$body = json_decode(curl_exec($ch), true);
print_r($body["data"]);
```

```go
req, _ := http.NewRequest("GET", "https://api.handlehaul.com/v1/tiktok/users/mila.studio/followers", nil)
req.Header.Set("X-Api-Key", os.Getenv("HANDLEHAUL_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer res.Body.Close()
var body map[string]any
json.NewDecoder(res.Body).Decode(&body)
fmt.Println(body["data"])
```

## FAQ

### Can I get the full follower list of a big TikTok account?
You can page through it with `next_cursor`, about 30 accounts per call. For very large accounts that is many calls; most uses read the first pages.

### How do I find accounts similar to a TikTok creator?
`GET /v1/tiktok/users/{user}/suggested` returns the accounts TikTok recommends next to that profile, in one page.
