---
title: "Download images and videos from tweets"
method: POST
path: "/x/media/download"
tags: ["Media"]
---

# Download images and videos from tweets

`POST /x/media/download`

## Request body

- object
  - `tweetInput` string — Tweet URL or ID (single tweet)
  - `tweetId` string — Numeric tweet ID alias for tweetInput
  - `tweetUrl` string — Tweet URL alias for tweetInput
  - `tweetIds` string[] — Array of tweet URLs or IDs (bulk, max 50 string items)

## Response `200`

Media download result. Single: tweetId + galleryUrl + cacheHit. Bulk: galleryUrl + totalTweets + totalMedia.

- object
  - `tweetId` string
  - `galleryUrl` string
  - `cacheHit` boolean
  - `totalTweets` integer
  - `totalMedia` integer

## Other responses

- `400` — Invalid input
- `401` — Unauthenticated
- `402` — Payment required. Fixed-price direct MPP requests return a Machine Payments Protocol problem document and a WWW-Authenticate challenge. Authenticated X data requests return balances and explicit Stripe checkout-creation actions. Guest paid-read keys receive only the accountless guest top-up action. Direct MPP challenges also advertise the Stripe wallet action. Other authenticated endpoints return a legacy error shape. A failed request never creates checkout. Create checkout only after the user confirms a payment option.
- `404` — Tweet media source not found
- `424` — Dependency unavailable, unauthorized, or rate limited. Default v1 returns 502. The best-practice response contract returns 424 for transparent dependency failures.
- `429` — Xquik tier rate limit exceeded. The response includes a `Retry-After` header with the number of seconds to wait before retrying.
- `502` — Dependency unavailable, unauthorized, or rate limited. Default v1 returns 502. The best-practice response contract returns 424 for transparent dependency failures.

---

[API](https://skmtc.net/xquik-dev/apis/xquik-api-3.md) · [All operations](https://skmtc.net/xquik-dev/apis/xquik-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xquik-dev/xquik-api-3/versions/4839804dc9da/schema)
