便利なツール
Postman
コードサンプル
サードパーティライブラリ
主要な概念
認証
開発者コンソール、プロジェクト、開発者 App
レート制限
コードサンプル
リストを作成する
cURL
リストを更新する
cURL
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| エンドポイント | HTTP メソッド | レート制限 |
| /2/lists | POST | 15 分あたり 300 リクエスト |
| /2/lists/:id | DELETE / PUT | 15 分あたり 300 リクエスト |
curl -X POST "https://api.x.com/2/lists" \
-H "Authorization: OAuth ..." \
-H "Content-Type: application/json" \
-d '{"name": "My List", "description": "A list of interesting accounts"}'
from xdk import Client
from xdk.oauth1_auth import OAuth1
oauth1 = OAuth1(
api_key="YOUR_API_KEY",
api_secret="YOUR_API_SECRET",
access_token="YOUR_ACCESS_TOKEN",
access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
)
client = Client(auth=oauth1)
# 新しいリストを作成します
response = client.lists.create(
name="My List",
description="A list of interesting accounts"
)
print(response.data)
import { Client, OAuth1 } from "@xdevplatform/xdk";
const oauth1 = new OAuth1({
apiKey: "YOUR_API_KEY",
apiSecret: "YOUR_API_SECRET",
accessToken: "YOUR_ACCESS_TOKEN",
accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
});
const client = new Client({ oauth1 });
// 新しいリストを作成します
const response = await client.lists.create({
name: "My List",
description: "A list of interesting accounts",
});
console.log(response.data);
curl -X PUT "https://api.x.com/2/lists/123456789" \
-H "Authorization: OAuth ..." \
-H "Content-Type: application/json" \
-d '{"name": "Updated List Name"}'
from xdk import Client
from xdk.oauth1_auth import OAuth1
oauth1 = OAuth1(
api_key="YOUR_API_KEY",
api_secret="YOUR_API_SECRET",
access_token="YOUR_ACCESS_TOKEN",
access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
)
client = Client(auth=oauth1)
# リストを更新する
response = client.lists.update(
list_id="123456789",
name="Updated List Name"
)
print(response.data)
import { Client, OAuth1 } from "@xdevplatform/xdk";
const oauth1 = new OAuth1({
apiKey: "YOUR_API_KEY",
apiSecret: "YOUR_API_SECRET",
accessToken: "YOUR_ACCESS_TOKEN",
accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
});
const client = new Client({ oauth1 });
// リストを更新する
const response = await client.lists.update("123456789", {
name: "Updated List Name",
});
console.log(response.data);