# X (Twitter) Video & Image Downloader - Direct Media URLs (`seemuapps/x-video-image-downloader`) Actor

Download videos, GIFs and images from X (Twitter) posts or any account's timeline - direct MP4 and full-resolution image URLs with size, bitrate and duration, optionally saved as files.

- **URL**: https://apify.com/seemuapps/x-video-image-downloader.md
- **Developed by:** [Andrew](https://apify.com/seemuapps) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 media item returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## X (Twitter) Video & Image Downloader - Direct Media URLs

Download videos, GIFs and photos from any public X (Twitter) post - or scan an account's timeline and grab every piece of media it has posted. You get the direct, best-quality MP4 URL and the full-resolution image link for every item, plus every lower-quality variant, size, bitrate and duration. Optionally save the files straight into your run's storage. No login, no cookies, no browser extension.

Paste post URLs or account handles, run, and export the links to JSON, CSV or Google Sheets - or download the saved files with one click.

### What you get

One row per photo, video or GIF:

- **mediaType** (video, photo, animated\_gif), **mediaUrl** - the highest-bitrate MP4 or the original full-resolution image
- **width**, **height**, **durationMs**, **bitrate**, **contentType**, **thumbnailUrl**, **altText**
- **variants** - every available rendition (720p, 480p, 360p, HLS playlist...) with URL, bitrate and resolution
- **tweetId**, **tweetUrl**, **text**, **createdAt**, **authorUsername**, **authorName**
- **likeCount**, **retweetCount**, **replyCount**, **viewCount**, **isRetweet**
- **mediaIndex** / **mediaCount** for posts with several attachments
- With **Save files to storage** on: **fileKey**, **fileUrl** (a direct download link) and **fileSizeBytes**

### Use cases

- **Save videos and images** from posts you want to keep, archive or repost with credit
- **Brand asset archiving** - back up every video and photo your own account has published
- **Competitor and creator research** - pull all media an account posted and review it offline
- **Content pipelines** - feed direct MP4 links into transcription, moderation or editing tools
- **UGC and press monitoring** - collect images attached to posts about your brand
- **Dataset building** - gather labelled images and clips at scale

### How to use

1. Paste one or more **Post URLs** (`https://x.com/user/status/123`), and/or enter **Account usernames** to scan their timelines.
2. For accounts, set **Posts to scan per account** (default 100). Only posts containing media are returned.
3. Choose the **Media types** you want - videos, photos, GIFs - and whether to include **reposted media**.
4. Turn on **Save files to storage** if you want the actual files, not just links. Set a **Max file size** to skip very large videos.
5. Run the actor. Links appear in the **Dataset** tab; saved files appear in the **Key-value store** tab, named `<tweetId>_<index>.<ext>`.

### Output format

Each dataset record:

```json
{
  "tweetId": "2095890073031966734",
  "tweetUrl": "https://x.com/NASA/status/2095890073031966734",
  "authorUsername": "NASA",
  "authorName": "NASA",
  "text": "Watch the X-59 take to the skies...",
  "createdAt": "2026-09-01T18:02:11.000Z",
  "likeCount": 4120,
  "retweetCount": 610,
  "replyCount": 88,
  "viewCount": 512300,
  "isRetweet": false,
  "mediaIndex": 1,
  "mediaCount": 1,
  "mediaType": "video",
  "mediaUrl": "https://video.twimg.com/amplify_video/2095889698845556737/vid/avc1/1920x1080/abc.mp4?tag=29",
  "contentType": "video/mp4",
  "width": 1920,
  "height": 1080,
  "durationMs": 15548,
  "bitrate": 10368000,
  "thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2095889698845556737/img/sEj5r-0XHSoFNKo_.jpg",
  "altText": null,
  "variants": [
    { "url": "https://video.twimg.com/.../1920x1080/abc.mp4?tag=29", "bitrate": 10368000, "contentType": "video/mp4", "resolution": "1920x1080" },
    { "url": "https://video.twimg.com/.../1280x720/def.mp4?tag=29", "bitrate": 2176000, "contentType": "video/mp4", "resolution": "1280x720" },
    { "url": "https://video.twimg.com/.../pl/xyz.m3u8?tag=29", "bitrate": null, "contentType": "application/x-mpegURL", "resolution": null }
  ],
  "fileKey": "2095890073031966734_1.mp4",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/2095890073031966734_1.mp4",
  "fileSizeBytes": 5673011,
  "source": "tweet"
}
```

Photos come back as `https://pbs.twimg.com/media/<id>?format=jpg&name=orig` - the original upload resolution.

### Pricing

Two small events: one per post looked up or scanned, and one per media item returned. Saving files uses your run's storage and data transfer at standard platform rates.

### Tips

- The direct **mediaUrl** links work in any browser, `curl`, `ffmpeg` or download manager - you usually do not need to save files.
- Videos over 4K can be large; use **Max file size** to skip them, or pick the 720p entry from **variants**.
- Set **Posts to scan per account** high (up to 3,200) to pull an account's whole visible media history.

### FAQ

**Does it work on protected or age-restricted accounts?**
Only public posts are available. Media on protected accounts cannot be fetched.

**Can I download Spaces or live broadcasts?**
No. This actor handles video, GIF and photo attachments on regular posts.

**Why is a GIF returned as a video?**
X stores animated GIFs as silent MP4 files. They are labelled `animated_gif` with an MP4 URL.

# Actor input Schema

## `tweetUrls` (type: `array`):

X / Twitter post URLs (https://x.com/user/status/123) or numeric post IDs, one per line. Every photo, video and GIF on each post is returned.

## `usernames` (type: `array`):

Optional. Account handles (with or without @) whose recent posts should be scanned for media.

## `maxTweetsPerUser` (type: `integer`):

How many recent posts to scan for each account in 'usernames'. Only posts that contain media are returned.

## `mediaTypes` (type: `array`):

Which kinds of media to return.

## `includeRetweets` (type: `boolean`):

When scanning an account, also return media from posts the account reposted (retweeted).

## `saveFiles` (type: `boolean`):

Download each media file into the run's Key-value store and add a fileUrl to the record. Off by default - the direct mediaUrl already links to the file on X's servers.

## `maxFileSizeMb` (type: `integer`):

Skip saving files larger than this when 'Save files to storage' is on.

## `maxItems` (type: `integer`):

Stop after this many media items across the whole run. 0 = no limit.

## Actor input object example

```json
{
  "tweetUrls": [
    "https://x.com/NASA/status/2095890073031966734"
  ],
  "maxTweetsPerUser": 100,
  "mediaTypes": [
    "video",
    "photo",
    "animated_gif"
  ],
  "includeRetweets": false,
  "saveFiles": false,
  "maxFileSizeMb": 100,
  "maxItems": 0
}
```

# Actor output Schema

## `results` (type: `string`):

One record per media item: tweetId, tweetUrl, author, text, createdAt, engagement counts, mediaType, mediaUrl (best-quality MP4 or full-resolution image), contentType, width, height, durationMs, bitrate, thumbnailUrl, altText, variants, fileKey, fileUrl, fileSizeBytes.

## `files` (type: `string`):

When 'Save files to storage' is on, each file is stored in the default key-value store under <tweetId>\_<index>.<ext>.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tweetUrls": [
        "https://x.com/NASA/status/2095890073031966734"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("seemuapps/x-video-image-downloader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "tweetUrls": ["https://x.com/NASA/status/2095890073031966734"] }

# Run the Actor and wait for it to finish
run = client.actor("seemuapps/x-video-image-downloader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tweetUrls": [
    "https://x.com/NASA/status/2095890073031966734"
  ]
}' |
apify call seemuapps/x-video-image-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,seemuapps/x-video-image-downloader"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/unTuZvpS2wH7WNypf/builds/wRZJphXggOiaXRCA1/openapi.json
