Twitter / X Downloader
This API allows you to extract media from Tweets. It supports both legacy twitter.com links and modern x.com links, automatically resolving the highest quality MP4 available.
Endpoint
Section titled “Endpoint” POST
/api/v1/twitter Request Parameters
Section titled “Request Parameters”The following parameters are accepted in the request body:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The link to the Tweet containing the video or GIF. |
Request Examples
Section titled “Request Examples”curl -X POST https://heavstal.com.ng/api/v1/twitter \-H "Content-Type: application/json" \-H "x-api-key: <YOUR_API_KEY>" \-d '{"url": "https://x.com/user/status/123456789"}'const response = await fetch('https://heavstal.com.ng/api/v1/twitter', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify({ url: 'https://x.com/user/status/123456789' })});
const res = await response.json();console.log(res.data.video_hd);import { downloader } from '@heavstal/api';
const tweet = await downloader.xdl("https://x.com/user/status/123456789");console.log(tweet.video_hd);import requests
url = "https://heavstal.com.ng/api/v1/twitter"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}payload = { "url": "https://x.com/user/status/123456789"}
response = requests.post(url, headers=headers, json=payload)print(response.json()["data"])Response Examples
Section titled “Response Examples”{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "description": "This is a funny video caption", "thumbnail": "https://pbs.twimg.com/media/...", "video_hd": "https://video.twimg.com/.../vid/720x1280/file.mp4", "video_sd": "https://video.twimg.com/.../vid/320x560/file.mp4", "audio": null }}{ "status": "error", "error": "No video or GIF found in the provided Tweet."}