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.
APIリファレンスに戻る
/Tweet Actions Endpoints
POST
/twitter/tweets/createAPI 認証
AuthorizationBearer token · header必須TwexAPIのグローバル認証トークン (Bearer Token)。ヘッダーに含める必要があります:Authorization: Bearer <YOUR_TWEXAPI_KEY>。
リクエストボディ
必須application/jsonmedia_urlstring | any添付するメディアファイルの公開URL
プロパティを表示プロパティを非表示
Any of:
string
stringany
anymedia_urlsstring[] | any添付する画像または動画の公開URL一覧(最大4枚の画像または1本の動画)
プロパティを表示プロパティを非表示
Any of:
string[]
Array of
stringstringany
anytweet_contentstring必須ツイートまたは返信の本文
delegated_account_usernamestring | anydelegated account username
プロパティを表示プロパティを非表示
Any of:
string
stringany
anyschedulestring | anySchedule time for the tweet in ISO format
プロパティを表示プロパティを非表示
Any of:
string
stringany
anyreply_tweet_idstring | any返信先のツイートID
プロパティを表示プロパティを非表示
Any of:
string
stringany
anycookiestring必須ユーザー自身が承認した Twitter セッション資格情報または auth_token(BYOC — Bring Your Own Cookie)。機密情報は保存されず、完全なステートレスプロキシとして実行されます。詳細は [認証・セキュリティガイド](/ja/authentication#write-operations--byoc-bring-your-own-cookie) および [Cookie 取得手順](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie) を参照。
community_namestring | anyName of Twitter community to post in or community id
プロパティを表示プロパティを非表示
Any of:
string
stringany
anyproxystring | anyThe 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
プロパティを表示プロパティを非表示
Any of:
string
stringany
anyレスポンス
200The ID and user ID of the newly created tweet.
codeintegerHTTP ステータスコード(200 は成功)
default: 200
msgstringレスポンスメッセージ(例: 'success')
default: "success"
dataPostTweetData | any返却されるコアデータオブジェクトまたは配列
プロパティを表示プロパティを非表示
Any of:
PostTweetData
tweet_idstring | anyツイートの一意のID
プロパティを表示プロパティを非表示
Any of:
string
stringany
anyuser_idstring | any対象ユーザーのTwitter数字ID
プロパティを表示プロパティを非表示
Any of:
string
stringany
anycodeintegerHTTP ステータスコード(200 は成功)
default: 200
any
any422パラメータバリデーションエラー
detailValidationError[]プロパティを表示プロパティを非表示
Array of
ValidationErrorlocstring | integer[]必須プロパティを表示プロパティを非表示
Array of
string | integerAny of:
string
stringinteger
integermsgstring必須レスポンスメッセージ(例: 'success')
typestring必須inputanyctxobject⚡インタラクティブテストPOST
⚡インタラクティブテスト / Try APIPOSTLive Console
🌐対象サーバー:
https://api.twexapi.io● 本番環境レディ
✍️
書き込み操作の認証情報ガイド(TwexAPIキー + Twitter Cookie)
1. TwexAPIプラットフォームキー (Bearer Token): 下記の「API認証」に入力してください(API呼び出しと課金認証に使用)。
2. TwitterアカウントCookie: ツイート・いいね・フォロー等の書き込み操作のため、下記リクエストボディの cookie フィールドに対象TwitterアカウントのCookie(例: auth_token=...; ct0=...)を入力してください。
🔑API 認証
📝リクエストボディapplication/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
リクエスト例
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"
}'const response = await fetch("https://api.twexapi.io/twitter/tweets/create", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"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"
})
});import requests
response = requests.post(
"https://api.twexapi.io/twitter/tweets/create",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"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"
},
)レスポンス例
{
"code": 200,
"msg": "success",
"data": {
"tweet_id": "1234567890123456789",
"user_id": "1234567890",
"code": 200
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}