Skip to main content
GET
/
2
/
media
Obtener medios por claves de medios
curl --request GET \
  --url https://api.x.com/2/media \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "type": "<string>",
      "preview_image_url": "<string>",
      "variants": [
        {
          "bit_rate": 123,
          "content_type": "<string>",
          "url": "<string>"
        }
      ],
      "height": 1,
      "media_key": "<string>",
      "width": 1
    }
  ],
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

media_keys
string[]
required

Una lista de claves de medios separadas por comas. Se permiten hasta 100 en una sola solicitud.

Required array length: 1 - 100 elements

El identificador Media Key para este archivo adjunto.

Pattern: ^([0-9]+)_([0-9]+)$
media.fields
enum<string>[]

Una lista de campos de Media, separados por comas, que se mostrarán. Los campos disponibles para un objeto Media.

Minimum array length: 1
Available options:
alt_text,
duration_ms,
height,
media_key,
non_public_metrics,
organic_metrics,
preview_image_url,
promoted_metrics,
public_metrics,
type,
url,
variants,
width
Example:
[
"alt_text",
"duration_ms",
"height",
"media_key",
"non_public_metrics",
"organic_metrics",
"preview_image_url",
"promoted_metrics",
"public_metrics",
"type",
"url",
"variants",
"width"
]

Response

La solicitud se ha completado correctamente.

data
object[]
Minimum array length: 1
errors
object[]
Minimum array length: 1

Un objeto HTTP Problem Details, tal como se define en el IETF RFC 7807 (https://tools.ietf.org/html/rfc7807).