Media
Download a TikTok post's file, base64-encoded: a video's MP4, or one picture of a photo post.
GET | POST /v1/tiktok/mediaSend parameters as a query string with GET, or as a JSON body with POST. Both are equivalent.
What to Pass
| Pass | Reads | Notes |
|---|---|---|
post | The video's MP4, or one picture of a photo post | index picks the picture: 1-based, default 1 |
Pass one source per call. Every identifier also takes the page URL.
Parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
index | integer 1–100 | Photo posts: which picture, 1-based (default 1). | |
post | string | The post whose file to download: numeric id or URL. A video gives its MP4, a photo post one picture. |
Request
curl "https://gateway.apinoa.com/v1/tiktok/media?post=7698770783367171359" \
-H "x-api-key: $APINOA_API_KEY"Response
Returns a media file in data. A real response, shortened: arrays keep their first entries and long text is cut.
{
"success": true,
"data": {
"platform": "tiktok",
"postId": "7698770783367171359",
"contentType": "video/mp4",
"bytes": 22592237,
"encoding": "base64",
"data": "AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAVYbbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AABnMkAAQAAAQAAAAAAAAAAAAAAAAEAAAA…"
}
}For a photo post, index picks the picture and the answer adds index and count, the number of pictures in the post. ?post=7681723633164717325&index=2 answers:
{
"success": true,
"data": {
"platform": "tiktok",
"postId": "7681723633164717325",
"contentType": "image/jpeg",
"bytes": 198005,
"encoding": "base64",
"data": "/9j/4AAQSkZJRgABAQAASABIAAD/4QBMRXhpZgAATU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAEOKADAAQAAAA…",
"index": 2,
"count": 2
}
}Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_PARAMS | A parameter is missing, unknown or out of range. The message names it. |
| 401 | UNAUTHORIZED | The x-api-key header is missing, or the key is revoked or unknown. |
| 402 | INSUFFICIENT_BALANCE | The balance does not cover this call. Top up in the dashboard. |
| 404 | NOT_FOUND | The account, post or group does not exist, or is private, deleted or age-restricted. |
| 429 | MARKETPLACE_SATURATED | Too many concurrent calls. Retry after the Retry-After seconds. |
| 502 | UPSTREAM_ERROR | The platform answered with something unusable. Retry with backoff. |
Every code is listed in Errors. Failed calls are not billed.
Pricing
Price $0.002 per call. List price; the rate steps down above 1,000 calls a day.
Notes
- The response is
{postId, contentType, bytes, encoding: "base64", data}, plusindexandcountfor a photo post. Decodedatato get the file: the MP4 of a video, or the picture (contentTypesays which, e.g.image/jpeg). - An
indexpast the last picture answers400 INVALID_PARAMSwith the post's picture count. A video has one file, so anyindexabove 1 is refused the same way. - Files over 64 MB answer
400 VIDEO_TOO_LARGE. A call costs 2 units.