Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

X / Twitter Community Search

Docs API
https://api.sandbase.ai/v1/api/twitter/search-communities

Search X (Twitter) communities by keyword and get their id, name, topic, and member count with cursor pagination. This is how you find a community URL to pass to twitter.community or twitter.community_tweets.

Prix
À partir de $0.0011USD / appel
Méthode
POST
Réponse
JSON
Paramètres
1 obligatoires · 1 facultatifs

Bac à sable

Entrée
Keyword to match against X (Twitter) community names and topics (e.g. artificial intelligence).
Opaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of communities.
SortiePrêt

Votre sortie apparaîtra ici

Complétez les entrées, puis cliquez sur Exécuter.

README de l'API

X / Twitter Community Search API

Returns a list of X (Twitter) communities that match a keyword. Each result has the community id, name, topic, member count, and URL. The only required input is query.

Use cases

  • Find communities about a topic such as artificial intelligence and rank them by member count.
  • Collect community URLs to feed into a community tweet or community info lookup.
  • Build a list of communities in a niche for outreach or research.
  • Filter out adult communities using the nsfw flag before showing results to users.

Request

curl -X POST "https://api.sandbase.ai/v1/api/twitter/search-communities" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "artificial intelligence"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
querystringYesKeyword to match against X (Twitter) community names and topics (e.g. artificial intelligence).
cursorstringNoOpaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of communities.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "communities": [
      {
        "id": "1724390935406981529",
        "memberCount": 17280,
        "name": "Artificial Intelligence + Tech",
        "nsfw": false,
        "topic": "Artificial Intelligence",
        "url": "https://x.com/i/communities/1724390935406981529"
      }
    ],
    "nextCursor": "cur_Hri4z2wlX1vEE2iyBu6uog"
  },
  "found": true
}

Response fields

FieldMeaning
data.communities[].idNumeric ID of the community, returned as a string. It is also the last part of the community URL.
data.communities[].nameDisplay name of the community. Several communities can share the same name.
data.communities[].topicTopic label of the community, such as Artificial Intelligence.
data.communities[].memberCountNumber of members in the community.
data.communities[].nsfwtrue if the community is marked as adult content, otherwise false.
data.communities[].urlFull link to the community on x.com.
data.nextCursorCursor value for the next page of results. Pass it as cursor in the next request.
foundtrue when the search returned results.

Notes

  • For the next page, repeat the same query and add cursor set to the data.nextCursor value from the previous response.
  • Use the id or url of a result with X (Twitter) Twitter Community or X (Twitter) Twitter Community Tweets.
  • Results are not sorted by memberCount, so sort them yourself if you need the largest communities first.

Pricing

Billed at the actual cost of each call, about $0.0011 for the request above. Failed calls are not charged.

Explorer plus

APIs associées

Toutes les APIs
APIPrixRéponse
X (Twitter)À partir de $0.0011 par appelJSON
X (Twitter)À partir de $0.00054 par appelJSON
TwitterÀ partir de $0.0006 par appelJSON asynchrone
X (Twitter)À partir de $0.0001 par appelJSON
X (Twitter)À partir de $0.0036 par appelJSON
X (Twitter)À partir de $0.00045 par appelJSON

Guides :X API alternative: pay per call, not per postBest Twitter API in 2026: X API Pricing Compared

Questions

FAQ

Comment utiliser l’API X / Twitter Community Search ?

Envoyez une requête POST à https://api.sandbase.ai/v1/api/twitter/search-communities avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.

Combien coûte l’API X / Twitter Community Search ?

À partir de $0.0011 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.

Quels paramètres l’API X / Twitter Community Search accepte-t-elle ?

Obligatoire : query (string). Facultatif : cursor (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.

Que renvoie l’API X / Twitter Community Search ?

Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.

Ai-je besoin d’un compte développeur ou d’une clé API X (Twitter) ?

Non. X / Twitter Community Search fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API X (Twitter) séparément.