GET
/
2
/
communities
/
search
curl --request GET \
  --url https://api.twitter.com/2/communities/search \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "id": "1146654567674912769",
      "name": "<string>"
    }
  ],
  "errors": [
    {
      "detail": "<string>",
      "status": 123,
      "title": "<string>",
      "type": "<string>"
    }
  ],
  "meta": {
    "next_token": "<string>"
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

query
string
required

Query to search communities.

Required string length: 1 - 4096
Example:

"Love"

max_results
integer
default:10

The maximum number of search results to be returned by a request.

Required range: 10 <= x <= 100
next_token
string

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Minimum length: 1
pagination_token
string

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Minimum length: 1
community.fields
enum<string>[]

A comma separated list of Community fields to display.

Available options:
access,
created_at,
description,
id,
join_policy,
member_count,
name
Example:
[
  "access",
  "created_at",
  "description",
  "id",
  "join_policy",
  "member_count",
  "name"
]

Response

200
application/json
The request has succeeded.
data
object[]

A X Community is a curated group of Posts.

errors
object[]

An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807).

meta
object