Herramientas útiles
Postman
Ejemplos de código
Bibliotecas de terceros
Conceptos clave
Autenticación
Consola de desarrollador, Projects y Apps de desarrollador
Límites de tasa
Ejemplos de código
Crear una lista
cURL
Actualizar una lista
cURL
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| Endpoint | Método HTTP | Límite de tasa |
| /2/lists | POST | 300 solicitudes cada 15 minutos |
| /2/lists/:id | DELETE / PUT | 300 solicitudes cada 15 minutos |
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)
# Crear una nueva lista
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 });
// Crear una nueva lista
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": "Nombre de lista actualizado"}'
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)
# Actualizar una lista
response = client.lists.update(
list_id="123456789",
name="Nombre de lista actualizado"
)
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 });
// Actualizar una lista
const response = await client.lists.update("123456789", {
name: "Nombre de lista actualizado",
});
console.log(response.data);