Saltar al contenido
Twexapi
Español
Esc
navegarabrir⌘Jvista previa

Create a Tweet or Reply

Posts a new tweet. To create a reply, provide the reply_tweet_id. This endpoint does not handle quote tweets,$0.0005 per call.

Volver a la referencia de API
/Tweet Actions Endpoints
POST/twitter/tweets/create
Autorización de API
AuthorizationBearer token · headerrequerido
Token Bearer global para TwexAPI. Incluido como: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Cuerpo de la solicitud
requeridoapplication/json
media_urlstring | any
Single media URL: image, GIF, or video. Prefer media_urls for multiple images.
Mostrar propiedades
Any of:
string
string
any
any
media_urlsstring[] | any
URLs públicas de imágenes o vídeos adjuntos (máximo 4 fotos o 1 vídeo)
Mostrar propiedades
Any of:
string[]
Array of string
string
any
any
tweet_contentstringrequerido
Contenido del tweet o respuesta
delegated_account_usernamestring | any
delegated account username
Mostrar propiedades
Any of:
string
string
any
any
schedulestring | any
Schedule time for the tweet in ISO format
Mostrar propiedades
Any of:
string
string
any
any
reply_tweet_idstring | any
ID del tweet al que responder
Mostrar propiedades
Any of:
string
string
any
any
cookiestringrequerido
Credenciales de sesión o auth_token autorizadas del propio usuario (BYOC — Bring Your Own Cookie). Ejecución mediante proxy sin estado y con cero retención de credenciales. Consulta [Seguridad y Autenticación](/es/authentication#write-operations--byoc-bring-your-own-cookie) y [Cómo obtener la Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
community_namestring | any
Name of Twitter community to post in or community id
Mostrar propiedades
Any of:
string
string
any
any
proxystring | any
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://app.proxy-cheap.com/r/qiMxub
Mostrar propiedades
Any of:
string
string
any
any
Respuestas
200The ID and user ID of the newly created tweet.
codeinteger
Código de estado HTTP (200 indica éxito)
default: 200
msgstring
Mensaje de respuesta (ej. 'success')
default: "success"
dataPostTweetData | any
Carga de datos devuelta por el endpoint
Mostrar propiedades
Any of:
PostTweetData
tweet_idstring | any
ID numérico único del tweet
Mostrar propiedades
Any of:
string
string
any
any
user_idstring | any
ID numérico del usuario de Twitter
Mostrar propiedades
Any of:
string
string
any
any
codeinteger
Código de estado HTTP (200 indica éxito)
default: 200
any
any
422Error de validación de parámetros
detailValidationError[]
Mostrar propiedades
Array of ValidationError
locstring | integer[]requerido
Mostrar propiedades
Array of string | integer
Any of:
string
string
integer
integer
msgstringrequerido
Mensaje de respuesta (ej. 'success')
typestringrequerido
inputany
ctxobject
Consola interactivaPOST
Consola interactiva / Probar APIPOST
Live Console
🌐Servidor objetivo:https://api.twexapi.io
● Producción lista
✍️
Guía de credenciales de escritura (Clave TwexAPI + Cookie de Twitter)

1. Clave de TwexAPI (Bearer Token): Ingrésela en "Autorización API" abajo para facturación y autenticación.

2. Cookie de cuenta Twitter: Para operaciones de escritura (tuitear, dar me gusta, seguir), ingrese la Cookie (ej. auth_token=...; ct0=...) en el campo cookie abajo.

🔑Autorización API
📝Cuerpo de la solicitudapplication/json
📡
暂无响应数据

请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。

Solicitud
curl -X POST "https://api.twexapi.io/twitter/tweets/create" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "media_url": "https://example.com/image.jpg",
  "media_urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "tweet_content": "Hello, Twitter! 🐦",
  "delegated_account_username": "elonmusk",
  "schedule": "2024-01-01T12:00:00Z",
  "reply_tweet_id": "1234567890123456789",
  "cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
  "community_name": "Python Developers or 1234567890123456789",
  "proxy": "http://username:password@ip:port"
}'
Respuesta
{
  "code": 200,
  "msg": "success",
  "data": {
    "tweet_id": "1234567890123456789",
    "user_id": "1234567890",
    "code": 200
  }
}