100 free credits. No credit card required. Get a key

X (Twitter) tweet replies API

Every reply X shows a logged-in reader under a post, ranked as X ranks them, paginated with after. Not switched on yet: for the top few replies, the post endpoint already returns them, logged out, for one credit.

GET /v1/x/tweets/{id}/repliesNot switched on yet5 credits per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/x/tweets/1585341984679469056/replies",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 5 credits

No bundled sample for this call. The response is a XTimelineResponse; its fields are listed below.

Parameters

NameTypeDescription
idpath · requiredstringA post id or a post URL (x.com or twitter.com). Example: 1585341984679469056.
sortquery"relevance" | "latest" | "likes"relevance (X’s ranking, default), latest or likes. One of relevance, latest, likes.
afterquerystringCursor: the previous page's meta.next_token.
Response fields

200 with a XTimelineResponse, in the shape of X’s API v2 Tweet and User objects.

FieldTypeDescription
dataXTweet[]
includesXIncludesObjects the response refers to by id, each once: authors, quoted and reposted posts, media, polls.
metaXTimelineMeta
Status codes
StatusMeaning
200A page of replies, with a next_token.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The post or account does not exist, was deleted, or is suspended.
429Too many requests. Wait for Retry-After seconds.
503X is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Can I use it today?

Not switched on yet: this endpoint needs logged-in X sessions, which this deployment does not have configured. Until then it answers 503 upstream_unavailable with a hint and is never charged.

X is a trademark of X Corp. We are not affiliated with or endorsed by X Corp.