Skip to main content
GET
/
2
/
communities
/
search
Search Communities
curl --request GET \
  --url https://api.x.com/2/communities/search \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "1146654567674912769",
      "name": "<string>",
      "created_at": "2023-11-07T05:31:56Z"
    }
  ],
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ],
  "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<int32>
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. The next token.

Minimum string 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. The next token.

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

A comma separated list of Community fields to display. The fields available for a Community object.

Minimum array length: 1
Available options:
access,
created_at,
description,
id,
join_policy,
member_count,
name
Example:
[
"access",
"created_at",
"description",
"id",
"join_policy",
"member_count",
"name"
]

Response

The request has succeeded.

data
object[]
Minimum array length: 1
errors
object[]
Minimum array length: 1
meta
object