X (Twitter) Downloader API
Posts from X, resolved into direct links. Videos, GIFs and photos all come back the same way, and a post carrying several images returns every one of them.
GET
https://api.gapi.dev/twitterRequires the X-API-Key header · responds in JSON
Parameters
urlrequiredstringPublic X post: x.com/user/status/… and the older twitter.com form both work, as do t.co share links.
e.g. https://x.com/NASA/status/2039473910987534599Responses
{
"platform": "twitter",
"type": "video",
"title": "Liftoff.\n\nThe Artemis II mission launched from @NASAKennedy…",
"author": "NASA",
"thumbnail": "https://…",
"duration": 66,
"media": [
{ "type": "video", "url": "https://…", "quality": "3840x2160", "ext": "mp4" }
]
}Try it
GET
https://api.gapi.dev/twitterTry
No key yet? Create one free
curl -G 'https://api.gapi.dev/twitter' \
--data-urlencode 'url=https://x.com/NASA/status/2039473910987534599' \
-H 'X-API-Key: YOUR_KEY'What each link gives you
| You send | type | media contains |
|---|---|---|
| a post with a video | video | the highest rendition X encoded, audio included |
| a post with a GIF | video | the file X actually stores, which is a silent mp4 |
| a post with one image | image | the image at full resolution |
| a post with several images | album | every one of them, largest size first |
What it does not do
Timelines, replies, quote chains, spaces and anything on a protected account. This endpoint takes a link to one post and returns the files in it.
Field-by-field detail is on the response shape page.
Code examples
The same request in four languages. Swap in the key from your dashboard and it runs as it is.
curl -G 'https://api.gapi.dev/twitter' \
--data-urlencode 'url=https://x.com/NASA/status/2039473910987534599' \
-H 'X-API-Key: gapi_live_your_key_here'One call, one request
A carousel with ten slides costs the same as a single photo: one charge against your balance. You pay for calls, not for files.