GET /2/users/by/username/{username}/media

Auth X-Hub-Key from API_HUB_KEYExecute GET /run/x_unified_api/2/users/by/username/{username}/mediaCache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing free

Read media posts of an X profile

Parameters

nameintypedescription
cursorquerystroptional
example:
expansionsquerystroptional
example: author_id
max_resultsqueryintoptional
default: 20
example: 20
tweet_fieldsquerystroptional
example: created_at,author_username,url
user_fieldsquerystroptional
example: name,username
usernamepathstrrequired
example: jack

Response

type: object
pagination: cursor
sample: {
  "data": "array[3]",
  "includes": "null",
  "meta": "object"
}

Safe request

Reads the credential from API_HUB_KEY; it never appears in the URL.

curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/x_unified_api/2/users/by/username/jack/media?cursor=&expansions=author_id&max_results=20&tweet_fields=created_at%2Cauthor_username%2Curl&user_fields=name%2Cusername"