Outils utiles
Postman
Exemples de code
Bibliothèques tierces
Concepts clés
Authentification
Console de développement, Projects et Apps développeur
Limites de taux
Exemples de code
Créer une liste
cURL
Mettre à jour une Liste
cURL
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| Endpoint | Méthode HTTP | Limite de taux |
| /2/lists | POST | 300 requêtes par tranche de 15 minutes |
| /2/lists/:id | DELETE / PUT | 300 requêtes par tranche de 15 minutes |
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)
# Créer une nouvelle liste
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 });
// Créer une nouvelle liste
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)
# Mettre à jour une Liste
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 });
// Mettre à jour une Liste
const response = await client.lists.update("123456789", {
name: "Updated List Name",
});
console.log(response.data);