X community API
X community, as JSON, with id, url, kind, name, title and more.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
You send one of url or id.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/twitter/community" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'id=1926186499399139650'import os
import requests
params = {
"id": "1926186499399139650",
}
res = requests.get(
"https://api.socialscrape.io/v1/twitter/community",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
timeout=60,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/twitter/community");
url.search = new URLSearchParams({
id: "1926186499399139650",
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape X community",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/twitter/community",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "1926186499399139650"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | url | one of | Community URL (x.com/i/communities/<id>). |
id | string | one of | Community id. Also accepted as community_id. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are public data, not yours.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_bf57d24ca2fe2cd2e4b97ed6",
"data": {
"object": "community",
"platform": "twitter",
"id": "1926186499399139650",
"url": "https://x.com/i/communities/1926186499399139650",
"kind": "community",
"name": "The First Thousand",
"title": "The First Thousand",
"description": "This community is for creators and builders who are growing to their first 1,000 followers. Give insights, build your brand, and grow a loyal audience.",
"avatar_url": null,
"banner_url": "https://pbs.twimg.com/community_banner_img/1930048753223745537/Ua814CNc?format=jpg&name=orig",
"member_count": 5625,
"online_count": null,
"is_nsfw": false,
"is_private": null,
"verified": null,
"created_at": "2025-05-24T08:00:22.931000Z",
"extra": {
"creator": {
"handle": "sample_user",
"id": "1000000001",
"name": "Sample User",
"url": null,
"verified": true
},
"join_policy": "Open",
"member_handles": [
"sample_user",
"sample_user",
"sample_user"
],
"rules": [
{
"description": "This isn’t the space to drop ChatGPT engineered empty platitudes",
"id": "1926189963793609186",
"name": "No Empty Platitudes"
},
{
"description": "Show how you’re cracking the algorithm",
"id": "1926190339016048686",
"name": "Post What’s Working"
},
{
"description": "Post your analytics. Let’s compete to see who is going the hardest",
"id": "1926190261610135711",
"name": "Share Your Stats"
}
]
}
},
"cursor": null,
"has_more": null
}Fields
One Community in data.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "community" | ||
platform | Platform | yes | |
id | string or null | ||
url | string or null | ||
kind | "subreddit" or "group" or "community" or "channel" or "unknown" | ||
name | string or null | the slug, "python" for r/python | |
title | string or null | ||
description | string or null | ||
avatar_url | string or null | ||
banner_url | string or null | ||
member_count | integer or null | ||
online_count | integer or null | ||
is_nsfw | boolean or null | ||
is_private | boolean or null |
Show the other 3 fields
| Field | Type | Always | Notes |
|---|---|---|---|
verified | boolean or null | the platform's verified badge (Telegram channels) | |
created_at | string (ISO 8601 date-time) or null | ||
extra | object or null |
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), unsupported_url (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
Is there an SDK call for it?
The preview Python client has client.twitter.community(...) and the TypeScript client client.twitter.community(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.