X (Twitter) · JSON Structure

X Api Media Structure

Media schema from X API v2

Type: object Properties: 4 Required: 1
Social MediaMicrobloggingReal-Time DataStreamingAdvertisingContent

Media is a JSON Structure definition published by X (Twitter), describing 4 properties, of which 1 is required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

height media_key type width

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/twitter/refs/heads/main/json-structure/x-api-media-structure.json",
  "name": "Media",
  "description": "Media schema from X API v2",
  "type": "object",
  "properties": {
    "height": {
      "type": "int32",
      "description": "The height of the media in pixels.",
      "minimum": 0
    },
    "media_key": {
      "type": "string",
      "description": "The Media Key identifier for this attachment.",
      "pattern": "^([0-9]+)_([0-9]+)$"
    },
    "type": {
      "type": "string"
    },
    "width": {
      "type": "int32",
      "description": "The width of the media in pixels.",
      "minimum": 0
    }
  },
  "required": [
    "type"
  ]
}