TikTok Downloader & Scraper
Pricing
from $3.00 / 1,000 results
TikTok Downloader & Scraper
TikTok video file links, trending feed, users, comments, hashtags and posts.
Pricing
from $3.00 / 1,000 results
Rating
0.0
(0)
Developer
Logical Variety
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Security
Limited permissionsShare
TikTok video file links, trending feed, users, comments and posts.
Pick an action and fill in its fields — the Actor stores the answer in the
dataset. Without action it runs getLinks: pass a link and get file links.
Input
action defaults to getLinks (also when it is empty) and selects what to fetch.
Each action uses only its own fields: fields of other actions are ignored and not sent. A key that is not a field of this Actor (e.g. a typo) fails the run. Required fields are checked before any request; an empty or whitespace-only string counts as a missing value.
| Action | What it returns | Required | Optional |
|---|---|---|---|
getLinks | Get file URLs | url | — |
trendingVideos | Trending videos | countryCode | — |
userDetails | User details | username or userId | — |
userVideos | User videos | username or userId | count |
userFollowers | User followers | username or userId | minCursor |
userFollowing | User following | username or userId | minCursor |
videoComments | Video comments | videoId | count, cursor |
videoCommentReplies | Comment replies | videoId, commentId | count, cursor |
postDetails | Post details | url | — |
saveFile | Save a file by its payload | filePayload | — |
| Field | Type | Description |
|---|---|---|
url | string | A TikTok video link (getLinks, postDetails). |
countryCode | string, must be a 2-letter uppercase country code like "US" | Country of the trending feed, e.g. US. |
username | string | Username, @username or profile link. |
userId | string | Numeric TikTok user ID. |
count | integer, >= 1 | How many items to return. |
minCursor | string | The minCursor value from the previous response, as a string; empty for the first page. |
cursor | string | The cursor value from the previous response, as a string; empty for the first page. |
videoId | string, must be a numeric ID (digits only) | Numeric TikTok video ID: the digits after /video/ in the link. |
commentId | string, must be a numeric ID (digits only) | Comment ID (cid) from videoComments. |
filePayload | string | saveFile: a filePayload value from a getLinks item. |
Example:
{"action":"getLinks","url":"https://www.tiktok.com/@scout2015/video/7703561576900463902"}
Output
getLinks
One dataset item per resource found at the link (usually one; a post with several media can give several):
{"urls": [{ "url": "https://...", "name": "MP4", "subName": "720", "type": "mp4", "extension": "mp4", "quality": "720p" }],"meta": { "title": "...", "sourceUrl": "https://...", "duration": "1:02" },"pictureUrl": "https://...","service": "..."}
urls— available files; fields such asfilesize,audio,qualityare present when the service provides them.- A business error (no downloadable files, private or missing page) is stored as
one dataset item as-is and the run still succeeds. It has one of two forms:
{ "response": 4, "response_type": "link not found", "success": false, "message": "..." }or{ "info": "...", "code": ... }. - A link that is not a TikTok link fails the run before any request is made.
- Direct CDN links can be bound to the IP address of the Actor run and may return 403 when opened from another machine: the Actor does not pass your IP address to the service. Download such links soon after the run, from the same environment if possible.
- Files served through the conversion service are not given out as links: such a
link is replaced with its payload in the
filePayloadfield (instead ofurl). RunsaveFilewith thisfilePayloadto get the file.
saveFile
- Downloads the file behind a
filePayloadfrom agetLinksitem of this Actor and stores it in key-value store recordFILE(with the file's content type); the dataset item is{ "key": "FILE", "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/FILE", "contentType": "video/mp4", "contentDisposition": "...", "bytes": 17825792 }. - A
filePayloadworks only while the source is available (usually a few hours): rungetLinksagain for a fresh one. - The file is streamed to the record, so the run memory does not depend on the file size. The download is limited to 15 minutes. A long video in high quality can take longer than the 300 seconds of a synchronous run: start such runs asynchronously and read the dataset when the run finishes.
API actions
| Action | Example input | Dataset items |
|---|---|---|
trendingVideos | {"action":"trendingVideos","countryCode":"US"} | each element of aweme_list |
userDetails | {"action":"userDetails","username":"tiktok"} | the result object (with user) |
userVideos | {"action":"userVideos","username":"tiktok","count":3} | each element of videos |
userFollowers | {"action":"userFollowers","username":"tiktok"} | each element of userList |
userFollowing | {"action":"userFollowing","username":"tiktok"} | each element of userList |
videoComments | {"action":"videoComments","videoId":"7106594312292453675","count":5} | each element of comments |
videoCommentReplies | {"action":"videoCommentReplies","videoId":"7106594312292453675","commentId":"7106606555949433646"} | each element of comments |
postDetails | {"action":"postDetails","url":"https://www.tiktok.com/@herokobaa/video/7698691093185006878"} | the result object (with aweme_id) |
- Success: a list (
trendingVideos,userVideos,userFollowers,userFollowing,videoComments,videoCommentReplies) — one dataset item per element, as is; the rest of theresult(cursor, counters) is stored in key-value store recordPAGE_INFO, pass the cursor from it to get the next page. An empty list stores no items. Other actions — theresultobject as one dataset item, as is. - A business error (
{ "success": false, ... }, e.g. a missing user or video, or{ "info": "...", "code": ... }) is stored as one item as-is and the run still succeeds.
Errors
- The run fails without storing data when the input is invalid (checked before any request), the request is rejected or gets an unexpected answer, or the service is still unavailable (an error or no answer within 30 seconds) after retries — about 90 seconds in the worst case.
saveFilefails the run when the file server rejects thefilePayloador answers with a non-2xx status, an empty body or an HTML/JSON page instead of a file, the download takes longer than 15 minutes, or the file costs more than the maximum cost of the run allows (see Pricing).
Pricing
This Actor uses pay-per-event pricing: you pay for the Actor start and for each result, platform usage (compute) is included. The prices are on the Actor's page in Apify Store.
A result is one dataset item with data:
getLinks: each resource found at the link (a post with several media gives several);trendingVideos,userVideos,userFollowers,userFollowing,videoComments,videoCommentReplies: each element of the list;userDetails,postDetails: theresultitem.
saveFile is charged by the size of the saved file instead of a result: one
file-10mb event per started 10 MB (10,000,000 bytes), e.g. 3 events
for a 25 MB file. A download that fails saves nothing and charges only the Actor
start. A file is saved only when the maximum cost of the run covers it in full:
otherwise the run fails, before the download when the file size is known in
advance or as soon as the downloaded part exceeds the limit, and saves nothing.
Only the Actor start is charged for:
- a business error item;
- an answer with no items;
- a run that fails.
With a maximum cost per run set, the Actor stores only as many items as the limit covers: the rest of the answer is not stored.
Notes
videoCommentsandvideoCommentRepliesreturncursor,userFollowersanduserFollowingreturnminCursor: pass it back as a string to get the next page.userVideoshas no pagination: it returns up tocountlatest videos.
Run via API
curl -X POST \"https://api.apify.com/v2/acts/logical_variety~tiktok/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \-H "Content-Type: application/json" \-d '{"action":"getLinks","url":"https://www.tiktok.com/@scout2015/video/7703561576900463902"}'