GAPI

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.

GEThttps://api.gapi.dev/twitter

Requires the X-API-Key header · responds in JSON

Parameters

urlrequiredstring

Public 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/2039473910987534599

Responses

{
  "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

GEThttps://api.gapi.dev/twitter
Try
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 sendtypemedia contains
a post with a videovideothe highest rendition X encoded, audio included
a post with a GIFvideothe file X actually stores, which is a silent mp4
a post with one imageimagethe image at full resolution
a post with several imagesalbumevery 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.

Other platforms