> ## 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 X community members by name or username

> Find a Twitter or X Community's members by name or username, each with its role & full profile, as the search on x.com's members page does. 1 credit per member.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-community-member-search-200">
      ```json theme={null}
      {
        "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": ""
      }
      ```
    </Tab>

    <Tab title="400" id="response-x-community-member-search-400">
      ```json theme={null}
      {
        "error": "invalid_input",
        "message": "Invalid input. Check the request body."
      }
      ```
    </Tab>

    <Tab title="401" id="response-x-community-member-search-401">
      ```json theme={null}
      {
        "error": "unauthenticated",
        "message": "Authentication required."
      }
      ```
    </Tab>

    <Tab title="402" id="response-x-community-member-search-402">
      ```json theme={null}
      {
        "error": "insufficient_credits",
        "message": "Insufficient credits. Top up or subscribe to continue."
      }
      ```
    </Tab>

    <Tab title="424" id="response-x-community-member-search-424">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="429" id="response-x-community-member-search-429">
      ```json theme={null}
      {
        "error": "rate_limit_exceeded",
        "message": "Too many requests. Try again later.",
        "retryAfter": 60
      }
      ```
    </Tab>

    <Tab title="502" id="response-x-community-member-search-502">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="503" id="response-x-community-member-search-503">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "Xquik is busy right now. Retry shortly."
      }
      ```
    </Tab>
  </Tabs>
</Panel>

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

<Note>
  Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page or ID list, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`.
</Note>

<Callout icon="coins" color="#5c3327">
  **1 credit per member returned** · An answer without members is free · [All plans](https://xquik.com/#pricing) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets)
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  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={null}
  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={null}
  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))
  ```
</CodeGroup>

## Find members by name

Use `GET /x/communities/{id}/members/search` to check whether people belong to a Community. It works like the
search box on x.com's members page.

X checks up to 10 accounts whose name or username starts with `q`. The answer holds the members among them, in X's
order. Each row is a full profile with its `communityRole`: `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](/api-reference/x/community-members).

## Path parameters

<ParamField path="id" type="string" required>
  Community ID (numeric string), such as `1493446837214187523`.
</ParamField>

## Query parameters

<ParamField query="q" type="string" required>
  Name or username to find members by, such as `marckohlbrugge`. A leading `@` is dropped. Alias: `query`.
</ParamField>

### User result filters

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

<ParamField query="minFollowers" type="integer">
  Require this minimum follower count. Filtering happens before billing.
</ParamField>

<ParamField query="maxFollowers" type="integer">
  Allow this maximum follower count. Missing counts pass this filter.
</ParamField>

<ParamField query="minFollowing" type="integer">
  Require this minimum following count.
</ParamField>

<ParamField query="maxFollowing" type="integer">
  Allow this maximum following count. Missing counts pass this filter.
</ParamField>

<ParamField query="minStatuses" type="integer">
  Require this minimum post count.
</ParamField>

<ParamField query="maxStatuses" type="integer">
  Allow this maximum post count. Missing counts pass this filter.
</ParamField>

<ParamField query="minAccountAgeDays" type="integer">
  Require this minimum account age in days.
</ParamField>

<ParamField query="verifiedOnly" type="boolean">
  When `true`, only return verified profiles.
</ParamField>

<ParamField query="verifiedType" type="string">
  Match the exact verification type.
</ParamField>

<ParamField query="hasWebsite" type="boolean">
  When `true`, require a profile website.
</ParamField>

<ParamField query="hasLocation" type="boolean">
  When `true`, require a profile location.
</ParamField>

<ParamField query="bioContains" type="string">
  Require every comma-separated or line-separated bio term.
</ParamField>

<ParamField query="locationContains" type="string">
  Require this text in the profile location.
</ParamField>

<ParamField query="usernameContains" type="string">
  Require this text in the username.
</ParamField>

## Headers

<ParamField header="x-api-key" type="string">
  Full account key. Sessions and OAuth also work.
</ParamField>

<ParamField header="Authorization" type="string">
  `Bearer xq_your_guest_key_here` for `paid_reads`.
</ParamField>

## Response

### 200 OK

<ResponseField name="users" type="object[]">
  Members X found for the name, in X's order. Each holds the same profile fields as
  [Community members](/api-reference/x/community-members), such as `id`, `username`, `name`, `followers` &
  `verified`.

  <ResponseField name="communityRole" type="string">
    The member's role in the Community: `Admin`, `Moderator` or `Member`.
  </ResponseField>
</ResponseField>

<ResponseField name="has_next_page" type="boolean">
  Always `false`. X sends all results in 1 answer.
</ResponseField>

<ResponseField name="next_cursor" type="string">
  Always an empty string.
</ResponseField>

### 400 Missing name or invalid Community ID

```json theme={null}
{ "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.

```json theme={null}
{ "error": "unauthenticated" }
```

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

```json theme={null}
{ "error": "rate_limit_exceeded", "retryAfter": 60 }
```

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

### 502 X API unavailable

```json theme={null}
{ "error": "x_api_unavailable" }
```

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

<Note>
  **Related.** [Community members](/api-reference/x/community-members) · [Community moderators](/api-reference/x/community-moderators) · [Community details](/api-reference/x/community-info)
</Note>

<div className="related-api-links">
  <Accordion title="Related follower, list & community APIs" icon="link">
    * Profiles: [Search users](/api-reference/x/search-users) · [Search autocomplete](/api-reference/x/search-autocomplete) · [Get user](/api-reference/x/twitter-profile-lookup) · [Batch users](/api-reference/x/batch-users)
    * Followers: [Followers](/api-reference/x/followers) · [Following](/api-reference/x/following) · [Follower IDs](/api-reference/x/follower-ids) · [Following IDs](/api-reference/x/following-ids) · [Creator subscriptions](/api-reference/x/user-subscriptions) · [Affiliates](/api-reference/x/user-affiliates) · [Similar accounts](/api-reference/x/user-similar) · [Translate bio](/api-reference/x/user-bio-translation) · [Verified followers](/api-reference/x/verified-followers) · [Followers you know](/api-reference/x/followers-you-know) · [Check follower](/api-reference/x/check-follower)
    * Lists: [Search lists](/api-reference/x/search-lists) · [User lists](/api-reference/x/user-lists) · [List memberships](/api-reference/x/user-list-memberships) · [List details](/api-reference/x/list-details) · [List members](/api-reference/x/list-members) · [List followers](/api-reference/x/list-followers)
    * Communities: [Find](/api-reference/x/community-find) · [Popular](/api-reference/x/community-popular) · [Topics](/api-reference/x/community-topics) · [Suggested](/api-reference/x/community-suggested) · [Details](/api-reference/x/community-info) · [Members](/api-reference/x/community-members) · [Member search](/api-reference/x/community-member-search) · [Moderators](/api-reference/x/community-moderators) · [Timeline](/api-reference/x/community-tweets) · [Media](/api-reference/x/community-media) · [Keyword search](/api-reference/x/community-search) · [Tweets search](/api-reference/x/community-tweets-search)
  </Accordion>
</div>


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