# TikTok Post API

> Get one TikTok video or photo post by id or tiktok.com URL: caption, date, duration, cover, media URL, view, like, comment, share and save counts, author, music and hashtags. 1 credit per call.

**Get one TikTok post as JSON** from its numeric id or its tiktok.com link: caption, date, duration, cover, media URL, counts, author, music, hashtags and mentions, and whether it has captions.

```
GET https://api.handlehaul.com/v1/tiktok/posts/{post}
```

**Cost:** 1 credit per successful call (free from cache). A post that does not exist answers `404 user_not_found` and is free.

## Parameters

| Parameter | In | Description |
|---|---|---|
| `post` | path | Post id (`7300000000000000123`) or a URL-encoded `tiktok.com/@user/video/<id>` or `/photo/<id>` link. |
| `fresh` | query | `true` skips the cache. |
| `raw` | query | `true` returns TikTok's own JSON in `data` (same price). |

## Response

```json
{
  "data": {
    "id": "7300000000000000123",
    "url": "https://www.tiktok.com/@river_wren29/video/7300000000000000123",
    "caption": "Sample post 124 by @river_wren29 #pixel #fyp",
    "created_at": "2026-07-30T00:53:20.000Z",
    "media_type": "video",
    "duration_seconds": 18,
    "cover_url": "https://p16-sign.tiktokcdn-us.com/…/cover/7300000000000000123.jpeg",
    "play_url": "https://v16-webapp-prime.tiktok.com/…/7300000000000000123.mp4",
    "images": null,
    "counts": {
      "views": 538234,
      "likes": 32294,
      "comments": 1076,
      "shares": 538,
      "saves": 1615
    },
    "author": {
      "id": "6804246811370395890",
      "sec_uid": "MS4wLjABAAAAsKNrxsBn-IUSma2viuD_ShtPMiRgkVWSjeDiJxNJZ2w",
      "handle": "river_wren29",
      "nickname": "River Wren",
      "avatar_url": "https://p16-sign.tiktokcdn-us.com/…/avatar/6804246811370395890~c5_1080x1080.jpeg",
      "is_verified": false,
      "is_private": false,
      "url": "https://www.tiktok.com/@river_wren29",
      "counts": {
        "followers": 579298,
        "following": 318,
        "likes": 17958238,
        "videos": 338
      }
    },
    "music": {
      "id": "7200000000000000000",
      "title": "original sound",
      "artist": "River Wren",
      "is_original": true,
      "duration_seconds": 30,
      "cover_url": "https://p16-sign.tiktokcdn-us.com/…/music/7200000000000000000~c5_720x720.jpeg",
      "play_url": "https://v16-webapp-prime.tiktok.com/…/music/7200000000000000000.mp3",
      "post_count": null,
      "url": "https://www.tiktok.com/music/original-sound-7200000000000000000"
    },
    "hashtags": [
      "pixel",
      "fyp"
    ],
    "mentions": [],
    "language": "en",
    "location": "US",
    "has_captions": true,
    "is_ad": false
  },
  "meta": {
    "request_id": "req_…",
    "cached": false,
    "cache_age_seconds": 0,
    "credits_charged": 1,
    "credits_remaining": 26943
  }
}
```

## Examples

```bash
curl "https://api.handlehaul.com/v1/tiktok/posts/7300000000000000123" -H "X-Api-Key: $HANDLEHAUL_API_KEY"
```

```python
import os, requests
r = requests.get("https://api.handlehaul.com/v1/tiktok/posts/7300000000000000123",
                 headers={"X-Api-Key": os.environ["HANDLEHAUL_API_KEY"]}, timeout=60)
r.raise_for_status()
p = r.json()["data"]
print(p["caption"], p["counts"])
```

```javascript
const res = await fetch("https://api.handlehaul.com/v1/tiktok/posts/7300000000000000123", {
  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/posts/7300000000000000123");
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/posts/7300000000000000123", 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 pass the TikTok link instead of the id?
Yes. URL-encode it into the path: `/v1/tiktok/posts/https%3A%2F%2Fwww.tiktok.com%2F%40user%2Fvideo%2F7300000000000000123`.
