---
title: "Search communities"
method: GET
path: "/communities/search/{searchTerm}"
tags: ["Communities"]
---

# Search communities

`GET /communities/search/{searchTerm}`

## Request

- Base URL: `https://api.twittrapi.com`
- URL: `https://api.twittrapi.com/communities/search/{searchTerm}`
- Auth: API key in header `X-API-KEY`

Find X Communities by keyword.

Paginated: pass the bottom cursor of one page as cursor to get the next. Each page is one billed call.

Reference: https://www.twittrapi.com/docs/reference/communities-search-searchterm

## Path parameters

- `searchTerm` string, required

## Query parameters

- `count` integer
- `cursor` string
- `sort` string
- `format` 'raw' | 'simple'

## Response `200`

Raw JSON of X's CommunitiesSearchQuery. Communities are in data.communities_search_slice.items_results; the next-page cursor is data.communities_search_slice.slice_info.next_cursor (there are no cursor entries).

With format=simple: Collection of Community objects (description and rules are empty in search results).

- union: format=simple: the simple-format schema. Default (raw): X's JSON, passthrough.
  - CommunityPage: Simple format: a page of communities
    - `data` Community[], required
      - `id` string, required
      - `name` string, required
      - `description` string, required: Empty in search results
      - `createdAt` string, nullable, required
      - `memberCount` integer, required
      - `moderatorCount` integer, required
      - `joinPolicy` string, nullable, required
      - `nsfw` boolean, required
      - `topic` string, nullable, required
      - `bannerUrl` string, nullable, required
      - `creator` object, nullable, required
        - `id` string, required
        - `username` string, required
      - `rules` object[], required
        - `id` string, required
        - `name` string, required
        - `description` string, required
    - `nextCursor` string, nullable, required: Pass as cursor for the next page; null on the last page
    - `previousCursor` string, nullable, required: X's top cursor, for polling newer items
    - `hasNextPage` boolean, required
  - RawPassthrough: X's own JSON (raw format, the default), passed through unchanged. The shape is X's and can change; see https://www.twittrapi.com/docs/response-format.

## Other responses

- `401`: Missing or unknown API key. Not charged.
- `402`: No balance left, or the trial expired. Not charged. Top up in the dashboard.
- `403`: Key deactivated, or the endpoint is not in your plan (trial keys and account actions). Not charged.
- `429`: Rate limit for your key exceeded. Not charged. No Retry-After header: back off exponentially.
- `500`: Something failed on our side or between us and X. Refunded (400, 407, 408, 409 or a 5xx error are refunded). Retry with backoff.

---

[API](https://skmtc.dev/twittrapi/apis/twittrapi-api.md) · [All operations](https://skmtc.dev/twittrapi/apis/twittrapi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/twittrapi/apis/twittrapi-api/revisions/0618e38b54c2?raw)
