Twitter Downloader avatar

Twitter Downloader

Pricing

from $2.50 / 1,000 results

Go to Apify Store
Twitter Downloader

Twitter Downloader

File links for Twitter posts.

Pricing

from $2.50 / 1,000 results

Rating

0.0

(0)

Developer

Logical Variety

Logical Variety

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Categories

Security

Limited permissions

Share

File links for Twitter 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.

ActionWhat it returnsRequiredOptional
getLinksGet file URLsurl—
saveFileSave a file by its payloadfilePayload—
FieldTypeDescription
urlstringA Twitter post link.
filePayloadstringsaveFile: a filePayload value from a getLinks item.

Example:

{"action":"getLinks","url":"https://x.com/SpaceX/status/1732824684683784516"}

Output

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 as filesize, audio, quality are 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 Twitter 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 filePayload field (instead of url). Run saveFile with this filePayload to get the file.

saveFile

  • Downloads the file behind a filePayload from a getLinks item of this Actor and stores it in key-value store record FILE (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 filePayload works only while the source is available (usually a few hours): run getLinks again 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.

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.
  • saveFile fails the run when the file server rejects the filePayload or 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).

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.

Run via API

curl -X POST \
"https://api.apify.com/v2/acts/logical_variety~twitter/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"action":"getLinks","url":"https://x.com/SpaceX/status/1732824684683784516"}'