X community posts API
  1. Docs
  2. X (Twitter)
  3. X community posts API

X community posts API

The 20 most-liked posts of a public X community, which is all X shows.

GET /v1/twitter/community/tweets

GET /v1/twitter/community/tweets

The 20 most-liked posts of a public X community, which is all X shows. X offers no way to page further, so there is no next-page cursor and newer posts are not reachable. The community itself is returned as parent.

  • Cost: 1 credit
  • 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:

  • cursor: the cursor from the previous page (Pagination).
  • 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).

1curl -G "https://api.socialscrape.dev/v1/twitter/community/tweets" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "id=1926186499399139650"

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.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_a7469874b589e1cc4ab51e64",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "twitter",14        "id": "2107788935745441861",15        "url": "https://x.com/Top_Things_/status/2107788935745441861",16        "type": "tweet",17        "author": {18          "id": "1298298807147302912",19          "handle": "Top_Things_",20          "name": "Velora",21          "url": "https://x.com/Top_Things_",22          "avatar_url": "https://pbs.twimg.com/profile_images/2077356217522065408/i-f_VmSH_400x400.jpg",23          "verified": false24        },25        "title": null,26        "text": "looking for more people into tech, startups, AI, careers & marketing.\n\nif that’s your side of x,  let’s connect 👋",27        "published_at": "2026-10-07T11:03:37Z",28        "duration_seconds": null,29        "language": "en",30        "hashtags": null,31        "mentions": null,32        "stats": {33          "views": 141,34          "likes": 8,35          "comments": 5,36          "shares": 0,37          "saves": 0,38          "dislikes": null39        },40        "media": {41          "thumbnail_url": null,42          "video_url": null,43          "audio_url": null,44          "image_urls": null,45          "width": null,46          "height": null47        },48        "song": null,49        "location": null,50        "is_pinned": null,51        "is_sponsored": null,52        "extra": {53          "is_edited": false,54          "quote_count": 0,55          "retweet_count": 056        }57      },58      {59        "object": "post",60        "platform": "twitter",61        "id": "2112578838681260376",62        "url": "https://x.com/yashsrivasta7a/status/2112578838681260376",63        "type": "tweet",64        "author": {65          "id": "1677001600416772096",66          "handle": "yashsrivasta7a",67          "name": "Yash Srivastava",68          "url": "https://x.com/yashsrivasta7a",69          "avatar_url": "https://pbs.twimg.com/profile_images/2103762831762161664/Kgf3TUpk_400x400.jpg",70          "verified": false71        },72        "title": null,73        "text": "DeskNotch just crossed 41 installs  :\n\nSmall number, but every one of them is a real person who wanted a notch on Windows.\n\nNext goal: 100. \n\nLink : https://apps.microsoft.com/detail/9nbwqjcvmjgp?cid=DevShareMCLPCS&hl=en-GB&gl=IN\n\nGithub:\nh...",74        "published_at": "2026-10-20T16:16:59Z",75        "duration_seconds": null,76        "language": "en",77        "hashtags": null,78        "mentions": null,79        "stats": {80          "views": 126,81          "likes": 6,82          "comments": 0,83          "shares": 3,84          "saves": 0,85          "dislikes": null86        },87        "media": {88          "thumbnail_url": "https://pbs.twimg.com/media/HVFiYOMawAAYLBS.png",89          "video_url": null,90          "audio_url": null,91          "image_urls": [92            "https://pbs.twimg.com/media/HVFiYOMawAAYLBS.png"93          ],94          "width": 462,95          "height": 23796        },97        "song": null,98        "location": null,99        "is_pinned": null,100        "is_sponsored": null,101        "extra": {102          "is_edited": false,103          "links": [104            {105              "display_url": "apps.microsoft.com/detail/9nbwqjc…",106              "url": "https://apps.microsoft.com/detail/9nbwqjcvmjgp?cid=DevShareMCLPCS&hl=en-GB&gl=IN"107            },108            {109              "display_url": "github.com/yashsrivasta7a…",110              "url": "https://github.com/yashsrivasta7a/deskNotch/"111            }112          ],113          "media": [114            {115              "height": 237,116              "type": "photo",117              "url": "https://pbs.twimg.com/media/HVFiYOMawAAYLBS.png",118              "width": 462119            }120          ],121          "possibly_sensitive": false,122          "quote_count": 0,123          "retweet_count": 3124        }125      }126    ],127    "cursor": null,128    "has_more": false,129    "parent": {130      "object": "community",131      "platform": "twitter",132      "id": "1926186499399139650",133      "url": "https://x.com/i/communities/1926186499399139650",134      "kind": "community",135      "name": "The First Thousand",136      "title": "The First Thousand",137      "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.",138      "avatar_url": null,139      "banner_url": "https://pbs.twimg.com/community_banner_img/1930048753223745537/Ua814CNc?format=jpg&name=orig",140      "member_count": 5628,141      "online_count": null,142      "is_nsfw": false,143      "is_private": null,144      "verified": null,145      "created_at": "2025-05-24T08:00:22.931000Z",146      "extra": {147        "creator": {148          "handle": "sample_user",149          "id": "1000000001",150          "name": "Sample User",151          "url": null,152          "verified": true153        },154        "join_policy": "Open",155        "member_handles": [156          "sample_user",157          "sample_user",158          "sample_user"159        ],160        "rules": [161          {162            "description": "This isn’t the space to drop ChatGPT engineered empty platitudes",163            "id": "1926189963793609186",164            "name": "No Empty Platitudes"165          },166          {167            "description": "Show how you’re cracking the algorithm",168            "id": "1926190339016048686",169            "name": "Post What’s Working"170          },171          {172            "description": "Post your analytics. Let’s compete to see who is going the hardest",173            "id": "1926190261610135711",174            "name": "Share Your Stats"175          }176        ]177      }178    }179  },180  "cursor": null,181  "has_more": false182}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

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.