> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search community members, X (Twitter) API docs

> Find a Twitter or X Community's members by name or username, each with its role & full profile. Names match from their first letters. 1 credit per member.

> For the complete documentation index, see [llms.txt](https://docs.xquik.com/llms.txt).

`GET https://xquik.com/api/v1/x/communities/{id}/members/search`

> [!NOTE]
>
> Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`.

**1 credit per member returned** · An answer without members is free

[All plans](https://xquik.com) from \$0.00012/credit · Supports [guest paid reads](https://docs.xquik.com/guides/guest-wallets.md)

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
curl "https://xquik.com/api/v1/x/communities/1493446837214187523/members/search?q=marckohlbrugge" \
  -H "x-api-key: xq_your_api_key_here" | jq
```

```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
const communityId = "1493446837214187523";
const params = new URLSearchParams({ q: "marckohlbrugge" });
const response = await fetch(
  `https://xquik.com/api/v1/x/communities/${communityId}/members/search?${params}`,
  { headers: { "x-api-key": "xq_your_api_key_here" } },
);
const page = await response.json();
if (!response.ok) throw new Error(JSON.stringify(page));

const memberRows = page.users.map((user) => ({
  community_id: communityId,
  member_id: user.id,
  username: user.username,
  name: user.name,
  role: user.communityRole ?? null,
  followers: user.followers ?? null,
}));
process.stdout.write(JSON.stringify(memberRows, null, 2));
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
import json
import requests

community_id = "1493446837214187523"
response = requests.get(
    f"https://xquik.com/api/v1/x/communities/{community_id}/members/search",
    params={"q": "marckohlbrugge"},
    headers={"x-api-key": "xq_your_api_key_here"},
)
page = response.json()
if not response.ok:
    raise RuntimeError(page)

member_rows = [
    {
        "community_id": community_id,
        "member_id": user["id"],
        "username": user["username"],
        "name": user["name"],
        "role": user.get("communityRole"),
        "followers": user.get("followers"),
    }
    for user in page["users"]
]
print(json.dumps(member_rows, indent=2))
```

## Find members by name

Use `GET /x/communities/{id}/members/search` to check whether people belong to a Community.




The answer lists members whose name or username starts with `q`, in X's order. It can leave out some matching members.
Send the exact username for the best match. Each row is a full profile with its `communityRole` of `Admin`, `Moderator` or `Member`.




A name that finds only people outside the Community returns an empty `users` list. That answer is free. Try the
exact username when a common name finds no member.




All results fit in 1 answer, so `has_next_page` is `false`. To list every member, use
[Community members](https://docs.xquik.com/api-reference/x/community-members.md).

## Path parameters

| Path parameter | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Community ID, such as `1493446837214187523`, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. |

## Query parameters

| Query parameter | Type | Required | Description |
| - | - | - | - |
| `q` | `string` | Yes | Name or username to find members by, such as `marckohlbrugge`. A leading `@` is dropped. Also read as `query`. |

### User result filters

These filters apply before billing. Selective filters can return fewer rows.

See [user filters](https://docs.xquik.com/api-reference/x/user-filters.md) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`.

### Choose fields

| Query parameter | Type | Required | Description |
| - | - | - | - |
| `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. |
| `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. |

## Headers

| Header | Type | Required | Description |
| - | - | - | - |
| `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. |
| `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. |

## Response

### 200 OK

| Field | Type | Description |
| - | - | - |
| `users` | `object[]` | Members X found for the name, in X's order. Each holds the same profile fields as [Community members](https://docs.xquik.com/api-reference/x/community-members.md). These include `id`, `username`, `name`, `followers` & `verified`. |
| `users[].communityRole` | `string` | The member's role in the Community is `Admin`, `Moderator` or `Member`. |
| `has_next_page` | `boolean` | Always `false`. X sends all results in 1 answer. |
| `next_cursor` | `string` | Always an empty string. |

### 400 Missing name or invalid Community ID

`{ "error": "missing_query" }`




Send a name or username in `q`. A Community ID must be numeric, or the answer is `invalid_community_id`.

### 401 Unauthenticated

Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge.




Missing or invalid API key.

### 402 Payment required

Account keys get account options. Guest keys get guest top-up only.
No checkout starts automatically. Confirm any payment action.

### 429 Rate limit exceeded

You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying.

### 502 X API unavailable

The read service returned an error. Retry after a short delay.

> [!NOTE]
>
> **Related.** [Community members](https://docs.xquik.com/api-reference/x/community-members.md) · [Community moderators](https://docs.xquik.com/api-reference/x/community-moderators.md) · [Community details](https://docs.xquik.com/api-reference/x/community-info.md)

> [accordion] Related follower, list & community APIs
>
> * Profiles
>   * [Search users](https://docs.xquik.com/api-reference/x/search-users.md)
>   * [Search autocomplete](https://docs.xquik.com/api-reference/x/search-autocomplete.md)
>   * [Get user](https://docs.xquik.com/api-reference/x/twitter-profile-lookup.md)
>   * [Batch users](https://docs.xquik.com/api-reference/x/batch-users.md)
> * Followers
>   * [Followers](https://docs.xquik.com/api-reference/x/followers.md)
>   * [Following](https://docs.xquik.com/api-reference/x/following.md)
>   * [Follower IDs](https://docs.xquik.com/api-reference/x/follower-ids.md)
>   * [Following IDs](https://docs.xquik.com/api-reference/x/following-ids.md)
>   * [Creator subscriptions](https://docs.xquik.com/api-reference/x/user-subscriptions.md)
>   * [Affiliates](https://docs.xquik.com/api-reference/x/user-affiliates.md)
>   * [Similar accounts](https://docs.xquik.com/api-reference/x/user-similar.md)
>   * [Translate bio](https://docs.xquik.com/api-reference/x/user-bio-translation.md)
>   * [User insights](https://docs.xquik.com/api-reference/x/user-engagement-insights.md)
>   * [Verified followers](https://docs.xquik.com/api-reference/x/verified-followers.md)
>   * [Followers you know](https://docs.xquik.com/api-reference/x/followers-you-know.md)
>   * [Check follower](https://docs.xquik.com/api-reference/x/check-follower.md)
> * Lists
>   * [Search lists](https://docs.xquik.com/api-reference/x/search-lists.md)
>   * [User lists](https://docs.xquik.com/api-reference/x/user-lists.md)
>   * [List memberships](https://docs.xquik.com/api-reference/x/user-list-memberships.md)
>   * [List details](https://docs.xquik.com/api-reference/x/list-details.md)
>   * [List members](https://docs.xquik.com/api-reference/x/list-members.md)
>   * [List followers](https://docs.xquik.com/api-reference/x/list-followers.md)
> * Communities
>   * [Find](https://docs.xquik.com/api-reference/x/community-find.md)
>   * [Popular](https://docs.xquik.com/api-reference/x/community-popular.md)
>   * [Topics](https://docs.xquik.com/api-reference/x/community-topics.md)
>   * [Suggested](https://docs.xquik.com/api-reference/x/community-suggested.md)
>   * [Details](https://docs.xquik.com/api-reference/x/community-info.md)
>   * [Members](https://docs.xquik.com/api-reference/x/community-members.md)
>   * [Member search](https://docs.xquik.com/api-reference/x/community-member-search.md)
>   * [Moderators](https://docs.xquik.com/api-reference/x/community-moderators.md)
>   * [Timeline](https://docs.xquik.com/api-reference/x/community-tweets.md)
>   * [Media](https://docs.xquik.com/api-reference/x/community-media.md)
>   * [Keyword search](https://docs.xquik.com/api-reference/x/community-search.md)
>   * [Tweets search](https://docs.xquik.com/api-reference/x/community-tweets-search.md)

## Response examples

### 200 example

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
{
  "users": [
    {
      "id": "641633",
      "username": "marckohlbrugge",
      "name": "Marc Köhlbrugge",
      "communityRole": "Admin",
      "profilePicture": "https://pbs.twimg.com/profile_images/1857124042433572864/iMivVaYP_normal.jpg"
    }
  ],
  "has_next_page": false,
  "next_cursor": ""
}
```

* **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }`
* **401** `{ "error": "unauthenticated", "message": "Authentication required." }`
* **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }`
* **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }`
* **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }`
* **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }`
* **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }`
* **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.