X / Twitter API

X / Twitter Search communities API

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.

POST/v1/run/twitter.search_communities
Requests
-
30d

Try it

Make your first request

Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.
{
  "data": {
    "communities": [
      {
        "id": "a1b2c3d4",
        "memberCount": 12500,
        "name": "Example title",
        "nsfw": true,
        "topic": "example",
        "url": "https://example.com/page"
      }
    ],
    "nextCursor": "example"
  },
  "found": true
}
Response interface
interface TwitterSearchCommunitiesResponse {
  data: {
    communities: {
      id: string;
      memberCount: number;
      name: string;
      nsfw: boolean;
      topic: string;
      url: string;
    }[];
    nextCursor: string | null;
  } | null;
  found: boolean;
}

Full parameter and response reference - every field, type, and example for this endpoint.

Reference

Request, response, and price

Last verified 2026-09-16 · uptime and latency measured over 30d
POST /v1/run/twitter.search_communities
curl -X POST https://api.getanyapi.com/v1/run/twitter.search_communities \
  -H "Authorization: Bearer $ANYAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"artificial intelligence"}'
FieldTypeExample value
Request body
querystring"artificial intelligence"Keyword to match against X (Twitter) community names and topics (e.g. artificial intelligence).
cursorstringOpaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of communities.
Response
dataobjectThe page of matching communities, or null when nothing was found.
data.communitiesobject[]Matching X (Twitter) communities. Search returns a summary record; pass url to twitter.community for the full detail, or to twitter.community_tweets for its posts. Populated whenever the provider has data for the entity.
data.communities[].idstringCommunity identifier. Populated whenever the provider has data for the entity.
data.communities[].memberCountintegerNumber of members in the community.
data.communities[].namestringCommunity name. Populated whenever the provider has data for the entity.
data.communities[].nsfwbooleanWhether the community is flagged as not safe for work.
data.communities[].topicstringThe community's primary topic label (may be empty).
data.communities[].urlstringCanonical URL of the community on X. Pass it to twitter.community or twitter.community_tweets. Populated whenever the provider has data for the entity.
data.nextCursorstringOpaque cursor for the next page of communities, or null when this lane has no more. Pass it back as cursor to continue.
foundbooleanTrue when the search returned at least one community; false when nothing matched.
Price
Price per request (ceiling)USD$0.0011
Price /1k resultsUSD$0.11

FAQ

About the X / Twitter Search communities API

The AnyAPI X / Twitter Search communities API returns X / Twitter search communities data as normalized JSON from one POST call to /v1/run/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. AnyAPI returns one normalized schema whichever source serves it. It costs $0.11 per 1,000 results, and never more than $0.0011 for a single request, in US dollars with no subscription and no monthly minimum.

It costs $0.11 per 1,000 results, and never more than $0.0011 for a single request, in US dollars with no subscription and no monthly minimum. You fund one USD wallet, each call draws it down, and a failed request costs $0.

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. The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.