Retrieve community members

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

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

Endpoint parameters

Name
Description
Example

community_id (Required)

Target community ID

1493446837214187523

cursor (Optional)

Cursor value obtained from next_cursor response property

DAACCgACGC12FhmAJxAKAAMYLXYWGX_Y8AgABAAAAAILAAUAAADoRW1QQzZ3QUFBZlEvZ0d...

Common Issues and Best Practices

  • 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

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

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

Example response

// 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"
}

Last updated