> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Twitter API CSV, JSON & XLSX export formats

> Export tweets, followers, following, replies, profiles, and draw rows through JSON pages or CSV, JSON, XLSX, Markdown, PDF, and TXT files with checkpoints.

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

Choose the output shape before wiring a worker, dashboard, spreadsheet, or
archive. Xquik gives you live JSON pages for endpoint calls and saved JSON pages
for extraction jobs. It also gives you file exports for downstream tools and draw
exports for giveaway audits.

This guide covers Xquik API result files. It does not download tweet images or
videos. It also does not export your private X account archive.

Read [Read Data Richness](/guides/tweet-profile-api-fields) before choosing columns
downstream. It lists every optional tweet, profile, and media field.
The export endpoint selects a file format. Filter or select columns downstream.

## Choose the output shape

<CardGroup cols={2}>
  <Card title="Live JSON page" icon="radio">
    Use endpoints such as `GET /api/v1/x/tweets/search`,
    `GET /api/v1/x/users/{id}/tweets`, and
    `GET /api/v1/x/users/{id}/followers` when your app needs fresh API results
    and endpoint-specific cursors.
  </Card>

  <Card title="Saved JSON rows" icon="rows-3">
    Use `GET /api/v1/extractions/{id}?limit=1000&cursor={nextCursor}` when a
    saved extraction job holds the data. The response includes `job`,
    `results`, `hasMore`, and optional `nextCursor`.
  </Card>

  <Card title="File export" icon="download">
    Use `GET /api/v1/extractions/{id}/export?format=csv` when a downstream
    tool needs a downloaded file. Supported formats are `csv`, `json`, `xlsx`,
    `md`, `md-document`, `pdf`, and `txt`.
  </Card>

  <Card title="Draw export" icon="trophy">
    Use `GET /api/v1/draws/{id}/export?format=csv&type=winners` when you need
    giveaway winners or entry rows. Set `type` to `winners` or `entries`.
  </Card>
</CardGroup>

## Output decision map

<CardGroup cols={2}>
  <Card title="App UI" icon="monitor">
    Call the live JSON endpoint and store the endpoint cursor with the filters
    that produced the page.
  </Card>

  <Card title="Worker or queue" icon="route">
    Read saved extraction pages, append JSON Lines, and resume with `cursor`
    when `hasMore` is true.
  </Card>

  <Card title="CRM or spreadsheet" icon="table">
    Download CSV for simple imports, or XLSX when analysts need a workbook.
  </Card>

  <Card title="Archive or report" icon="archive">
    Download JSON for replay, Markdown or TXT for text archives, and PDF for a
    shareable report file.
  </Card>
</CardGroup>

## Match the format to the handoff

Choose a format from the next consumer's exact requirements. Do not convert a
file twice when Xquik already returns the required format.

Use a live JSON page when code needs fresh tweets, followers, following rows,
replies, profiles, or media fields. Keep the documented endpoint cursor with
the same request filters.

Use saved extraction JSON pages when a worker needs incremental processing.
Append each completed page to JSON Lines through an idempotent sink. Use the
extraction ID and requested `cursor` value as the page key. Store the page and
its `nextCursor` in one atomic commit. A retry must replace or skip an existing
page key instead of appending duplicate tweets, followers, or replies.

Use a JSON file when an application needs one structured download. The export
contains the documented columns for that extraction tool. Store the extraction
ID, tool type, and selected filters beside the file.

Use CSV for CRM or spreadsheet imports. CSV exports include one header row.
They also neutralize spreadsheet formula prefixes in result cells.

Use XLSX when analysts need an Excel workbook. Use Markdown, PDF, or TXT when
people need a readable review file instead of an import file.

## Pagination and cursor map

Direct X API pages expose endpoint-specific cursor fields such as
`has_next_page` and `next_cursor`. Keep the same query filters between requests
and only change the cursor parameter documented on that endpoint.

Extraction result pages use `hasMore` and `nextCursor`. Pass `nextCursor` back
as `cursor`. Use `limit` up to `1000`. The default is `100`.

File exports do not paginate. Xquik caps file exports at 100,000 rows and PDF
exports at 10,000 rows. Use extraction JSON pages or JSON Lines when
you need to process larger jobs incrementally.

For larger extractions, page results through
`GET /api/v1/extractions/{id}`. Keep `cursor`, `hasMore`, and `nextCursor` in one
checkpoint. Never continue from the downloaded file's last visible value.

The file endpoint returns the first 100,000 rows ordered by result ID. PDF
returns the first 10,000 rows. A successful file response does not prove the
extraction contains no additional rows.

## Format map

<CardGroup cols={2}>
  <Card title="CSV" icon="table">
    Use it for spreadsheet imports and CRM uploads. The response content type is
    `text/csv; charset=utf-8`.
  </Card>

  <Card title="JSON file" icon="braces">
    Use it for replay, durable archives, and application handoffs. The file is a
    JSON array containing the extraction tool's documented columns. The
    response content type is `application/json; charset=utf-8`.
  </Card>

  <Card title="XLSX" icon="file-spreadsheet">
    Use it for analysts who need a workbook. The response content type is
    `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`.
  </Card>

  <Card title="Markdown" icon="file-text">
    Use it for docs and text review. `md` returns a Markdown table.
    `md-document` returns numbered sections with labeled fields. Both return
    `text/markdown; charset=utf-8`.
  </Card>

  <Card title="PDF" icon="file-down">
    Use it for a shareable report snapshot. The response content type is
    `application/pdf`.
  </Card>

  <Card title="TXT" icon="file">
    Use it for plain text archives. The response content type is
    `text/plain; charset=utf-8`.
  </Card>
</CardGroup>

## Download and validate an export

Use the server filename from `Content-Disposition`. `curl` can apply that
filename without parsing the header yourself.

```bash theme={null}
curl --fail --location --remote-header-name --remote-name \
  "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv" \
  -H "x-api-key: xq_YOUR_KEY_HERE"
```

Validate these properties before handing the file to another system:

1. Require HTTP `200`.
2. Match `Content-Type` to the requested format.
3. Store the `Content-Disposition` filename.
4. Reject an unexpectedly empty file.
5. Parse the selected format before marking the handoff complete.
6. Record the parsed row count and extraction ID.
7. Calculate a local checksum when an audit requires one.

Do not assume a filename proves the format. Verify the response header and
parser result. Never print CSV, JSON, XLSX, PDF, or TXT bytes to shared logs.

## Handoff checkpoint

Store enough context to resume a job, verify filters, and download the right
format later.

```json theme={null}
{
  "source": "xquik.response_formats",
  "extraction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "detail_path": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890?limit=1000",
  "export_paths": {
    "csv": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv",
    "json": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=json",
    "xlsx": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=xlsx"
  },
  "pagination": {
    "limit": 1000,
    "after": "990200",
    "hasMore": true,
    "nextCursor": "991200"
  },
  "download": {
    "requested_format": "csv",
    "expected_content_type": "text/csv; charset=utf-8",
    "server_filename": "extraction-follower_explorer-2026-08-02.csv",
    "parsed_rows": 5000,
    "local_sha256": "calculated-after-download"
  },
  "draw_export_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=winners",
  "next_action": "poll_until_completed_then_download"
}
```

Your workflow calculates `local_sha256` after download. Xquik does not
return that field in the export response.

## Handle export failures

* `400 invalid_format`: Use one of the 7 documented format values.
* `401 unauthenticated`: Replace the missing or invalid credential.
* `404 not_found`: Verify the extraction or draw ID belongs to the account.
* `429 rate_limit_exceeded`: Wait for `Retry-After` before downloading again.

For draw exports, also validate `type=winners` or `type=entries`. Do not retry
an unchanged `400`, `401`, or `404` request. Retry `429` after the documented
delay.

## Twitter API export questions

### How do I export Twitter API results to CSV?

Run an extraction for tweets, followers, following rows, replies, or profiles.
After completion, request its export endpoint with `format=csv`.

### Can I export tweets as JSON?

Yes. Use live JSON pages for incremental processing. Use `format=json` for one
saved extraction file within the 100,000-row cap.

### Should I use CSV or JSON for Twitter results?

Use CSV for CRM and spreadsheet imports. Use JSON for applications, replay,
and structured result fields. Choose before building the downstream parser.

### When should I use XLSX instead of CSV?

Use XLSX when analysts need an Excel workbook. Use CSV when another system
expects a simple delimited import.

### Can I export more than 100,000 rows?

Process larger extraction jobs through saved JSON pages. Append JSON Lines and
resume with `cursor`. One file export stops at 100,000 rows.

### Why does PDF stop at 10,000 rows?

PDF uses the documented 10,000-row cap. Choose CSV, JSON, XLSX, Markdown, or
TXT for file exports up to 100,000 rows.

### What is the difference between `md` and `md-document`?

`md` returns a Markdown table. `md-document` returns numbered result sections
with labeled fields. Both use the Markdown response content type.

### Does this download Twitter images or videos?

No. This guide exports documented result fields. Use returned media URLs when
your workflow separately processes tweet images or videos.

### Does this export my private X account archive?

No. These endpoints export Xquik extraction or draw results. Use X's account
archive process for your private account archive.

## Safety checklist

<Check>
  Do not print downloaded export bytes to shared logs.
</Check>

<Check>
  Store the `Content-Disposition` filename if your workflow needs stable file
  names.
</Check>

Validate `format` before making the request. Invalid formats return a 400
error.

Store the job ID, tool type, filters, cursor, and chosen export path with the
downstream task.

## Next steps

<CardGroup cols={2}>
  <Card title="Extraction workflow" icon="workflow" href="/guides/extraction-workflow">
    Build saved extraction jobs, poll results, and export finished rows.
  </Card>

  <Card title="Export extraction" icon="download" href="/api-reference/extractions/export">
    Download saved extraction rows as CSV, JSON, XLSX, Markdown, PDF, or TXT.
  </Card>

  <Card title="Export draw" icon="trophy" href="/api-reference/draws/export">
    Download giveaway winners or entries.
  </Card>

  <Card title="Follower export CRM" icon="users" href="/guides/follower-export-crm">
    Move follower data into CSV and CRM workflows.
  </Card>
</CardGroup>

<div className="related-api-links">
  <Accordion title="Related tweet, reply & media APIs" icon="link">
    * Tweets: [Get tweet](/api-reference/x/get-tweet) · [Batch tweets](/api-reference/x/batch-tweets) · [Tweet thread](/api-reference/x/tweet-thread) · [Hidden replies](/api-reference/x/tweet-hidden-replies) · [Translate tweet](/api-reference/x/tweet-translation) · [Embed tweet](/api-reference/x/tweet-embed) · [Resolve links](/api-reference/x/resolve-links) · [Tweet subtitles](/api-reference/x/tweet-subtitles) · [X Article](/api-reference/x/get-article)
    * Analysis: [Sentiment analysis](/api-reference/x/sentiment-analysis) · [Brand mentions](/api-reference/x/brand-monitoring) · [News classification](/api-reference/x/news-classification) · [Market signals](/api-reference/x/market-signals) · [Viral score](/api-reference/x/viral-score) · [Classify posts](/api-reference/x/classify-tweets)
    * Engagement: [Tweet replies](/api-reference/x/tweet-replies) · [Quote tweets](/api-reference/x/tweet-quotes) · [Likers](/api-reference/x/favoriters) · [Reposters](/api-reference/x/retweeters) · [Check repost](/api-reference/x/tweet-repost-check)
    * Profiles: [User tweets](/api-reference/x/user-tweets) · [Batch user tweets](/api-reference/x/batch-user-tweets) · [User replies](/api-reference/x/user-replies) · [User likes](/api-reference/x/user-likes) · [User media](/api-reference/x/user-media) · [User highlights](/api-reference/x/user-highlights) · [User articles](/api-reference/x/user-articles)
    * Feeds: [List tweets](/api-reference/x/list-tweets) · [Trends](/api-reference/x/trends) · [Trend locations](/api-reference/x/trend-locations) · [Search Spaces](/api-reference/x/search-spaces) · [Get Space](/api-reference/x/get-space) · [Space replay](/api-reference/x/space-replay) · [Get broadcast](/api-reference/x/get-broadcast) · [Hashflags](/api-reference/x/hashflags) · [Search places](/api-reference/x/search-places) · [Download media](/api-reference/x/download-media)
  </Accordion>
</div>

<div className="related-api-links">
  <Accordion title="Related timeline, bookmark & notification APIs" icon="link">
    * Account feeds: [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions)
    * Saved and private: [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history)
  </Accordion>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.