X

X Media API

Endpoints related to retrieving and uploading Media — 11 operation(s) in the X-published contract.

Operations 11

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /2/media Look up several media items by key · Get Media by media keys #
Ask an LLM
“Can I get details for a batch of media keys in one call?”
“What type, size and URL info comes back for multiple media keys?”
Tell an agent
Get media details for keys {media_keys}.
Look up these media items together: {media_keys}.
GET /2/media/analytics Get analytics for media items · Get Media analytics #
Ask an LLM
“How are my uploaded videos performing over a date range?”
“Can I get media analytics broken down by hour or day?”
Tell an agent
Show analytics for media {media_keys} from {start_time} to {end_time}.
Get {granularity} media analytics for {media_keys} between {start_time} and {end_time}.
POST /2/media/metadata Add metadata to uploaded media · Create Media metadata #
Ask an LLM
“Can I attach extra metadata to an image after uploading it?”
“What call sets metadata on an existing media ID?”
Tell an agent
Add metadata {metadata} to media {id}.
Attach metadata to uploaded media {id}.
DELETE /2/media/subtitles Remove subtitles from a video · Delete Media subtitles #
Ask an LLM
“How do I delete a subtitle track in a particular language from a video?”
“Can I remove captions I previously added to media?”
Tell an agent destructive · confirm first
Delete the {language_code} subtitles from {media_category} media {id}.
Remove {language_code} captions on video {id} ({media_category}).
POST /2/media/subtitles Add subtitles to a video · Create Media subtitles #
Ask an LLM
“Can I attach subtitle files to a video I uploaded?”
“What's needed to add captions to a video's media ID?”
Tell an agent
Add subtitles {subtitles} to video {id}.
Attach captions {subtitles} to {media_category} media {id}.
GET /2/media/upload Check a media upload's processing status · Get Media upload status #
Ask an LLM
“Is my uploaded video still processing or ready to post?”
“How can I poll the status of a chunked media upload?”
Tell an agent
Check the upload status of media {media_id}.
Poll processing progress for upload {media_id}.
POST /2/media/upload Upload a media file in one request · Upload a media file and get back its identifiers, including a media_key. #
Ask an LLM
“What's the simplest way to upload an image for a post in a single request?”
“Can I share an uploaded media file with other user accounts?”
Tell an agent
Upload {media} as {media_category} and give me its media key.
Upload {media} as {media_category} and also grant access to {additional_owners}.
POST /2/media/upload/initialize Start a chunked media upload · Initialize media upload #
Ask an LLM
“Where does a chunked upload for a large video begin?”
“What size and type details go into initializing a media upload?”
Tell an agent
Initialize a chunked upload of {total_bytes} bytes of type {media_type}.
Start a {media_category} chunked upload for a {total_bytes}-byte file.
POST /2/media/upload/{id}/append Append a chunk to a media upload · Append Media Upload #
Ask an LLM
“Which segment index goes with each chunk of a media upload?”
“Can I send a large video to an upload session in pieces?”
Tell an agent
Append chunk {segment_index} ({media}) to media upload {id}.
Send segment {segment_index} of the file {media} into upload session {id}.
POST /2/media/upload/{id}/finalize Finalize a chunked media upload · Finalize Media upload #
Ask an LLM
“What do I call after all chunks of a media upload are sent?”
“Does finalizing an upload make the media usable in posts?”
Tell an agent
Finalize media upload {id}.
Complete the chunked upload session {id}.
GET /2/media/{media_key} Get one media item by key · Get Media by media key #
Ask an LLM
“Can I look up a single media item from its media key?”
“Which fields can I request for one piece of media?”
Tell an agent
Get media {media_key}.
Show media item {media_key} with fields {fields}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/x:x-media-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

x-media-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: X API v2 core endpoints
  version: '2.168'
  title: X API v2 Media API
  termsOfService: https://developer.x.com/en/developer-terms/agreement-and-policy.html
  contact:
    name: X Developers
    url: https://developer.x.com/
  license:
    name: X Developer Agreement and Policy
    url: https://developer.x.com/en/developer-terms/agreement-and-policy.html
servers:
- description: X API
  url: https://api.x.com
tags:


# --- truncated at 32 KB (49 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/x/refs/heads/main/openapi/x-media-api-openapi.yml