# Retrieve community members

{% hint style="danger" %} <mark style="color:red;">**WARNING:**</mark>&#x20;

**You are viewing an outdated version of our documentation.** \
**For the latest and most accurate information, please visit** [**docs.socialdata.tools**](https://docs.socialdata.tools)**.**
{% endhint %}

Returns 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 cursor parameter.

### Endpoint

```url
GET https://api.socialdata.tools/twitter/community/[community_id]/members
```

### Endpoint parameters

| Name                                                | Description                                               | Example                                                                     |
| --------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------- |
| <p>community\_id<br><strong>(Required)</strong></p> | Target community ID                                       | 1493446837214187523                                                         |
| <p>cursor<br>(Optional)</p>                         | Cursor value obtained from next\_cursor response property | DAACCgACGC12FhmAJxAKAAMYLXYWGX\_Y8AgABAAAAAILAAUAAADoRW1QQzZ3QUFBZlEvZ0d... |

{% hint style="warning" %} <mark style="color:orange;">**Common Issues and Best Practices**</mark>

* In languages where the `community_id` value exceeds the default Integer type limit (e.g., Node.js), store `community_id` as a string. Use the `id_str` property returned by the API for these values
* Always URL-encode the `cursor` value when passing it back to the API for subsequent requests
  {% endhint %}

### Response codes

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

### Rate limits

By default each user has a limit of 120 requests per minute shared across all endpoints. Please reach out to <support@socialdata.tools> if you need to raise your rate limit.

### Example request

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

### Example response

```json
// If succeeded: 
{
    "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"
	},
	...
    ],
    "next_cursor": "CycRAAAAAAwABAwKmwzBVQo+vQ0OGGp8lQABCm07AAABkNDNH5sADJorCj69f\/\/\/\/\/\/\/\/\/8KbTt\/\/\/\/\/\/\/\/\/\/wAIP8AAAAADAAAA"
}

// If failed:
{
    "status":"error",
    "message":"Failed to fetch data from Twitter"
}
```
