Reddit comment with context

GET https://api.api.sh/reddit/v1/comment
1 credit / call social try it in the playground →

One comment (its permalink view): the comment, the post it is on, up to context parent comments above it (top first, each with its parent id) and the replies under it in thread order (up to limit). Give the comment link as url, or post_id plus comment_id. Each item has author, text, HTML, date, permalink, links and images. Every response includes credits_used: the credits this call cost.

Parameters

nametypedescription
url string Comment link: reddit.com/r/<sub>/comments/<post id>/comment/<comment id>/ or .../<post id>/<slug>/<comment id>/ (old. and new. links too). Example: https://www.reddit.com/r/Python/comments/1qpq3cc/comment/o2ay8su/
post_id string The post (id like 1qpq3cc, t3_1qpq3cc, or its link), with comment_id, when url is not given.
comment_id string Comment id (o2ay8su or t1_o2ay8su), with post_id.
context integer Parent comments to include above the comment, 0 to 8 (default 3). Default: 3
limit integer Most items to read (post, parents, comment and replies), 1 to 100 (default 50). Default: 50

Every endpoint also takes fresh, raw, fields (see lean responses and caching).

Example

curl "https://api.api.sh/reddit/v1/comment?url=https%3A%2F%2Fwww.reddit.com%2Fr%2FPython%2Fcomments%2F1qpq3cc%2Fcomment%2Fo2ay8su%2F" \
  -H "x-api-key: $APISH_KEY"

Response

A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).

The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.