# How to Export Tweets to CSV or JSON

To export tweets to CSV or JSON, collect them with a scraper such as apidojo's Tweet Scraper V2 on Apify, then download the run's dataset in the format you need: JSON, CSV, Excel, XML, HTML or RSS.

[![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 Export Tweets to CSV or JSON'](/blog/covers/export-tweets-csv-json.png)

**To export tweets to CSV or JSON, collect them with a scraper such as apidojo’s [Tweet Scraper V2](https://apify.com/apidojo/tweet-scraper) on Apify, then download the run’s dataset in the format you need: JSON, CSV, Excel, XML, HTML or RSS.** X has no export button for search results or other people’s posts. For your own posts, your X archive downloads them as HTML and JSON files.

This guide covers both routes, each export format, and the API call that downloads a dataset in any format. Collecting the tweets in the first place is covered in [how to scrape Twitter data in 2026](/blog/twitter-scraping/how-to-scrape-twitter/).

## How Do You Export Your Own Tweets?

**You export your own tweets by requesting your X archive, a download of HTML and JSON files with your profile, posts, media and followers.** On the web, go to More, Settings and privacy, Your account, then **Download an archive of your data**, and confirm your password ([X Help Center](https://help.x.com/en/managing-your-account/accessing-your-x-data)). The archive arrives as a zip file by email. Searching it is covered in [how to search your own tweets](/blog/twitter-search/search-your-own-tweets/).

## How Do You Export Any Tweets to CSV?

**You export any public tweets to CSV by running an X search query through Tweet Scraper V2 and downloading the dataset as CSV.** Listed below are the 4 steps.

1.  **Build** your search on X, then paste the query into the actor’s `searchTerms` input.
2.  **Run** the actor.
3.  **Open** the run’s **Storage** tab.
4.  **Choose** CSV (or another format) and click **Download**.

Apify datasets export as JSON, CSV, XML, Excel, HTML Table, RSS or JSONL ([Apify docs](https://docs.apify.com/storage/dataset)).

## Which Export Format Should You Use?

**Use CSV or Excel for spreadsheets, and JSON or JSONL for code and databases.** The table compares the formats.

| Format | Best for | Note |
| --- | --- | --- |
| CSV | Google Sheets, Excel, BI tools | Nested fields such as author become separate columns |
| Excel (xlsx) | Sharing with non-technical teams | Same columns as CSV |
| JSON | Code, APIs, keeping nested structure | One array of post objects |
| JSONL | Large datasets, streaming, databases | One post per line |
| XML, HTML, RSS | Legacy systems, quick viewing, feeds | Rarely needed for tweets |

CSV, Excel and HTML exports are limited to 2,000 columns, with column names up to 200 characters; JSON, XML and RSS have no such limit (Apify API docs).

## What Columns Does a Tweet Export Contain?

**A tweet export contains one row per post with its ID, URL, text, date, language, engagement counts and author details.** The fields below come from Tweet Scraper V2’s output example (Apify).

| Column | Example |
| --- | --- |
| id | 1728108619189874825 |
| url | https://x.com/elonmusk/status/1728108619189874825 |
| text | The post text |
| createdAt | Fri Nov 24 17:49:36 +0000 2023 |
| lang | en |
| likeCount, retweetCount, replyCount, quoteCount, bookmarkCount | Engagement counts |
| isReply, isRetweet, isQuote | Post type flags |
| author fields | userName, name, followers, following, isVerified |

## How Do You Download a Dataset Through the API?

**Call the Apify dataset items endpoint with a `format` parameter: `json`, `jsonl`, `xml`, `html`, `csv`, `xlsx` or `rss`.**

```
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=csv&token=$APIFY_TOKEN" -o tweets.csv
```

In Python, write JSON Lines straight from the client:

```
import json
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
with open("tweets.jsonl", "w", encoding="utf-8") as f:
    for item in client.dataset("DATASET_ID").iterate_items():
        f.write(json.dumps(item, ensure_ascii=False) + "\n")
```

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

## How Long Is an Exported Dataset Kept?

**Unnamed Apify datasets expire after 7 days, while named datasets are kept indefinitely, so download or name a dataset you want to keep.** Rename a dataset from its Actions menu in Apify Console (Apify docs).

## 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/)

## Questions people ask

### Can you export Twitter search results directly from X?

No, X search has no export; run the same query through a scraper, as shown in [how to scrape Twitter search results](/blog/twitter-scraping/scrape-search-results/).

### Can you export someone else's tweets to Excel?

Yes, run `from:username` through Tweet Scraper V2 and download the dataset as Excel.

### Why does Excel show tweet IDs wrongly?

Spreadsheets round long numbers; import the `id` column as text to keep all 19 digits.

### Where do you start?

At 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 Scrape Images and Videos From Tweets Collect tweets with media, find the media URLs in the output, download images with Python and pick the best video file.](/blog/twitter-scraping/scrape-twitter-media/)
-   [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)
