TikTok
Options for posting videos or image via the API to TikTok
TikTok API Endpoints
Overview
Ayrshare now offers direct publishing of TikTok videos, comments, and advanced analytics.
TikTok asynchronously process video and photos, so the JSON response will be status: "pending" for both immediate and scheduled posts. Once TikTok has completed processing, your registered Scheduled Action webhook will be called.
TikTok Video Post
JSON for a basic TikTok video post that is directly published:
Example JSON post response:
TikTok does not currently support line breaks in the post text. Included line breaks will be ignored.
Either one video or up to 35 images may be published. TikTok does not support a combination of video and images. Please see below for more details.
If the video does not end in a known extension, use isVideo.
TikTok Image Post
JSON for a basic TikTok image (photo) post that is directly published:
Exmaple JSON response:
TikTok does not currently support line breaks in the post text. Included line breaks will be ignored.
Either one video or up to 35 images may be published. TikTok does not support a combination of video and images. Please see below for more details.
TikTok Processing
TikTok does asynchronous processing of videos and images, so the response will have the id
field set to "pending"
. After TikTok completes their processing, usually within 1 - 2 minutes, the id
field will be updated with the TikTok video id
and a postUrl
will be added.
When the user publishes the video in the TikTok mobile app, a "scheduled" webhook will be sent with the
subAction: "tikTokPublished"
.If an error occurs, such as TikTok was unable to process the video or Ayrshare internal tests failed, the
id
field will be set to "failed" and theerrors
field will contain the error details.
*The idShare
is used for internal referencing the pending video.
TikTok Video Requirements
Please see TikTok Video Requirements.
The video must end in a known video extension such as mp4. Please either reverse proxy the URL, add on a vanity URL with a CDN, or use the /media endpoint.
TikTok's post text character limit is 2,200.
TikTok limits the API video publishing to 2 videos per minute with an upper limit of 20 videos per day.
TikTok Image Requirements
Please see TikTok Image Requirements.
Up to 35 images may be included in a post, at 20 MB per image.
TikTok's post text character limit is 2,200.
TikTok limits the API video publishing to 6 photos per minute with an upper limit of 15 photos per day.
Additional TikTok Options
When publishing a TikTok video or images additional options are available.
Video Example:
Images Example:
Available TikTok Options
Field | Type | Media Type | Description |
---|---|---|---|
autoAddMusic | boolean | image | Default: |
disableComments | boolean | video, image | Default: |
disableDuet | boolean | video | Default: |
disableStitch | boolean | video | Default: |
isBrandedContent | boolean | video, image | Default: |
isBrandOrganic | boolean | video, image | Default: |
imageCoverIndex | number | image | Default value: |
title | string | image | The title of the post. |
thumbNailOffset | number | video | The frame to use for the video cover. Please see below. |
visibility | string | image | Values: |
visibility
Options
visibility
OptionsString Value | Description |
---|---|
public | Visible to all TikTok users. |
private | Private, only visible to the account itself. |
followers | Only visible to followers of the account. |
fiends | Only visible to mutual followers. |
Video Thumbnail
Set a thumbnail for a TikTok video by selecting an offset frame. TikTok does not support uploaded images for thumbnails.
The offset is the location in milliseconds of the thumbnail frame. Default value is 0
, which is the first frame of the video or reel.
TikTok Mentions
Mention another TikTok handle by adding @handle in the post text. For example:
Please review the important rules on mentions.
Legacy TikTok Posting
Note that async posting is only used by older linked account that have not relinked TikTok.
TikTok does asynchronous processing of videos. They require that after uploading the video your user open their mobile TikTok app to finalize the processing.
Please see details on the TikTok process:
TikTok Linking (legacy)Additional examples on using the TikTok API.
Last updated