Loading…
100 free credits. No credit card required. Get a key
Search posts across Reddit or inside one community, sorted by relevance, new, top or comments, with a time window.
GET /v1/reddit/search/posts2 credits per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/reddit/search/posts?q=self-hosted%20backups&sort=new&t=week",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()No bundled sample for this call. The response is a LinkListing; its fields are listed below.
| Name | Type | Description |
|---|---|---|
qquery · required | string | Search query. Example: typescript narrowing. |
subredditquery | string | Search only this subreddit. Example: typescript. |
sortquery | "relevance" | "new" | "top" | "comments" | Result order. Default relevance. One of relevance, new, top, comments. |
tquery | "hour" | "day" | "week" | "month" | "year" | "all" | Time window for top and controversial. Default day. One of hour, day, week, month, year, all. |
limitquery | integer | Items per page, 1 to 100. Default 25. |
afterquery | string | Cursor: the previous page's data.after. Omit for the first page. |
200 with a LinkListing, in Reddit’s own shape.
| Field | Type | Description |
|---|---|---|
kind | "Listing" | |
data | object |
| Status | Meaning |
|---|---|
200 | Matching posts. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The subreddit, post or user does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Reddit is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
About this endpoint. Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit.
Search is the most expensive call for us to serve. Every other read is 1 credit.