---
title: "Get Community Members - API Reference"
description: "Retrieve the members of a Twitter/X community and their roles. Flat-rate $0.0002 per profile, flexible rate limits and no subscription plans."
source: "https://docs.socialdata.tools/reference/get-community-members/"
---

Returns an array of users who are admins, moderators or regular members of a community. Typically Twitter returns ~20 results per page. You can request additional results by sending another request to the same endpoint using the `cursor` parameter.

GET https://api.socialdata.tools/twitter/community/{community\_id}/members?cursor={cursor}

## Headers

**Authorization** `string` — required

Authorization Bearer header containing your SocialData API key

Example: Bearer YOUR\_API\_KEY

## Path Parameters

**community\_id** `integer` — required

Target community ID

Example: 1493446837214187523

## Query Parameters

**cursor** `string` — optional

Cursor value obtained from `next_cursor` response property. Used to retrieve additional pages for the same query

Example: DAACCgACGC12FhmAJxAKAAMYLXYWGX\_Y8AgABAAAAAILAAUAAADoRW1QQzZ3QUFBZlEvZ0d...

> **Caution**
> 
> When using languages where the `community_id` value exceeds the default Integer type limit (e.g., JavaScript), you should store `community_id` as a String. Use the `id_str` property returned by the API for these values

## Code Examples

#### curl

```shellscript
curl "https://api.socialdata.tools/twitter/community/1493446837214187523/members" \
    -H 'Authorization: Bearer API_KEY' \
    -H 'Accept: application/json'
```

#### JavaScript

```js
const communityId = '1493446837214187523';
const API_KEY = 'YOUR_API_KEY_HERE';

fetch(`https://api.socialdata.tools/twitter/community/${communityId}/members`, {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Accept': 'application/json'
    }
})
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
```

#### Python

```python
import requests

communityId = '1493446837214187523'
API_KEY = 'YOUR_API_KEY_HERE'

url = f'https://api.socialdata.tools/twitter/community/{communityId}/members'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Accept': 'application/json'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Error: {response.status_code}")
    print(response.text)
```

#### PHP

```php
$communityId = '1493446837214187523';
$API_KEY = 'YOUR_API_KEY_HERE';

$url = "https://api.socialdata.tools/twitter/community/{$communityId}/members";

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer $API_KEY",
        "Accept: application/json"
    ]
]);

$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data);

curl_close($ch);
```

## Example Responses

#### 200

```json
{
    "next_cursor": "CycRAAAAAAwABAwKmwzBVQo+vQ0OGGp8lQABCm07AAABkNDNH5sADJorCj69f\/\/\/\/\/\/\/\/\/8KbTt\/\/\/\/\/\/\/\/\/\/wAIP8AAAAADAAAA",
    "users": [
        {
            "id": 3119483308,
            "id_str": "3119483308",
            "screen_name": "onofregasent",
            "name": "Onofre",
            "protected": false,
            "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/1726870714131640320\/Hsxgtxw9_normal.jpg",
            "community_role": "Member"
      },
      {
            "id": 338944755,
            "id_str": "338944755",
            "screen_name": "bohdanbasov",
            "name": "Bohdan Basov",
            "protected": false,
            "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/1803862687895388160\/2h7gpQ5U_normal.jpg",
            "community_role": "Moderator"
      },
      ...
    ]
}
```

#### 402

```json
{
    "status": "error",
    "message": "Insufficient balance"
}
```

#### 404

```json
{
    "status": "error",
    "message": "User not found"
}
```

#### 500

```json
{
    "status": "error",
    "message": "Failed to fetch data from Twitter"
}
```

## Response Codes

-   **200 OK** - request succeeded
-   **402 Payment Required** - not enough credits to perform this request
-   **404 Not Found** - requested community does not exist
-   **422 Unprocessable Content** - validation failed (e.g. one of the required parameters was not provided)
-   **500 Internal Error** - API internal error, typically means that SocialData API failed to obtain the requested information and you should try again later

## Related endpoints

-   [Get community details](https://docs.socialdata.tools/reference/get-community-details/)
-   [Get community tweets](https://docs.socialdata.tools/reference/get-community-tweets/)
-   [Get community search results](https://docs.socialdata.tools/reference/get-community-search-results/)

## Before you integrate

-   [Authentication](https://docs.socialdata.tools/getting-started/authentication/)
-   [Rate limits](https://docs.socialdata.tools/getting-started/rate-limits/)
-   [Errors](https://docs.socialdata.tools/getting-started/errors/)
-   [Pricing](https://docs.socialdata.tools/getting-started/pricing/)
