Docs menu

X community

Beta GET /v1/twitter/community

GET /v1/twitter/community

X community.

  • Cost: 1 credit
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLone ofCommunity URL (x.com/i/communities/<id>). Accepted hosts: x.com, twitter.com.
idstringone ofCommunity id. Also accepted as community_id.

Send at least one of url, id. If you send several, the first listed is used and the rest are ignored.

Every request also accepts:

  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

curl
curl -G "https://api.socialscrape.io/v1/twitter/community" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "id=1926186499399139650"
Python
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,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
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);
}
n8n
{
  "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": {}
}

Example response#

This is a sample from a recorded response, lists and long text are shortened, other people's names and handles are replaced. Status 200.

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

Response#

A Community object in data.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

{
  "ok": false,
  "error": {
    "code": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_4f6fac1b91e56f4e09381c46"
}