Get Community Details - API Reference
Returns information about a Twitter community.
GET https://api.socialdata.tools/twitter/community/{community_id}
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
Code Examples
curl "https://api.socialdata.tools/twitter/community/1493446837214187523" -H 'Authorization: Bearer API_KEY' -H 'Accept: application/json
const communityId = '1493446837214187523';const API_KEY = 'YOUR_API_KEY_HERE';
fetch(`https://api.socialdata.tools/twitter/community/${communityId}`, { method: 'GET', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Accept': 'application/json' }}).then(response => response.json()).then(response => console.log(response)).catch(err => console.error(err));
import requests
communityId = '1493446837214187523'API_KEY = 'YOUR_API_KEY_HERE'
url = f'https://api.socialdata.tools/twitter/community/{communityId}'
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)
$communityId = '1493446837214187523';$API_KEY = 'YOUR_API_KEY_HERE';
$url = "https://api.socialdata.tools/twitter/community/{$communityId}";
$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
{ "id_str": "1493446837214187523", "created_at": "2022-02-15T04:47:27.551000Z", "name": "Build in Public", "description": "Share what you're working on. Get feedback. Help each other move forward. – Sponsors: @iamfra5er @freemius @RaulOnRails @indexsy @create_xyz", "creator_is_blue_verified": true, "creator_screen_name": "marckohlbrugge", "join_policy": "Open", "rules": [ "Share what you're working on", "Screenshots, screencasts, drafts, etc", "No self-promotion", "Stay on-topic", "No engagement farming", "Use a personal account" ], "banner_url": "https:\/\/pbs.twimg.com\/community_banner_img\/1901004865490313216\/FVEYARpF?format=png&name=orig", "banner_width": 1200, "banner_height": 480, "member_count": 111247, "is_nsfw": false}
{ "status": "error", "message": "Insufficient balance"}
{ "status": "error", "message": "Not found"}
{ "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 comminity 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