# How to Scrape Images and Videos From Tweets

To scrape images and videos from tweets, collect posts with a media filter such as from:NASA filter:media using apidojo's Tweet Scraper V2 on Apify, then download the files from the media URLs in each result.

[![apidojo](/blog/authors/apidojo.png)**Apidojo** *15+ years of experience in data retrieval.*](/blog/authors/apidojo/)

**7 October 2026** Published

**3 min** Read

![Cover card reading 'How to Scrape Images and Videos From Tweets'](/blog/covers/scrape-twitter-media.png)

**To scrape images and videos from tweets, collect posts with a media filter such as `from:NASA filter:media` using apidojo’s [Tweet Scraper V2](https://apify.com/apidojo/tweet-scraper) on Apify, then download the files from the media URLs in each result.** Photos come as direct `pbs.twimg.com` links, and each media item is labelled with its type: photo, video or animated GIF.

This guide covers the query, the media fields in the output, a Python downloader and the costs. Media search filters themselves are covered in [how to search only tweets with images, videos or links](/blog/twitter-search/media-filters/). Every other collection task is mapped in [how to scrape Twitter (X) data](/blog/twitter-scraping/how-to-scrape-twitter/).

## How Do You Collect Tweets With Media?

**You collect tweets with media by adding `filter:media`, `filter:images` or `filter:videos` to the query in `searchTerms`, or by turning on the `onlyImage` or `onlyVideo` inputs.** `from:NASA filter:media` is one of the actor’s documented examples (Apify).

```
{
  "searchTerms": ["from:NASA filter:images since:2026-01-01"],
  "sort": "Latest",
  "maxItems": 500
}
```

## Where Are the Media URLs in the Output?

**apidojo’s Twitter actors return media in an `extendedEntities.media` array, one entry per photo or video, with its `type`, `media_url_https` and `expanded_url`, plus a flat `media` list of the image URLs.** The fields below come from apidojo’s documented output example ([Apify](https://apify.com/apidojo/twitter-list-scraper)).

| Field | Contains |
| --- | --- |
| extendedEntities.media[].type | photo, video or animated_gif |
| extendedEntities.media[].media_url_https | Direct image URL, for example https://pbs.twimg.com/media/GGWb69-a0AAj1iA.jpg |
| extendedEntities.media[].expanded_url | The post’s media page on X |
| media | A list of the media URLs |

For a video, `media_url_https` is the preview image; X’s media object for videos also carries the playable MP4 files as variants at different bitrates.

## How Do You Download Tweet Images With Python?

**Read each post’s `extendedEntities.media` list, keep the photos, and save each `media_url_https` file.** The script names each file after the post ID and position so nothing is overwritten.

```
import os, pathlib, requests
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("apidojo/tweet-scraper").call(run_input={
    "searchTerms": ["from:NASA filter:images since:2026-01-01"],
    "sort": "Latest",
    "maxItems": 200,
})

out = pathlib.Path("tweet_images")
out.mkdir(exist_ok=True)
for tweet in client.dataset(run.default_dataset_id).iterate_items():
    media = (tweet.get("extendedEntities") or {}).get("media", [])
    for i, item in enumerate(media):
        if item.get("type") != "photo":
            continue
        url = item["media_url_https"]
        path = out / f"{tweet['id']}_{i}{pathlib.Path(url).suffix}"
        path.write_bytes(requests.get(url, timeout=30).content)
```

The Python setup is in [how to collect tweets with Python](/blog/twitter-scraping/scrape-tweets-python/).

## How Do You Collect Videos From Tweets?

**Filter for video with `filter:native_video` to keep videos uploaded to X, then read each video entry in `extendedEntities.media` and choose the highest-bitrate MP4 variant.** `filter:videos` also includes YouTube links, which have no file to download from X ([twitter-advanced-search reference](https://github.com/igorbrigadir/twitter-advanced-search)).

## What Does Media Scraping Cost?

**Media scraping costs the same as any tweet collection, $0.40 per 1,000 tweets on Tweet Scraper V2, and downloading the files from X’s media servers adds no actor fee.** 1,000 image posts cost $0.40; the files then download directly from the `pbs.twimg.com` URLs (Apify).

## Can You Use Scraped Twitter Media?

**Scraped media still belongs to the people who posted it, so use it for analysis, research or archiving, and get permission before republishing.** Check X’s Terms of Service and copyright law for your use case. Embedding the original post is the safe way to show it on a website; see [how to embed a tweet on a website](/blog/x-guides/embed-a-tweet/).

## The scrapers behind this

-   [Tweet Scraper V2 Tweets from searches, profiles, Lists and URLs; 49–64 tweets/sec; minimum 50 per query $0.40 / 1K tweets](/scrapers/twitter-scraper/)
-   [Twitter List Scraper Tweets and members of any X List URL $0.008 / List + $0.40 / 1K](/scrapers/twitter-list-scraper/)
-   [Twitter Scraper Unlimited Single tweets, reply threads, X Articles and small queries; no minimum $0.016 / query + $0.40 / 1K](/scrapers/twitter-scraper-lite/)

## Questions people ask

### Can you download a single tweet's images?

Yes, use [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite) with the tweet URL in `startUrls`; Tweet Scraper V2 doesn't fetch single tweets.

### Can you scrape an account's whole media tab?

Yes, search `from:username filter:media` in date windows, as in [how to scrape tweets by date range](/blog/twitter-scraping/scrape-tweets-by-date/).

### Where do you start?

At [how to scrape Twitter data in 2026](/blog/twitter-scraping/how-to-scrape-twitter/) or the [apidojo Twitter Scraper](/scrapers/twitter-scraper/).

## More on scraping X data

-   [How to Scrape Twitter (X) Data in 2026 What Twitter data you can scrape, the 3 ways to collect it, which apidojo actor fits each task, prices, limits and Python code.](/blog/twitter-scraping/how-to-scrape-twitter/)
-   [How to Scrape Tweets by Keyword (2026 Guide) Scrape tweets by keyword with apidojo's Tweet Scraper V2: query rules, batching, Python code, costs and fixes for low results.](/blog/twitter-scraping/scrape-tweets-by-keyword/)
-   [How to Scrape Tweets by Date Range Scrape tweets between two dates by splitting periods into windows, running them in batches and removing duplicates, with Python code.](/blog/twitter-scraping/scrape-tweets-by-date/)
-   [How to Scrape Tweets From a User Profile Scrape any public profile's tweets with from:username, collect a full history in date windows, and compare two apidojo actors.](/blog/twitter-scraping/scrape-user-tweets/)
-   [How to Scrape Twitter Search Results Turn any X search into a JSON, CSV or Excel dataset with apidojo's Tweet Scraper V2, using search queries or search result URLs.](/blog/twitter-scraping/scrape-search-results/)
-   [How to Scrape a Twitter Thread and All Replies Scrape every reply in a thread with conversation\_id:, keep only the author's thread, filter replies and see what each thread costs.](/blog/twitter-scraping/scrape-thread-replies/)
-   [How to Export Tweets to CSV or JSON Export tweets to CSV, Excel, JSON or JSONL: your own archive, any search through a scraper, the columns you get and the API call.](/blog/twitter-scraping/export-tweets-csv-json/)
-   [How to Collect Tweets With Python (2026) A complete Python tweet collector: setup, first run, date parsing, date-window batching, deduplication and CSV export.](/blog/twitter-scraping/scrape-tweets-python/)
-   [How to Collect Tweets With JavaScript and Node.js A complete Node.js tweet collector: setup, first run, safe tweet IDs, date-window batching, deduplication and CSV export.](/blog/twitter-scraping/scrape-tweets-javascript/)
-   [Twitter Scraper Pagination: Cursors and Limits How pagination works in the X API and apidojo's actors, why searches stop early, and how to deduplicate and resume collections.](/blog/twitter-scraping/pagination/)
-   [How to rebuild an X conversation tree from replies Replies arrive as a flat list. Two fields, conversationId and inReplyToId, are what turn that list back into the threaded conversation you saw on X.](/blog/twitter-scraping/x-reply-tree/)
-   [When the X replies endpoint under-returns A thread that looks busy on X can come back thin from a scrape. Here is how to tell a quiet conversation from a short run, and what the second flow fixes.](/blog/twitter-scraping/x-replies-vs-search-flow/)
-   [Reading account age in X reply data Every reply carries the responder's account creation date, follower counts and post history. Here is what those fields can and cannot tell you.](/blog/twitter-scraping/x-replier-account-age/)

![apidojo](/blog/authors/apidojo.png)

## [Apidojo](/blog/authors/apidojo/)

15+ years of experience in data retrieval.

API Dojo is always ready for you. With 15+ years of experience, data acquisition has never been that easy. Cheapest prices with high availability.

-   🏯 15+ years of experience in data retrieval.
-   💰 Cheapest prices, qualified data.
-   ⚙️ High availability, extreme maintenance.
-   🐉 Hyper communicative, excellent support.

-   [apify.com](https://apify.com/apidojo)
-   [x.com](https://x.com/apidojo_)
-   [github.com](https://github.com/apidojo-io)
