# Search community members

`GET https://api.twittrapi.com/communities/{communityId}/members/search`

Find members of a community whose handle matches a text.

HTML page: https://www.twittrapi.com/docs/reference/communities-communityid-members-search

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `communityId` | path | string | yes |  | Numeric community ID, the number in the community URL. |
| `username` | query | string | yes |  | Text to match, with or without @. |

Every read endpoint also accepts `format=simple` (or the header `X-Response-Format: simple`) for compact, flat JSON with a fixed schema. Same price.

## Response

Raw JSON of X's CommunityMemberRelationshipTypeahead query. Not paginated.

With `format=simple`: Collection of User objects: {data: [User], nextCursor, previousCursor, hasNextPage}.

## Errors

| Status | When |
| --- | --- |
| 422 | communityId is not numeric. |
| 400 | username is missing. |

Shared errors (401 missing key, 402 no balance, 429 rate limit, 5xx) are listed on https://www.twittrapi.com/docs/helpful-infos/error-handling. Calls that fail with 400, 408, 409 or a 5xx error are refunded.

## Example request

curl:

```bash
curl 'https://api.twittrapi.com/communities/1500000000000000000/members/search?username=jack' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
import httpx

# No SDK method for this endpoint yet, so this is a plain HTTP call.
resp = httpx.get(
    "https://api.twittrapi.com/communities/1500000000000000000/members/search",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    params={
        "username": "jack",
    },
    timeout=60,
)
data = resp.json()
```

Node.js:

```js
import { TwittrAPI } from "twittrapi";

const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
// No wrapper method for this endpoint yet; client.get() sends the same authenticated GET.
const data = await client.get({
  path: "/communities/1500000000000000000/members/search",
  query: {
    username: "jack",
  },
});
```

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/communities/1500000000000000000/members/search?username=jack' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'
```
