Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

X / Twitter Community Search

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.

價格
自 $0.0011 起美元/次呼叫
方法
POST
回應
JSON
參數
1 個必填 · 1 個選填

Playground

輸入
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.
輸出就緒

您的輸出會顯示在這裡

完成輸入後,點擊執行。

API README

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.

探索更多

相關 APIs

所有 APIs
API價格回應
X (Twitter)每次呼叫 $0.0011 起JSON
X (Twitter)每次呼叫 $0.00054 起JSON
Twitter每次呼叫 $0.0006 起非同步 JSON
X (Twitter)每次呼叫 $0.0001 起JSON
X (Twitter)每次呼叫 $0.0036 起JSON
X (Twitter)每次呼叫 $0.00045 起JSON

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

問題

常見問題

我要如何使用 X / Twitter Community Search API?

使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/twitter/search-communities。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。

X / Twitter Community Search API 的費用是多少?

每次起 $0.0011,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。

X / Twitter Community Search API 接受哪些參數?

必要:query (string)。 選填:cursor (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。

X / Twitter Community Search API 會回傳什麼?

在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。

我需要 X (Twitter) 開發者帳號或 API 金鑰嗎?

不需要。X / Twitter Community Search 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 X (Twitter) API 存取權。