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
name
type
description
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
import os, requests
res = requests.get(
"https://api.api.sh/reddit/v1/comment",
params={"url": "https://www.reddit.com/r/Python/comments/1qpq3cc/comment/o2ay8su/"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/reddit/v1/comment");
url.searchParams.set("url", "https://www.reddit.com/r/Python/comments/1qpq3cc/comment/o2ay8su/");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
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.