Apinoa Docs

Media

Download a TikTok post's file, base64-encoded: a video's MP4, or one picture of a photo post.

View raw .mdx
GET | POST /v1/tiktok/media

Send parameters as a query string with GET, or as a JSON body with POST. Both are equivalent.

What to Pass

PassReadsNotes
postThe video's MP4, or one picture of a photo postindex picks the picture: 1-based, default 1

Pass one source per call. Every identifier also takes the page URL.

Parameters

ParameterTypeRequiredNotes
indexinteger 1–100Photo posts: which picture, 1-based (default 1).
poststringThe 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

StatusCodeMeaning
400INVALID_PARAMSA parameter is missing, unknown or out of range. The message names it.
401UNAUTHORIZEDThe x-api-key header is missing, or the key is revoked or unknown.
402INSUFFICIENT_BALANCEThe balance does not cover this call. Top up in the dashboard.
404NOT_FOUNDThe account, post or group does not exist, or is private, deleted or age-restricted.
429MARKETPLACE_SATURATEDToo many concurrent calls. Retry after the Retry-After seconds.
502UPSTREAM_ERRORThe 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}, plus index and count for a photo post. Decode data to get the file: the MP4 of a video, or the picture (contentType says which, e.g. image/jpeg).
  • An index past the last picture answers 400 INVALID_PARAMS with the post's picture count. A video has one file, so any index above 1 is refused the same way.
  • Files over 64 MB answer 400 VIDEO_TOO_LARGE. A call costs 2 units.

On this page