Skip to main content
POST
/
twitter
/
upload_media_v2
cURL
curl --request POST \
  --url https://api.twitterapi.io/twitter/upload_media_v2 \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form 'proxy=<string>' \
  --form 'login_cookies=<string>' \
  --form is_long_video=true \
  --form file=@example-file
{
  "media_id": "<string>",
  "status": "<string>",
  "msg": "<string>"
}

Authorizations

X-API-Key
string
header
required

Body

multipart/form-data
file
file
required

The media file to upload (image, video, etc.)

proxy
string
required

The proxy to use.Please use high-quality residential proxies and avoid free proxies. Required. Example: http://username:password@ip:port . You can get proxy from: https://www.webshare.io/?referral_code=4e0q1n00a504

login_cookies
string
required

The login cookies of the user. You can get the login_cookie from /twitter/user_login_v2. Optional for media upload, required for posting tweets

is_long_video
boolean

If this is True, videos longer than 2:20 can be uploaded.(Twitter Premium only)

Response

Upload media response

media_id
string

The id of the uploaded media.

status
string

Status of the request.success or error

msg
string

Message of the request.error message