# Groundsocial: full site as Markdown Last updated: November 2026. > Every page of https://groundsocial.dev in one file. Each page is also at its own URL plus `.md`; the index is https://groundsocial.dev/llms.txt. --- # Groundsocial: Social data in one API call > Groundsocial is one API for public social data: clean JSON in each platform's native shape, one key, one credit balance, REST and MCP. Reddit is live. Built for agents. URL: https://groundsocial.dev/ **Groundsocial is a social data API for developers and AI agents.** Public posts, comments, communities and profiles as clean JSON, in each platform’s native shape. One key and one credit balance, over REST or MCP. 100 free credits, no card. ## Platforms - [Reddit](https://groundsocial.dev/endpoints) (live): Threads with full comment trees, community feeds, profiles and search. 9 endpoints. - More platforms coming. In development: TikTok, Instagram, YouTube, X, Facebook, LinkedIn. Same key, same credits, same MCP server. Free list with prices: `GET https://api.groundsocial.dev/v1/platforms`. Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit. ## First call ```bash curl "https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` ## For agents - Paste this into your agent: `Read https://groundsocial.dev/SKILL.md to set up Groundsocial.` - Self-signup: `POST https://api.groundsocial.dev/v1/agent/signup` (may ask one short question, HTTP 428). - Remote MCP: `https://api.groundsocial.dev/mcp` (OAuth 2.1 or API key). - Keyless pay-per-call over MPP and x402 (rolling out). ## Native data A schema shared by every platform keeps only the fields they all have. We return what each platform returns, cleaned and typed: native IDs, cursors and nested replies, inside one envelope (same auth, errors and credit headers everywhere). ## Pricing | Pack | Credits | Price (USD) | Per 1,000 credits | | --- | --- | --- | --- | | Free | 100 | $0 | on signup, no card | | starter | 10,000 | $10.00 | $1.00 | | builder | 60,000 | $49.00 | $0.8167 | | scale | 350,000 | $199.00 | $0.5686 | | volume | 2,000,000 | $799.00 | $0.3995 | - One credit is one standard read. Post search is two. - Failed calls are refunded in the same request: not found, private, upstream errors. - Credits never expire. No subscription. - Spend caps per key, daily and monthly. A key can’t raise its own cap. ## FAQ ### Which platforms can I use today? Reddit, live now: threads with full comment trees, community feeds, profiles and search. In development: TikTok, Instagram, YouTube, X, Facebook, LinkedIn. Same key, same credits, same MCP server. A platform becomes callable only once it answers; `GET /v1/platforms` always says which ones are. ### Why native shapes instead of one unified schema? A schema shared by every platform keeps only the fields they all have, so you lose the rest: cursors, nested replies, flags, platform IDs. We return what each platform returns, cleaned and typed, so nothing is dropped and code written against the platform keeps working. ### What does a call cost? One credit for a standard read; a few calls such as search cost two. Failed calls are refunded automatically, and credits never expire. See the pricing page for packs and the per-endpoint list. ### Can my agent sign itself up? Yes. `POST /v1/agent/signup` creates an account with free credits and returns an API key and a claim link for a person. It may first ask one short question (HTTP 428) that the agent answers itself. ### How fresh is the data? Fetched from the platform when you ask, with short caches in front so identical requests a few seconds apart share one fetch. Cache hits are marked in the response headers. ### What about deleted and removed content? You get what the platform shows publicly at the time of the call. We never restore removed posts or comments, and people can ask us to remove their data from our caches. ### Are you affiliated with the platforms? No. Groundsocial is an independent service that returns public data. Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit. ### What can’t I do with it? No posting, voting or messaging; no private communities; no harassment, re-identification or profiling of individuals. See the terms. --- # Pricing > Credits that never expire: 100 free, then packs in USD. One credit per read, two for search; failed calls refunded. URL: https://groundsocial.dev/pricing ## Packs | Pack | Credits | Price (USD) | Per 1,000 credits | | --- | --- | --- | --- | | Free | 100 | $0 | on signup, no card | | starter | 10,000 | $10.00 | $1.00 | | builder | 60,000 | $49.00 | $0.8167 | | scale | 350,000 | $199.00 | $0.5686 | | volume | 2,000,000 | $799.00 | $0.3995 | - One credit is one standard read. Post search is two. - Failed calls are refunded in the same request: not found, private, upstream errors. - Credits never expire. No subscription. - Spend caps per key, daily and monthly. A key can’t raise its own cap. ## What each call costs | Endpoint | Credits | Keyless (USD per call) | | --- | --- | --- | | `reddit.subreddit.get`: A subreddit: description, rules, member count, flags. | 1 | $0.010000 | | `reddit.subreddit.posts`: Posts in a subreddit, by hot, new, top, rising or controversial. | 1 | $0.010000 | | `reddit.post.get`: One post with its full comment tree. | 1 | $0.010000 | | `reddit.post.comments`: Comments on a post, paginated, with "more" threads expanded. | 1 | $0.010000 | | `reddit.user.get`: A public user profile: karma, age, flags. | 1 | $0.010000 | | `reddit.user.posts`: Posts a user submitted. | 1 | $0.010000 | | `reddit.user.comments`: Comments a user wrote. | 1 | $0.010000 | | `reddit.search.posts`: Search posts across Reddit or in one subreddit. | 2 | $0.020000 | | `reddit.search.subreddits`: Find subreddits by name or topic. | 1 | $0.010000 | ## FAQ ### Is there a subscription? No. You buy a pack of credits once and spend them as you call. There is no monthly fee and nothing renews. ### Do credits expire? No. Credits stay on your balance until you use them, across every platform we add. ### Do I pay for failed calls? No. A call that fails (not found, private, rate limited upstream, our error) is refunded in the same request, and the response headers say so. ### What does one call cost? One credit for a standard read. A few heavier calls, such as post search, cost two. Every endpoint’s price is in the table on this page and in `GET /v1/platforms`. ### Can I cap what a key spends? Yes. Each key can have a daily and a monthly credit cap. A key can’t raise its own cap. ### Can an agent pay without an account? That is rolling out: a paid route called with no key answers `402` with MPP and x402 offers, and the payment is captured only after a successful fetch. Until then, agents sign up for free credits. ## Keyless pay-per-call Agents without an account pay per call over MPP or x402 at $0.01 per credit, captured only after a successful fetch. Rolling out with the payments release; until then a keyless call answers 401 with signup instructions. --- # For agents > Everything an AI agent needs to discover, set up and pay for Groundsocial by itself: SKILL.md, self-signup, MCP and pay-per-call. URL: https://groundsocial.dev/agents ## Tell your agent. Once. Paste this into your agent: `Read https://groundsocial.dev/SKILL.md to set up Groundsocial.` It installs what it needs, gets itself a key (or uses yours) and makes its first call. ## Ways in | Door | For | Credential | | --- | --- | --- | | REST API | Code, scripts, SDKs | API key (`Authorization: Bearer`) | | Remote MCP | Claude, ChatGPT, Cursor: `https://api.groundsocial.dev/mcp` | OAuth 2.1, or the API key as Bearer | | Keyless pay-per-call | Agents with a wallet and no account | MPP or x402, $0.01 per credit (rolling out) | ## Self-signup, then a human claims it 1. **Sign up.** `POST https://api.groundsocial.dev/v1/agent/signup`. No key, no email. 100 free credits. 2. **Answer one question.** It may answer `428 challenge_required` with a one-word question ("Which of norway, walrus, pear is a country?"). POST again with `challenge_token` and `answer`. 3. **Use the key.** The `201` has `api_key`, `claim_url` and a `message_for_human`. Store the key; relay the message. 4. **A person claims it.** They open `claim_url`, sign in, and the account is theirs. The key keeps working. Agents never complete a claim themselves. ## Tools | Tool | Does | Credits | | --- | --- | --- | | `reddit_subreddit_get` | A subreddit: description, rules, member count, flags. | 1 | | `reddit_subreddit_posts` | Posts in a subreddit, by hot, new, top, rising or controversial. | 1 | | `reddit_post_get` | One post with its full comment tree. | 1 | | `reddit_post_comments` | Comments on a post, paginated, with "more" threads expanded. | 1 | | `reddit_user_get` | A public user profile: karma, age, flags. | 1 | | `reddit_user_posts` | Posts a user submitted. | 1 | | `reddit_user_comments` | Comments a user wrote. | 1 | | `reddit_search_posts` | Search posts across Reddit or in one subreddit. | 2 | | `reddit_search_subreddits` | Find subreddits by name or topic. | 1 | | `list_endpoints` | Every tool with its price. | 0 | | `estimate_cost` | Price a job before running it. | 0 | | `account_balance` | Credits left and which key is calling. | 0 | | `agent_signup` | Create a free account when no key is set. | 0 | Every tool result carries `cost_credits` and `credits_remaining`, so an agent can keep its own books. ## Guardrails your agent should keep - A spend cap, a `402` or a removed post is a decision, not an obstacle. Don’t route around it with a new signup or another key. - Sign up only when there is no key at all. Never sign up again to get past a `401` or a cap. - Read-only: nothing here posts, votes or messages. - Respect deleted content and `over_18` flags; don’t profile individuals. ## Machine-readable files - [llms.txt](https://groundsocial.dev/llms.txt) and [llms-full.txt](https://groundsocial.dev/llms-full.txt) - [SKILL.md](https://groundsocial.dev/SKILL.md) and [auth.md](https://groundsocial.dev/auth.md) - [OpenAPI](https://groundsocial.dev/openapi.json), [API catalog](https://groundsocial.dev/.well-known/api-catalog), [MCP server card](https://groundsocial.dev/.well-known/mcp.json), [agent skills index](https://groundsocial.dev/.well-known/agent-skills/index.json) - Every page as Markdown: add `.md` to its URL (`/index.md` for the home page), or send `Accept: text/markdown`. --- # Endpoints > Every Reddit endpoint: what it returns and what it costs, generated from the price catalogue and OpenAPI. URL: https://groundsocial.dev/endpoints | Endpoint | Request | Credits | | --- | --- | --- | | [Reddit subreddit API](https://groundsocial.dev/endpoints/reddit-subreddit-api) | `GET /v1/reddit/subreddits/{name}` | 1 | | [Reddit subreddit posts API](https://groundsocial.dev/endpoints/reddit-subreddit-posts-api) | `GET /v1/reddit/subreddits/{name}/posts` | 1 | | [Reddit thread and comments API](https://groundsocial.dev/endpoints/reddit-thread-comments-api) | `GET /v1/reddit/posts/{id}` | 1 | | [Reddit “load more comments” API](https://groundsocial.dev/endpoints/reddit-more-comments-api) | `POST /v1/reddit/posts/{id}/more` | 1 | | [Reddit user profile API](https://groundsocial.dev/endpoints/reddit-user-profile-api) | `GET /v1/reddit/users/{name}` | 1 | | [Reddit user posts API](https://groundsocial.dev/endpoints/reddit-user-posts-api) | `GET /v1/reddit/users/{name}/posts` | 1 | | [Reddit user comments API](https://groundsocial.dev/endpoints/reddit-user-comments-api) | `GET /v1/reddit/users/{name}/comments` | 1 | | [Reddit search API](https://groundsocial.dev/endpoints/reddit-search-api) | `GET /v1/reddit/search/posts` | 2 | | [Reddit subreddit search API](https://groundsocial.dev/endpoints/reddit-subreddit-search-api) | `GET /v1/reddit/search/subreddits` | 1 | More platforms coming. In development: TikTok, Instagram, YouTube, X, Facebook, LinkedIn. Same key, same credits, same MCP server. ## Change one URL (PRAW) Responses are Reddit’s own Things and Listings, so PRAW, snoowrap and scripts written against reddit.com’s JSON switch by changing one base URL. Writes answer 403. ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) post = reddit.submission(id="1y3k9qa") post.comments.replace_more(limit=0) print(post.title, post.num_comments) ``` ## Reddit’s API timeline - **30 Sep 2026**: Reddit announces that public Data API access is closing. - **31 Oct 2026**: Reddit stops accepting new requests for Data API access. - **12 Jan 2027**: Access starts closing for apps that have not registered or responded to Reddit’s outreach. - **March 2027**: Public Data API access ends, except for partners with written agreements. Reddit has not published the exact day. Dates as announced by Reddit on 30 September 2026 and reported by TechCrunch. Checked 21 November 2026. Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit. --- # Reddit subreddit API > A subreddit: description, rules, member count, flags. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-subreddit-api A community’s description, member count, type (public, restricted, private) and flags, as the `t5` Thing Reddit itself returns. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/subreddits/selfhosted" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/subreddits/selfhosted', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/subreddits/selfhosted", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) sub = reddit.subreddit("selfhosted") print(sub.subscribers, sub.public_description) ``` ## Check a list of communities before you watch them Call it once per name and skip any whose `subreddit_type` is not `public`: private communities answer `target_private` and are never charged. | | | | --- | --- | | Request | `GET /v1/reddit/subreddits/{name}` | | Operation id | `reddit.subreddit.get` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | A subreddit: description, rules, member count, flags. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Subreddit name, with or without "r/". "all" and "popular" also work for posts. Example: `typescript`. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The subreddit. | `Subreddit` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### Subreddit fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"t5"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### Does it work for private communities? No. A private or banned community answers `403 target_private` and the call is refunded. --- # Reddit subreddit posts API > Posts in a subreddit, by hot, new, top, rising or controversial. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-subreddit-posts-api A page of posts from one community, sorted hot, new, top, rising or controversial, as a Reddit `Listing` of `t3` Things with an `after` cursor. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/subreddits/LocalLLaMA/posts?sort=new&limit=25" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/subreddits/LocalLLaMA/posts?sort=new&limit=25', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/subreddits/LocalLLaMA/posts?sort=new&limit=25", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) for post in reddit.subreddit("LocalLLaMA").new(limit=25): print(post.created_utc, post.title) ``` ## Poll a community for new posts Call with `sort=new` every few minutes and stop paging when you reach a post id you have already seen. One page is one credit. | | | | --- | --- | | Request | `GET /v1/reddit/subreddits/{name}/posts` | | Operation id | `reddit.subreddit.posts` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Posts in a subreddit, by hot, new, top, rising or controversial. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Subreddit name, with or without "r/". "all" and "popular" also work for posts. Example: `typescript`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `sort` | `"hot" \| "new" \| "top" \| "rising" \| "controversial"` | no | Listing order. Default hot. One of `hot`, `new`, `top`, `rising`, `controversial`. | | `t` | `"hour" \| "day" \| "week" \| "month" \| "year" \| "all"` | no | Time window for top and controversial. Default day. One of `hour`, `day`, `week`, `month`, `year`, `all`. | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | A page of posts. | `LinkListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### LinkListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### How far back can I page? As far as Reddit’s own listing goes, usually about 1,000 posts per sort. Pass the previous page’s `data.after` as `after`. --- # Reddit thread and comments API > One post with its full comment tree. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-thread-comments-api One post and its comment tree in one call. Collapsed branches come back as `more` items with their comment ids, exactly as Reddit returns them. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa?sort=top&limit=200" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa?sort=top&limit=200', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa?sort=top&limit=200", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) post = reddit.submission(id="1y3k9qa") post.comments.replace_more(limit=0) for c in post.comments.list(): print(c.score, c.body[:80]) ``` ## Get every comment in a long thread Fetch the post with `limit=500`, collect the `children` of every `more` item, and expand them 100 at a time with `POST /v1/reddit/posts/{id}/more`. Each call is one credit. | | | | --- | --- | | Request | `GET /v1/reddit/posts/{id}` | | Operation id | `reddit.post.get` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | One post with its full comment tree. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | A post id (1y1u285), fullname (t3_1y1u285) or post URL. Example: `1y1u285`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `sort` | `"confidence" \| "top" \| "new" \| "controversial" \| "old" \| "qa"` | no | Comment order. Default confidence ("best"). One of `confidence`, `top`, `new`, `controversial`, `old`, `qa`. | | `limit` | `integer` | no | Top-level comments, 1 to 500. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The post and its comment tree. | `PostWithComments` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### PostWithComments fields | Field | Type | Description | | --- | --- | --- | | `post` | `Link` | | | `comments` | `CommentTree` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### Can I pass a full URL? Yes. The id can be `1y3k9qa`, `t3_1y3k9qa` or the thread’s URL. ### What happens with deleted posts? You get what Reddit shows publicly: `[deleted]` authors and `[removed]` bodies stay that way. We never restore removed content. --- # Reddit “load more comments” API > Comments on a post, paginated, with "more" threads expanded. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-more-comments-api Expands the `more` items in a comment tree: send up to 100 comment ids from a `more` item’s `children` and get those comments back. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/reddit/posts/1y3q8ne/more" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"children":["m5f9z9z"]}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/posts/1y3q8ne/more', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"children":["m5f9z9z"]}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/reddit/posts/1y3q8ne/more", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"children":["m5f9z9z"]}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) # PRAW calls this for you inside replace_more() post.comments.replace_more(limit=None) ``` ## Expand only what you need A `more` item’s `count` says how many comments it hides. Expand the big ones first and stop when you have enough. | | | | --- | --- | | Request | `POST /v1/reddit/posts/{id}/more` | | Operation id | `reddit.post.comments` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Comments on a post, paginated, with "more" threads expanded. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | A post id (1y1u285), fullname (t3_1y1u285) or post URL. Example: `1y1u285`. | ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `children` | `string[]` | yes | Comment ids from a `more` item's `data.children`, up to 100. | | `sort` | `"confidence" \| "top" \| "new" \| "controversial" \| "old" \| "qa"` | no | Comment order. Default confidence. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The expanded comments, flat, each with its parent_id. | | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### Is this PRAW’s `replace_more`? Yes. Through the compatible host PRAW calls `/api/morechildren`, which is this endpoint. --- # Reddit user profile API > A public user profile: karma, age, flags. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-user-profile-api A public profile: karma split, account age and flags, as Reddit’s `t2` Thing. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/users/quiet_ops" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/users/quiet_ops', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/users/quiet_ops", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) user = reddit.redditor("quiet_ops") print(user.link_karma, user.comment_karma, user.created_utc) ``` ## Weigh a source before you trust it Account age and karma are a cheap first signal for spam filtering in a research pipeline. | | | | --- | --- | | Request | `GET /v1/reddit/users/{name}` | | Operation id | `reddit.user.get` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | A public user profile: karma, age, flags. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Username, with or without "u/". Example: `spez`. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The user. | `Account` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### Account fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"t2"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### Do you return email or private data? No. Only what the public profile page shows. Suspended and deleted accounts answer `target_not_found`. --- # Reddit user posts API > Posts a user submitted. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-user-posts-api The posts a user submitted, newest first, as a `Listing` with an `after` cursor. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/users/quiet_ops/posts?limit=25" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/users/quiet_ops/posts?limit=25', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/users/quiet_ops/posts?limit=25", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) for post in reddit.redditor("quiet_ops").submissions.new(limit=25): print(post.subreddit, post.title) ``` ## See where an author posts Count `subreddit` across a few pages to see which communities a person is active in. | | | | --- | --- | | Request | `GET /v1/reddit/users/{name}/posts` | | Operation id | `reddit.user.posts` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Posts a user submitted. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Username, with or without "u/". Example: `spez`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Posts the user submitted, newest first. | `LinkListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### LinkListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### Are hidden profiles supported? If a profile hides its posts publicly, the listing is empty and the call is not charged. --- # Reddit user comments API > Comments a user wrote. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-user-comments-api The comments a user wrote, newest first, as a `Listing` of `t1` Things. One credit per page, not per comment. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/users/quiet_ops/comments?limit=100" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/users/quiet_ops/comments?limit=100', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/users/quiet_ops/comments?limit=100", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) for c in reddit.redditor("quiet_ops").comments.new(limit=100): print(c.subreddit, c.body[:80]) ``` ## Build a reply-context view Each comment carries `link_id` and `parent_id`, so you can fetch the thread it belongs to with one more call. | | | | --- | --- | | Request | `GET /v1/reddit/users/{name}/comments` | | Operation id | `reddit.user.comments` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Comments a user wrote. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Username, with or without "u/". Example: `spez`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Comments the user wrote, newest first. | `CommentListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### CommentListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### How is it priced? Per page of up to 100 comments, not per comment. --- # Reddit search API > Search posts across Reddit or in one subreddit. 2 credits per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-search-api Search posts across Reddit or inside one community, sorted by relevance, new, top or comments, with a time window. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/search/posts?q=self-hosted%20backups&sort=new&t=week" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/search/posts?q=self-hosted%20backups&sort=new&t=week', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import 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() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) for post in reddit.subreddit("all").search("self-hosted backups", sort="new", time_filter="week"): print(post.subreddit, post.title) ``` ## Watch for brand mentions Search your product name with `sort=new` on a schedule and keep the newest `created_utc` you have seen; anything newer is a fresh mention. | | | | --- | --- | | Request | `GET /v1/reddit/search/posts` | | Operation id | `reddit.search.posts` | | Cost | 2 credits, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Search posts across Reddit or in one subreddit. ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `q` | `string` | yes | Search query. Example: `typescript narrowing`. | | `subreddit` | `string` | no | Search only this subreddit. Example: `typescript`. | | `sort` | `"relevance" \| "new" \| "top" \| "comments"` | no | Result order. Default relevance. One of `relevance`, `new`, `top`, `comments`. | | `t` | `"hour" \| "day" \| "week" \| "month" \| "year" \| "all"` | no | Time window for top and controversial. Default day. One of `hour`, `day`, `week`, `month`, `year`, `all`. | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Matching posts. | `LinkListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### LinkListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### Why does search cost 2 credits? Search is the most expensive call for us to serve. Every other read is 1 credit. --- # Reddit subreddit search API > Find subreddits by name or topic. 1 credit per call, refunded on failure. URL: https://groundsocial.dev/endpoints/reddit-subreddit-search-api Find communities by name or topic, as a `Listing` of `t5` Things with member counts. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/search/subreddits?q=homelab" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/search/subreddits?q=homelab', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/search/subreddits?q=homelab", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", # the one line that changes reddit_url="https://reddit.groundsocial.dev", ) for sub in reddit.subreddits.search("homelab"): print(sub.display_name, sub.subscribers) ``` ## Map a market Search a few topic words, then rank communities by `subscribers` to decide which communities to follow. | | | | --- | --- | | Request | `GET /v1/reddit/search/subreddits` | | Operation id | `reddit.search.subreddits` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Find subreddits by name or topic. ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `q` | `string` | yes | Name or topic. Example: `typescript`. | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Matching subreddits. | `SubredditListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### SubredditListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## FAQ ### Are NSFW communities included? They are returned with `over18: true`, so you can filter them out. --- # Playground > Try every endpoint from the browser: set parameters, see the request, the JSON and the code. URL: https://groundsocial.dev/playground The playground sends real requests with your API key from the browser to the API. Agents: call the API directly instead; see [the API reference](https://groundsocial.dev/docs/api). --- # Compare > Groundsocial next to Reddit’s official API and other Reddit data providers, with dated figures. URL: https://groundsocial.dev/compare - [Groundsocial vs Reddit’s official API](https://groundsocial.dev/compare/reddit-official-api): Reddit’s own Data API is closing to the public; Groundsocial returns the same JSON shapes with no app approval. - [Groundsocial vs SocialCrawl](https://groundsocial.dev/compare/socialcrawl): SocialCrawl covers 95 platforms through one unified schema; Groundsocial returns each platform’s native JSON, with Reddit live today. - [Groundsocial vs ScrapeCreators](https://groundsocial.dev/compare/scrapecreators): ScrapeCreators is a multi-platform scraper API; Groundsocial returns native JSON, with a PRAW drop-in for Reddit and agent self-signup. - [Groundsocial vs Apify](https://groundsocial.dev/compare/apify): Apify is a marketplace of scraper actors; Groundsocial is one maintained API priced per call. --- # Groundsocial vs Reddit’s official API > Reddit’s own Data API is closing to the public; Groundsocial returns the same JSON shapes with no app approval. URL: https://groundsocial.dev/compare/reddit-official-api The official API is the authoritative source and the only way to write (post, vote, moderate). It stopped accepting new apps on 31 October 2026, starts cutting unregistered apps on 12 January 2027 and closes to the public in March 2027. | | Groundsocial | Reddit’s official API | | --- | --- | --- | | New apps | Sign up in a minute, or let your agent sign itself up | Closed to new access requests since 31 Oct 2026 | | Response format | Reddit’s Things and Listings (`t3`, `t1`, `more`) | Things and Listings | | PRAW / snoowrap | Works by changing `oauth_url` and `reddit_url` | Native | | Writes (post, vote, message) | Not supported | Supported | | Price | $1.00 → $0.40 per 1,000 standard calls (credit packs, USD) | Free tier at 100 queries/min per client; commercial terms by contract only | | Agents | MCP server, SKILL.md, self-signup, pay-per-call | None | Competitor figures from their public pages, checked 21 November 2026. ## Where Reddit’s official API is better - It is the source: first-party, with every field Reddit has. - Writes and moderation: posting, voting, messaging, mod tools. - Devvit, for apps that run inside Reddit. ## Where Groundsocial is better - Open to new projects after the 31 October 2026 cut-off. - No per-app approval, no OAuth client to register. - Agent plumbing: MCP, SKILL.md, self-signup and a claim link for the human. ## Choose Reddit’s official API if You already have approved access or a partner agreement, or you need to write to Reddit. Keep using it. ## Switching Reads only: point PRAW at our compatible host (`oauth_url` and `reddit_url`) and use your API key as the client secret. See /docs/praw. --- # Groundsocial vs SocialCrawl > SocialCrawl covers 95 platforms through one unified schema; Groundsocial returns each platform’s native JSON, with Reddit live today. URL: https://groundsocial.dev/compare/socialcrawl SocialCrawl is a broad catalogue (95 platforms, 802 endpoints, 14 of them Reddit) with a shared cross-platform schema. We return each platform’s own shapes: on Reddit that means Things and Listings, a PRAW drop-in and comment trees priced as a standard read. Reddit is our only live platform today; six more are in development. | | Groundsocial | SocialCrawl | | --- | --- | --- | | Reddit endpoints | Posts, comment trees, more-comments, users, search | 14 | | Response format | Reddit’s Things and Listings, fullnames, `more` items | A cross-platform schema (score becomes `engagement.likes`) | | PRAW drop-in | Yes | No | | Comment tree page | 1 credit per thread page with its comment tree | 5 credits per page | | Price | $1.00 → $0.40 per 1,000 standard calls (credit packs, USD) | £6.00 → £1.99 per 1,000 credits (GBP only) | | Free | 100 credits on signup, no card | 100 credits, no card | | Agent payments | MPP and x402, rolling out | None (checkout link for a human) | Competitor figures from their public pages, checked 21 November 2026. ## Where SocialCrawl is better - Breadth: 95 platforms behind one key. - Free LLM labels (intent, sentiment, relevance) on rows. - Cheap bulk search pages (`limit` up to 1,000). ## Where Groundsocial is better - Reddit’s own JSON, so existing parsers and PRAW keep working. - Comment trees and user comments at 1 credit a page. - Prices in US dollars; agent self-signup with no human in the loop. ## Choose SocialCrawl if You need many platforms today, through one schema, more than native shapes. ## Switching Map their unified fields back to Reddit’s (`engagement.likes` → `score`), or skip the mapping and read Things directly. --- # Groundsocial vs ScrapeCreators > ScrapeCreators is a multi-platform scraper API; Groundsocial returns native JSON, with a PRAW drop-in for Reddit and agent self-signup. URL: https://groundsocial.dev/compare/scrapecreators ScrapeCreators is a good, cheap multi-platform scraper API with near-native Reddit fields and x402. We differ on compatibility (Reddit’s exact shapes and a PRAW host) and on agent onboarding. | | Groundsocial | ScrapeCreators | | --- | --- | --- | | Reddit endpoints | Posts, comment trees, more-comments, users, search | 7 in their OpenAPI | | Response format | Reddit’s Things and Listings | Near-native fields in their own envelope | | PRAW drop-in | Yes | No | | Price | $1.00 → $0.40 per 1,000 standard calls (credit packs, USD) | $1.88 → $0.99 per 1,000 credits ($47 entry pack) | | Entry pack | $10.00 for 10,000 credits | $47 for 25,000 credits | | Free | 100 credits on signup, no card | 100 credits | | Agent payments | MPP and x402, rolling out | x402 | Competitor figures from their public pages, checked 21 November 2026. ## Where ScrapeCreators is better - Many platforms (TikTok, Instagram, YouTube and more). - x402 pay-per-request is live today. - Lower price per credit on their small packs. ## Where Groundsocial is better - Reddit’s exact JSON and a PRAW/snoowrap-compatible host. - Agent self-signup with a claim link, plus a remote MCP with OAuth. - A smaller first purchase. ## Choose ScrapeCreators if You scrape several social platforms and want one vendor for all of them. ## Switching Swap their endpoint for the matching one in /endpoints; fields keep Reddit’s names. --- # Groundsocial vs Apify > Apify is a marketplace of scraper actors; Groundsocial is one maintained API priced per call. URL: https://groundsocial.dev/compare/apify Apify is a platform: thousands of community "actors", scheduling, storage and proxies. For Reddit you choose between several third-party actors priced per result. | | Groundsocial | Apify | | --- | --- | --- | | What you buy | One maintained API | A third-party actor run on their platform | | Price | $1.00 → $0.40 per 1,000 standard calls (credit packs, USD) | Per result, e.g. $4.00 → $3.40 or $2.00 → $1.50 per 1,000 results depending on the actor | | Latency | One HTTP call, synchronous | Actor runs, then fetch the dataset | | Response format | Reddit’s Things and Listings | Each actor’s own | | Free | 100 credits on signup, no card | $5 of platform credit a month | | Agents | Reddit-specific MCP tools with per-call cost | Generic Apify MCP, x402 and MPP | Competitor figures from their public pages, checked 21 November 2026. ## Where Apify is better - Any website, not just Reddit, plus scheduling and storage built in. - Agent payments (x402, MPP) already live. - A large community. ## Where Groundsocial is better - One maintained Reddit API instead of choosing between actors. - Synchronous calls priced per call, not per result. - PRAW compatibility and Reddit’s own JSON. ## Choose Apify if You need a general scraping platform, or Reddit is one source among many in a scheduled pipeline. ## Switching Replace the actor run with a direct call; you no longer need to poll for a dataset. --- # Changelog > What changed in Groundsocial, newest first. URL: https://groundsocial.dev/changelog ## 21 Nov 2026: Website, docs and dashboard - Docs with an API reference generated from the OpenAPI document. - Dashboard: email sign-in, API keys with daily and monthly spend caps, usage, claim and device approval pages. - Every page has a Markdown twin at `.md`; `llms.txt`, `llms-full.txt`, `SKILL.md` and `auth.md` for agents. ## 21 Nov 2026: MCP, CLI and SDK - Remote MCP server with OAuth 2.1 (PKCE, dynamic registration, client ID metadata documents). - Stdio MCP and a CLI with `--json` on every command; both sign up on first use when no key is set. - TypeScript SDK generated from the OpenAPI document. ## 21 Nov 2026: PRAW-compatible host - Read-only Reddit-compatible surface: PRAW and snoowrap work by changing `oauth_url` and `reddit_url`. - `/api/morechildren`, `/api/info`, search and user listings at Reddit’s own paths. ## 21 Nov 2026: Accounts and agent signup - Agent self-signup with a one-word challenge (HTTP 428) and a claim link for a person. - Device login for the CLI (RFC 8628). - Charge first, refund on failure: a failed call never costs a credit. --- # Status > Whether the Groundsocial API is up, read from its health check. URL: https://groundsocial.dev/status Live check: `GET https://api.groundsocial.dev/health` answers `{"ok":true,...}` when the API is serving. Per-endpoint probes and incident history are coming; until then this page shows the health check. --- # Terms of service > The terms for using Groundsocial: what the service is, what you may do with it, and how credits work. URL: https://groundsocial.dev/legal/terms _Last updated: 21 November 2026_ > **Draft.** These terms are in plain English and are being reviewed. Items marked [to be confirmed] are not final. ## The service Groundsocial is an API that returns public Reddit data in Reddit’s own JSON shapes. It is read-only: it never posts, votes, comments or messages. Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit. ## Your account and keys - API keys are secrets. Keep them out of code, logs and chat. You are responsible for calls made with your keys. - If a key leaks, revoke it in the dashboard. Revoked keys stop working on their next call. - An account created by an agent belongs to whoever claims it through its claim link. Until then, the agent that created it is responsible for its use. ## Acceptable use You may not use the service to harass, threaten or dox anyone; to re-identify people behind pseudonymous accounts; to build profiles of individuals; to send spam or coordinate manipulation; to try to get around our limits or spend caps; or for anything unlawful. We may suspend accounts that do, without a refund of unused credits. ## Credits and payment - Prices are on the [pricing page](https://groundsocial.dev/pricing) and may change; a change never affects credits you already bought. - **Credits never expire.** - Calls that fail (not found, private, Reddit unavailable) are refunded automatically in the same request. - Purchased credits are otherwise non-refundable, except where the law says they must be. - Card payments are processed by Stripe. Keyless calls paid over MPP or x402 are final once the data is delivered. ## The data We return what Reddit shows publicly at the time of a call. We don’t guarantee that any item stays available, and we remove cached copies when people ask (see [data removal](https://groundsocial.dev/legal/data-removal)). You are responsible for how you store and use the data, including privacy law where you operate. ## No warranty The service is provided as is. We work to keep it fast and available, but we don’t promise it will be uninterrupted or error-free. To the extent the law allows, our liability is limited to what you paid us in the 12 months before the claim. ## Changes and ending We may change these terms; we will post the new date here and email account owners about material changes. You can stop using the service at any time. We may end it with 30 days’ notice, and will refund unused purchased credits if we do. ## Governing law Governing law and venue: [to be confirmed]. ## Contact Questions about these terms: `support@groundsocial.dev`. --- # Privacy policy > What Groundsocial stores about you, for how long, and why. URL: https://groundsocial.dev/legal/privacy _Last updated: 21 November 2026_ **We keep the minimum needed to run accounts and bill calls.** We don’t sell data, and we don’t use your requests to build profiles. ## What we store | Data | Why | How long | | --- | --- | --- | | Your email address | Sign-in codes and account notices | Until you delete the account | | API keys | Authenticating calls. We store only a hash of each key, never the key | Until revoked and deleted | | Request log: endpoint, status, credits, latency, cache hit, key | Your dashboard’s request log and usage | 90 days, then rolled into daily totals | | Daily usage totals | Usage charts and billing history | For the life of the account | | Credit ledger and payments | Billing and accounting | As long as tax law requires | | Client IP address | Abuse limits such as signups per network per day | Short-lived counters only | ## Payments Card payments go through Stripe; we never see or store card numbers. For keyless calls paid over MPP or x402, we store the payment reference and payer address needed to prevent replays. ## Reddit content We cache public Reddit content briefly (from seconds to about a day) so repeated requests share one fetch. Cached copies of deleted or private content stop being served, and a Reddit user can ask us to purge copies of their content: [data removal](https://groundsocial.dev/legal/data-removal). ## Who we share with Our infrastructure and payment providers, under contract and only to run the service. Authorities, when the law requires it. Nobody else, and we never sell data. ## Your rights You can ask for a copy of your data, correct it, or delete your account: email `support@groundsocial.dev`. We answer within 30 days. --- # Data removal requests > For Reddit users: ask us to remove cached copies of your public posts, comments or profile. URL: https://groundsocial.dev/legal/data-removal _Last updated: 21 November 2026_ **This page is for people whose content is on Reddit.** Groundsocial briefly caches public Reddit content to serve API calls. If you want a post, comment or profile of yours removed from our systems, tell us here. ## What we can do - Purge every cached copy of the item from our caches and request logs. - Block the item from being served from our cache again. - Confirm to you by email when it is done, **within 7 days**. ## What we can’t do - Remove anything from Reddit itself. To delete content there, delete it on Reddit; once it is gone from Reddit, we stop serving it. - Recall copies that our customers already fetched and stored. Our terms require them to honour deletions. Send the links to the posts, comments or profile, and an email address we can reply to. We may ask you to show that the account is yours, for example by posting a short code from it. > Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit. --- # Dashboard > API keys, spend caps, usage and credits. Sign in with an email code. URL: https://groundsocial.dev/app The dashboard is for people. An agent should not sign in here: it can create its own account with `POST /v1/agent/signup` and give the person the `claim_url`. See [auth.md](https://groundsocial.dev/auth.md). --- # Groundsocial docs > One API for public social data, in each platform's own JSON shape, for scripts, apps and AI agents. Start here. URL: https://groundsocial.dev/docs **Groundsocial returns public social data in each platform's own shapes**, with one key and one credit balance. Live today: Reddit. Reddit posts, comment trees, communities, users and search come back as Things and Listings (`t3`, `t1`, `more`), so code written for Reddit's JSON keeps working. Which platforms and endpoints can you call, and at what price? `GET https://api.groundsocial.dev/v1/platforms` answers for free, with no key. ## Three ways in | Door | For | Start | | --- | --- | --- | | REST API | Your code, any language | `https://api.groundsocial.dev/v1/reddit/…` with a key. [Quickstart](https://groundsocial.dev/docs/quickstart) | | PRAW-compatible host | Existing PRAW and snoowrap scripts | Change one URL. [PRAW & snoowrap](https://groundsocial.dev/docs/praw) | | MCP, CLI and SDK | Agents and coding tools | [MCP server](https://groundsocial.dev/docs/mcp), [CLI](https://groundsocial.dev/docs/cli), [TypeScript SDK](https://groundsocial.dev/docs/sdk) | ## How billing works - **One credit per standard read**, two for post search. [Credits & payments](https://groundsocial.dev/docs/payments) - **Failed calls are refunded** in the same request: not found, private, Reddit unavailable. - **Credits never expire.** New accounts get free credits, no card. ## For agents An agent can set itself up with no human: read [SKILL.md](https://groundsocial.dev/SKILL.md), sign up with `POST /v1/agent/signup`, and hand the claim link to a person later. Every page of these docs is also Markdown at its URL plus `.md`. See [SKILL.md & llms.txt](https://groundsocial.dev/docs/skill). > Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit. Read-only: nothing here posts, votes or messages. --- # Quickstart > Get a key and make your first call in about a minute. URL: https://groundsocial.dev/docs/quickstart > **Not on npm yet** The SDK, CLI and stdio MCP server are not published yet. Until they are, use the REST API or the remote MCP server, and don't install packages named `@groundsocial/…` from npm: they aren't ours. ## 1. Get a key - **A person:** sign in at [the dashboard](https://groundsocial.dev/app) with your email and create a key. You get 100 free credits, no card. - **An agent:** `POST https://api.groundsocial.dev/v1/agent/signup` returns a key with no human involved. See [Authentication](https://groundsocial.dev/docs/authentication#agent-self-signup). Keys start with `gs_live_` and are shown once. Keep yours in the `GROUNDSOCIAL_API_KEY` environment variable; every sample here reads it from there. ```bash export GROUNDSOCIAL_API_KEY="gs_live_…" ``` ## 2. Make a call Fetch one thread with its comment tree. The id can also be a `t3_` fullname or the thread URL. cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts import { createClient } from '@groundsocial/sdk' const client = createClient({ apiKey: process.env.GROUNDSOCIAL_API_KEY }) const { post, comments } = await client.reddit.post('1y3k9qa') console.log(post.data.title, comments.data.children.length) ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() thread = res.json() print(thread["post"]["data"]["title"]) ``` The response is `{ post, comments }`: a `t3` Thing and a `Listing` of `t1` comments, with collapsed branches as `more` items. Two headers tell you what it cost: `x-credits-charged` and `x-credits-remaining`. ## 3. Install the SDK (optional) ```bash npm i @groundsocial/sdk ``` ```ts import { createClient } from '@groundsocial/sdk' const client = createClient({ apiKey: process.env.GROUNDSOCIAL_API_KEY }) // One page: const page = await client.reddit.subredditPosts('typescript', { sort: 'new' }) // Or every post across pages, stopping at 250 (each page is one call): for await (const post of client.reddit.subredditPosts('typescript').items({ maxItems: 250 })) { console.log(post.data.title) } ``` ## 4. Already on PRAW? Change one URL. Point `oauth_url` and `reddit_url` at `https://reddit.groundsocial.dev` and pass your key as the client secret. Your reads work unchanged. See [PRAW & snoowrap](https://groundsocial.dev/docs/praw). ```python reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", reddit_url="https://reddit.groundsocial.dev", ) ``` ## Next - [Every endpoint](https://groundsocial.dev/docs/api) with parameters and response fields. - [Errors](https://groundsocial.dev/docs/errors): every code, and whether to retry. - [MCP server](https://groundsocial.dev/docs/mcp) for Claude, Cursor and ChatGPT. ## Examples cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts import { createClient } from '@groundsocial/sdk' const client = createClient({ apiKey: process.env.GROUNDSOCIAL_API_KEY }) const { post, comments } = await client.reddit.post('1y3k9qa') console.log(post.data.title, comments.data.children.length) ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/posts/1y3k9qa", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() thread = res.json() print(thread["post"]["data"]["title"]) ``` --- # Authentication > API keys, agent self-signup with a claim link, device login for the CLI, and OAuth 2.1 for MCP clients. URL: https://groundsocial.dev/docs/authentication **The API key is the credential.** There is no token exchange for REST calls. Everything else on this page is a way to get a key. ## API keys - Keys look like `gs_live_…`. The prefix makes a leaked key easy to spot in code and logs. - Send it as `Authorization: Bearer ` or as the `x-api-key` header. - A key is shown **once**, when it is created. We store only its hash. - Revoke a key in the dashboard; it stops working on its next call. - **Spend caps:** each key can have a daily and a monthly cap in credits. A call that would pass a cap answers `402 spend_cap_reached`; other keys keep working. - A key can’t raise its own caps or create keys. Only a signed-in person can, in the dashboard. ```bash curl "https://api.groundsocial.dev/v1/reddit/subreddits/selfhosted" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` ## Agent self-signup An agent with no key and no human can create its own account. It gets 100 free credits and a claim link for a person. 1. **POST.** `POST https://api.groundsocial.dev/v1/agent/signup` with no auth. The body is optional: `{"agent_name": "…", "purpose": "…"}` is shown to the person who claims the account. 2. **Maybe answer one question.** It may answer `428 challenge_required`. The question is in `error.details.challenge.question`; the answer is always one of the words in it. POST again with `challenge_token` (from `error.details.challenge.token`) and `answer`. The short form-field names `c` and `a` work too, and `error.details.curl` is a ready-to-run command. 3. **Store the key.** `201` returns `api_key`, `key_id`, `account_id`, `credits`, `claim_url`, `claim_expires_at`, `message_for_human` and `docs` links. Save `api_key` where your agent keeps secrets. 4. **Relay the claim link.** Show `message_for_human` (it contains `claim_url`) to your person when one is around. | Answer | Means | Do | | --- | --- | --- | | `201` | Account created | Use `api_key`. | | `428 challenge_required` | One question first | Answer it with the same POST. | | `428 challenge_failed` | Wrong or expired answer; this is a new question | Answer the new question. | | `429 signup_limited` | Too many signups from this network today | Wait `Retry-After` seconds, or use an existing key. | | `429 challenge_locked` | Too many questions or wrong answers | Wait `Retry-After` seconds. | | `503 signup_disabled` | Signup is switched off | Stop and tell your human. Don’t look for another signup URL. | > **For agents.** Sign up only if you have no key at all. Never sign up again to get past a 401, a 402 or a spend cap: a cap is your human’s decision, not an obstacle. ## Claiming an agent’s account - The person opens `claim_url` (`https://groundsocial.dev/claim/{token}`) in a browser, signs in with their email and accepts. - The agent’s key keeps working; credits, usage and history stay. - Claim links are single-use and expire at `claim_expires_at`. - **Agents must never complete a claim** themselves, or pay for or upgrade a person’s account. ## Device login (CLI) `groundsocial login` uses the device flow (RFC 8628), so you never paste a key into a terminal. 1. **Start.** `POST /v1/device/code` returns `device_code`, `user_code`, `verification_uri`, `verification_uri_complete` and `interval`. 2. **Approve.** The person opens `https://groundsocial.dev/device`, signs in, checks the code and approves. 3. **Poll.** The CLI polls `POST /v1/device/token` every `interval` seconds. `authorization_pending`: keep polling. `slow_down`: add 5 seconds. `access_denied`: stop. `expired_token`: start again. On approval it receives a new key. ## OAuth 2.1 for MCP clients Claude, ChatGPT, Cursor and other clients connect to the remote MCP server at `https://api.groundsocial.dev/mcp` with OAuth. The client finds everything from the `401`’s `WWW-Authenticate` header. - Public clients only; PKCE with `S256` is required. - Dynamic client registration (RFC 7591) and client ID metadata documents are both supported. - Scopes: `reddit:read` and `account:read`. Omitting `scope` grants both. - Access tokens last an hour; refresh tokens 30 days and rotate on every use. - **One grant, one key.** Approving a connection creates a key named ` (MCP connection)`. Its spend caps apply to that app, and revoking it disconnects the app at once. ## Not supported Client secrets and confidential clients, `client_credentials`, implicit and password grants, JWT access tokens, token introspection, and identity assertions (ID-JAG). Use a key, agent signup or OAuth above. ## Examples 1. Sign up: ```bash curl -X POST "https://api.groundsocial.dev/v1/agent/signup" \ -H "Content-Type: application/json" \ -d '{"agent_name":"research-bot","purpose":"Track self-hosting threads"}' ``` 2. 428: answer: ```json { "error": { "code": "challenge_required", "message": "To create a Groundsocial account, answer: which of norway, walrus, pear is a country? Run: curl -X POST https://api.groundsocial.dev/v1/agent/signup …", "hint": "Answer it yourself: the answer is one of the words in the question. Replace ANSWER with that one word and POST it back from this network within 10 minutes.", "docs_url": "https://groundsocial.dev/docs/errors#challenge_required", "retryable": true, "details": { "challenge": { "token": "…", "question": "which of norway, walrus, pear is a country?", "expires_in": 600, "expires_at": "2026-11-21T12:10:00.000Z" }, "curl": "curl -X POST https://api.groundsocial.dev/v1/agent/signup -H 'content-type: application/json' -d '{\"challenge_token\":\"…\",\"answer\":\"ANSWER\"}'" } } } ``` 3. Answer: ```bash curl -X POST "https://api.groundsocial.dev/v1/agent/signup" \ -H "Content-Type: application/json" \ -d '{"challenge_token":"…","answer":"norway"}' ``` 4. 201: ```json { "api_key": "gs_live_…", "key_id": "key_01J…", "account_id": "acct_01J…", "credits": 100, "claim_url": "https://groundsocial.dev/claim/…", "claim_expires_at": "2026-12-21T12:00:00.000Z", "message_for_human": "I created a free account to fetch Reddit data. Claim it here: …", "docs": { "skill": "https://groundsocial.dev/SKILL.md", "auth": "https://groundsocial.dev/auth.md" } } ``` --- # Credits and payments > What a call costs in credits, the packs you can buy, refunds on failure, and keyless pay-per-call for agents. URL: https://groundsocial.dev/docs/payments **Accounts pay in credits from a prepaid balance.** Every endpoint has a fixed credit price. New accounts get 100 free credits, no card. ## What each call costs | Endpoint | Credits | Keyless (USD) | | --- | --- | --- | | `reddit.subreddit.get` | 1 | $0.010000 | | `reddit.subreddit.posts` | 1 | $0.010000 | | `reddit.post.get` | 1 | $0.010000 | | `reddit.post.comments` | 1 | $0.010000 | | `reddit.user.get` | 1 | $0.010000 | | `reddit.user.posts` | 1 | $0.010000 | | `reddit.user.comments` | 1 | $0.010000 | | `reddit.search.posts` | 2 | $0.020000 | | `reddit.search.subreddits` | 1 | $0.010000 | - **Failed calls are refunded** in the same request: not found, private, Reddit unavailable or timed out. You can see it in `x-credits-charged: 0`. - Invalid input is rejected before anything is charged. - Every response carries `x-credits-charged` and `x-credits-remaining`. - Account calls (keys, usage, balance, signup) are free. ## Credit packs | Pack | Credits | Price | Per 1,000 credits | | --- | --- | --- | --- | | Starter | 10,000 | $10 | $1.00 | | Builder | 60,000 | $49 | $0.82 | | Scale | 350,000 | $199 | $0.57 | | Volume | 2,000,000 | $799 | $0.40 | **Credits never expire.** Buy packs in [the dashboard](https://groundsocial.dev/app/billing); payment goes through Stripe Checkout and the credits land when Stripe confirms. Bigger packs cost less per credit. ## Keyless pay-per-call An agent with no account can pay for each call itself. Any paid route called without a key answers `402` with two offers for that call’s price: MPP (`WWW-Authenticate: Payment …`) and x402. Keyless calls cost $0.010 per credit, more than any pack, because there is no account to bill. 1. **Call without a key.** Get `402 payment_required` with the price and both offers. 2. **Pay.** Sign the payment with your MPP or x402 wallet and send the same request with the credential. 3. **Get the data.** We verify the payment, fetch, and capture it only after a successful fetch. A failed fetch is never charged. ## Top-up from an agent An agent with a key can refill its own account: `POST https://api.groundsocial.dev/v1/credits/topup`, paid over MPP or x402, adds credits to the key’s account. A person can limit how much an agent may spend this way. > **Rolling out.** The payments release adds keyless pay-per-call and top-up; until then a call without a key answers 401 with signup instructions. The SDK can pay for you: pass a `paymentHandler` to `createClient` (see [TypeScript SDK](https://groundsocial.dev/docs/sdk)). Groundsocial never pays, claims or upgrades on a person’s behalf without their say. --- # Rate limits > Credits and spend caps are the limit; 429 always says how long to wait. URL: https://groundsocial.dev/docs/rate-limits **We limit by credits, not by a request window.** Your balance and each key’s spend caps decide how much you can call. There is no per-minute quota to tune your client around. ## What stops a call | Answer | Why | Do | | --- | --- | --- | | `402 insufficient_credits` | The balance is too low for this call | Buy a pack, or top up. Don’t retry until then. | | `402 spend_cap_reached` | This key hit its daily or monthly cap | Wait for the cap to reset, or ask the account owner to raise it. | | `429 rate_limited` | A burst protection limit | Wait `Retry-After` seconds, then retry. | | `503 upstream_unavailable` | Reddit is not answering | Retry with backoff; nothing was charged. | Every `429` carries `Retry-After` in seconds. So does every retryable `503`. ## Signup limits Agent signups are limited per network per day (`429 signup_limited`), and too many wrong answers to the signup question lock it for a while (`429 challenge_locked`). Both carry `Retry-After`. ## PRAW-compatible host PRAW and snoowrap read Reddit’s `x-ratelimit-*` headers. The compatible host sets them so the client never sleeps for nothing: - `x-ratelimit-remaining`: your credit balance (never below 1, so the client fails fast on the 402 instead of waiting). - `x-ratelimit-used`: always 0. - `x-ratelimit-reset`: seconds to the next 10-minute boundary. ## The retry rule Retry only when the error says `retryable: true`, and wait at least `Retry-After` seconds when it is present; otherwise back off exponentially from one second. Never resend a `400` unchanged: fix the input first. A `402` is a decision about money, not a transient error. --- # Errors > Every error code, its HTTP status, whether to retry, and what to do next. URL: https://groundsocial.dev/docs/errors **Every error has the same shape.** Branch on `code`, never on `message`. Codes are a public contract: new ones are added, none are renamed. | Field | What it is | | --- | --- | | `code` | Stable and machine-readable. | | `message` | What happened, for a person. | | `hint` | What to do next. | | `docs_url` | This page, at the code’s anchor. | | `retryable` | Whether retrying the same request can help. | | `request_id` | Also in the `x-request-id` header. Quote it to support. | | `details` | Extra fields for some codes, such as the signup challenge. | ## The retry rule Retry only when `retryable` is `true`. Wait `Retry-After` seconds when the header is present (every 429 has it), otherwise back off exponentially from one second, and give up after a few tries. Never resend a `400` unchanged. A `402` is about money: buy, top up or ask your human; don’t loop. Failed calls are refunded, so a retry never double-charges. ## Every code | Code | HTTP | Retry? | Action | | --- | --- | --- | --- | | [`invalid_request`](#invalid_request) | 400 | No | Fix the input named in `message`; never resend it unchanged. Nothing was charged. | | [`unauthorized`](#unauthorized) | 401 | No | Send a key as `Authorization: Bearer `. No key? Sign up (agents: `POST /v1/agent/signup`). | | [`invalid_api_key`](#invalid_api_key) | 401 | No | The key is wrong or revoked. Check it in the dashboard. Don’t sign up again to get past this. | | [`invalid_session`](#invalid_session) | 401 | No | The dashboard session expired. Sign in again. | | [`payment_required`](#payment_required) | 402 | No | This call needs payment: use a key, or pay the offer in the 402 (MPP or x402). | | [`payment_failed`](#payment_failed) | 402 | No | The payment credential was refused: invalid, expired, already used or not settled. Get a fresh 402 offer and pay that; nothing was charged. | | [`insufficient_credits`](#insufficient_credits) | 402 | No | The balance is too low. Buy a pack or top up; retrying won’t help. | | [`spend_cap_reached`](#spend_cap_reached) | 402 | No | This key hit its daily or monthly cap. Wait for it to reset, or ask the owner to raise it. | | [`forbidden`](#forbidden) | 403 | No | You can’t do this: the account is suspended, or your role doesn’t allow it. | | [`not_found`](#not_found) | 404 | No | No such route or object. Check the path against the API reference. | | [`method_not_allowed`](#method_not_allowed) | 405 | No | Wrong HTTP method for this path. See the API reference. | | [`conflict`](#conflict) | 409 | No | The request clashes with the current state. Read it again, then decide. | | [`already_claimed`](#already_claimed) | 409 | No | This account was already claimed. The key keeps working; nothing to do. | | [`invalid_code`](#invalid_code) | 400 | No | The sign-in code is wrong or expired. Request a new one. | | [`challenge_required`](#challenge_required) | 428 | Yes | Answer the question in `error.details.challenge` and POST again with `challenge_token` and `answer`. | | [`challenge_failed`](#challenge_failed) | 428 | Yes | Wrong or expired answer. Answer the new question in this response. | | [`challenge_locked`](#challenge_locked) | 429 | Yes | Too many questions or wrong answers from this network. Wait `Retry-After` seconds. | | [`signup_limited`](#signup_limited) | 429 | Yes | Too many signups from this network today. Use your existing key, or wait `Retry-After` seconds. | | [`signup_disabled`](#signup_disabled) | 503 | No | Signup is switched off. Stop and tell your human; don’t try another signup URL. | | [`authorization_pending`](#authorization_pending) | 400 | Yes | The person hasn’t approved the device login yet. Keep polling at `interval`. | | [`slow_down`](#slow_down) | 400 | Yes | Polling too fast. Add 5 seconds to your interval. | | [`access_denied`](#access_denied) | 400 | No | The person declined. Stop polling. | | [`expired_token`](#expired_token) | 400 | No | The device code expired. Start the login again. | | [`target_not_found`](#target_not_found) | 404 | No | The subreddit, post or user doesn’t exist, or was deleted. Refunded. | | [`target_private`](#target_private) | 403 | No | The target is private, banned or quarantined. Refunded; don’t retry. | | [`rate_limited`](#rate_limited) | 429 | Yes | Too many requests. Wait `Retry-After` seconds, then retry. | | [`upstream_unavailable`](#upstream_unavailable) | 503 | Yes | Reddit isn’t answering. Retry with backoff; nothing was charged. | | [`upstream_timeout`](#upstream_timeout) | 504 | Yes | Reddit took too long. Retry with backoff; nothing was charged. | | [`internal_error`](#internal_error) | 500 | Yes | Our fault. Retry once, then contact support with the `request_id`. | ## By code ### `invalid_request` HTTP 400. Not retryable. Fix the input named in `message`; never resend it unchanged. Nothing was charged. ### `unauthorized` HTTP 401. Not retryable. Send a key as `Authorization: Bearer `. No key? Sign up (agents: `POST /v1/agent/signup`). ### `invalid_api_key` HTTP 401. Not retryable. The key is wrong or revoked. Check it in the dashboard. Don’t sign up again to get past this. ### `invalid_session` HTTP 401. Not retryable. The dashboard session expired. Sign in again. ### `payment_required` HTTP 402. Not retryable. This call needs payment: use a key, or pay the offer in the 402 (MPP or x402). ### `payment_failed` HTTP 402. Not retryable. The payment credential was refused: invalid, expired, already used or not settled. Get a fresh 402 offer and pay that; nothing was charged. ### `insufficient_credits` HTTP 402. Not retryable. The balance is too low. Buy a pack or top up; retrying won’t help. ### `spend_cap_reached` HTTP 402. Not retryable. This key hit its daily or monthly cap. Wait for it to reset, or ask the owner to raise it. ### `forbidden` HTTP 403. Not retryable. You can’t do this: the account is suspended, or your role doesn’t allow it. ### `not_found` HTTP 404. Not retryable. No such route or object. Check the path against the API reference. ### `method_not_allowed` HTTP 405. Not retryable. Wrong HTTP method for this path. See the API reference. ### `conflict` HTTP 409. Not retryable. The request clashes with the current state. Read it again, then decide. ### `already_claimed` HTTP 409. Not retryable. This account was already claimed. The key keeps working; nothing to do. ### `invalid_code` HTTP 400. Not retryable. The sign-in code is wrong or expired. Request a new one. ### `challenge_required` HTTP 428. Retryable. Answer the question in `error.details.challenge` and POST again with `challenge_token` and `answer`. ### `challenge_failed` HTTP 428. Retryable. Wrong or expired answer. Answer the new question in this response. ### `challenge_locked` HTTP 429. Retryable. Too many questions or wrong answers from this network. Wait `Retry-After` seconds. ### `signup_limited` HTTP 429. Retryable. Too many signups from this network today. Use your existing key, or wait `Retry-After` seconds. ### `signup_disabled` HTTP 503. Not retryable. Signup is switched off. Stop and tell your human; don’t try another signup URL. ### `authorization_pending` HTTP 400. Retryable. The person hasn’t approved the device login yet. Keep polling at `interval`. ### `slow_down` HTTP 400. Retryable. Polling too fast. Add 5 seconds to your interval. ### `access_denied` HTTP 400. Not retryable. The person declined. Stop polling. ### `expired_token` HTTP 400. Not retryable. The device code expired. Start the login again. ### `target_not_found` HTTP 404. Not retryable. The subreddit, post or user doesn’t exist, or was deleted. Refunded. ### `target_private` HTTP 403. Not retryable. The target is private, banned or quarantined. Refunded; don’t retry. ### `rate_limited` HTTP 429. Retryable. Too many requests. Wait `Retry-After` seconds, then retry. ### `upstream_unavailable` HTTP 503. Retryable. Reddit isn’t answering. Retry with backoff; nothing was charged. ### `upstream_timeout` HTTP 504. Retryable. Reddit took too long. Retry with backoff; nothing was charged. ### `internal_error` HTTP 500. Retryable. Our fault. Retry once, then contact support with the `request_id`. ## Examples Error body: ```json { "error": { "code": "target_not_found", "message": "r/thisdoesnotexist was not found.", "hint": "Check the name. Nothing was charged.", "docs_url": "https://groundsocial.dev/docs/errors#target_not_found", "retryable": false, "request_id": "req_01J…" } } ``` --- # Data freshness and caching > Data is fetched from Reddit when you ask, behind short per-resource caches. Deleted content is never restored. URL: https://groundsocial.dev/docs/freshness **Fetched when you ask.** A call reads public Reddit at request time. A short cache sits in front, so identical requests a few seconds apart share one fetch. ## How long things are cached - **Per resource.** A fast-moving feed such as a community’s `new` lives about 45 seconds; an old thread up to a day. Fresh content is cached for less time than settled content. - **Single-flight.** Concurrent requests for the same resource wait for one fetch and share it. - **Stale on failure.** If Reddit is briefly unreachable, a recently expired copy can be served instead of an error. - Each request’s cache status (hit or miss) is recorded and shown in the dashboard’s request log. ## Deleted and removed content You get what Reddit shows publicly at the time of the call. `[deleted]` authors and `[removed]` bodies stay that way, and we never restore removed posts or comments. "Not found" and "private" are never covered up with a cached copy: when something is deleted or made private, it stops being served. A Reddit user can ask us to purge cached copies of their content: [data removal](https://groundsocial.dev/legal/data-removal). ## Fields Reddit no longer exposes Some classic fields are not on Reddit’s public pages any more (the `ups`/`downs` split, award details, `edited`, the author’s `t2` id). They are present and `null`, never invented. --- # MCP server > Connect Claude, Cursor, ChatGPT or any MCP client: a remote server with OAuth, or a local stdio server. URL: https://groundsocial.dev/docs/mcp > **Not on npm yet** The SDK, CLI and stdio MCP server are not published yet. Until they are, use the REST API or the remote MCP server, and don't install packages named `@groundsocial/…` from npm: they aren't ours. **One tool set, two ways to run it.** The remote server at `https://api.groundsocial.dev/mcp` (Streamable HTTP) signs in with OAuth or takes a key as a Bearer token. The stdio server `npx -y @groundsocial/mcp` runs on your machine. ## Remote server - URL: `https://api.groundsocial.dev/mcp`. - Clients that support OAuth open a browser: sign in, pick the account that pays, approve. See [Authentication](https://groundsocial.dev/docs/authentication). - Clients that take a static header: `Authorization: Bearer $GROUNDSOCIAL_API_KEY`. - Listing tools works without signing in, so you can look before you connect. ## Install Claude Code: ```bash # Remote, signs in with OAuth in the browser: claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcp # Or local (stdio), with your key: claude mcp add groundsocial -e GROUNDSOCIAL_API_KEY=gs_live_… -- npx -y @groundsocial/mcp ``` Cursor / Claude Desktop: ```json { "mcpServers": { "groundsocial": { "command": "npx", "args": [ "-y", "@groundsocial/mcp" ], "env": { "GROUNDSOCIAL_API_KEY": "gs_live_…" } } } } ``` Remote (JSON): ```json { "mcpServers": { "groundsocial": { "url": "https://api.groundsocial.dev/mcp" } } } ``` **ChatGPT:** add a connector with the remote URL `https://api.groundsocial.dev/mcp` and sign in when asked. **Claude.ai:** add it as a custom connector with the same URL. `groundsocial mcp` from the [CLI](https://groundsocial.dev/docs/cli) prints these snippets for your setup. It edits nothing. ## Tools | Tool | Credits | What it does | | --- | --- | --- | | `reddit_subreddit_get` | 1 | A subreddit: description, rules, member count, flags. | | `reddit_subreddit_posts` | 1 | Posts in a subreddit, by hot, new, top, rising or controversial. | | `reddit_post_get` | 1 | One post with its full comment tree. | | `reddit_post_comments` | 1 | Comments on a post, paginated, with "more" threads expanded. | | `reddit_user_get` | 1 | A public user profile: karma, age, flags. | | `reddit_user_posts` | 1 | Posts a user submitted. | | `reddit_user_comments` | 1 | Comments a user wrote. | | `reddit_search_posts` | 2 | Search posts across Reddit or in one subreddit. | | `reddit_search_subreddits` | 1 | Find subreddits by name or topic. | | `list_endpoints` | 0 | Every tool with its price. Needs no key. | | `estimate_cost` | 0 | Price a job before running it. Needs no key. | | `account_balance` | 0 | Credits left on the account. | | `agent_signup` | 0 | Create a free account when there is no key. | Every tool result reports `cost_credits` and `credits_remaining`, so an agent always knows what it spent. All tools are read-only: nothing posts, votes or messages. ## No key yet The stdio server looks for a key in `GROUNDSOCIAL_API_KEY`, then in the config file it shares with the CLI (`~/.config/groundsocial/config.json`), and with neither it creates a free account on the spot and saves the key there. If signup asks a question, the tool result carries it; answer by calling `agent_signup` with `challenge_token` and `answer`, then retry. Set `GROUNDSOCIAL_AUTO_SIGNUP=false` to turn this off, for example in CI. ## Examples Claude Code: ```bash # Remote, signs in with OAuth in the browser: claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcp # Or local (stdio), with your key: claude mcp add groundsocial -e GROUNDSOCIAL_API_KEY=gs_live_… -- npx -y @groundsocial/mcp ``` Cursor / Claude Desktop: ```json { "mcpServers": { "groundsocial": { "command": "npx", "args": [ "-y", "@groundsocial/mcp" ], "env": { "GROUNDSOCIAL_API_KEY": "gs_live_…" } } } } ``` Remote (JSON): ```json { "mcpServers": { "groundsocial": { "url": "https://api.groundsocial.dev/mcp" } } } ``` --- # SKILL.md, llms.txt and Markdown twins > The files an agent reads to find, understand and set up the API by itself, with no human and no HTML parsing. URL: https://groundsocial.dev/docs/skill **Everything here is readable by an agent without a browser.** Start an agent with one line: ```text Read https://groundsocial.dev/SKILL.md to set up Groundsocial. ``` ## The files | File | What it is for | | --- | --- | | [`/SKILL.md`](https://groundsocial.dev/SKILL.md) | Set up: get a key (or sign up), first call, handling 428 and 402, guardrails. | | [`/auth.md`](https://groundsocial.dev/auth.md) | Every way to get a credential, step by step. | | [`/llms.txt`](https://groundsocial.dev/llms.txt) | The index: instructions for agents, when to use us, costs, links. | | [`/llms-full.txt`](https://groundsocial.dev/llms-full.txt) | The whole site and docs as one Markdown document. | | [`/openapi.json`](https://groundsocial.dev/openapi.json) | OpenAPI 3.1, with each endpoint’s price in `x-credits`. | ## A Markdown twin of every page - Add `.md` to any page’s path: `/pricing.md`, `/docs/errors.md`, `/compare/apify.md`. The home page is `/index.md`. - Or ask for Markdown: `Accept: text/markdown` on the page’s own URL returns the twin. - Twins start with front matter (`title`, `description`) and end with the canonical HTML link and site navigation. - Fetch the `.md` form before parsing HTML from this site. ## Discovery headers and well-known files Every HTML page and twin sends a `Link` header (RFC 8288) pointing at llms.txt, SKILL.md, the OpenAPI document and the OAuth metadata, so an agent that only sees headers can find its way. | Path | Format | | --- | --- | | `/.well-known/agent-skills/index.json` | Skills index with sha256 digests, so agents can pin and cache. | | `/.well-known/mcp.json` | MCP server card: remote URL and how to authenticate. | | `/.well-known/api-catalog` | RFC 9727 API catalog (`application/linkset+json`). | | `https://api.groundsocial.dev/.well-known/oauth-authorization-server` | OAuth metadata (RFC 8414) for MCP clients. | --- # CLI > `groundsocial`: Reddit data from a terminal or a coding agent, with `--json` on every command. URL: https://groundsocial.dev/docs/cli > **Not on npm yet** The SDK, CLI and stdio MCP server are not published yet. Until they are, use the REST API or the remote MCP server, and don't install packages named `@groundsocial/…` from npm: they aren't ours. **Built for agents in a shell.** Strict flags with did-you-mean, data on stdout and messages on stderr, and a `--json` envelope on every command. Install with `npm i -g @groundsocial/cli` or run it with `npx -y @groundsocial/cli`. ```bash npx -y @groundsocial/cli init ``` `init` reuses a working key if it finds one, or creates a free account (no human needed). If signup asks a question, it prints it; run `init --answer `. ## Commands | Command | What it does | | --- | --- | | `groundsocial init [--answer ] [--agent-name ]` | Reuse a working key, or create a free account. | | `groundsocial login` | Sign in through the browser (device login). `--no-wait` prints the code and exits; finish with `--poll`. `--api-key ` stores a key; `--email
` signs in by email, needed for `keys`. | | `groundsocial logout` | Forget the stored key and session. | | `groundsocial whoami` | Which account and key are in use. | | `groundsocial balance` | Credits left. Free. | | `groundsocial keys list\|create \|revoke ` | Manage keys. `--daily-cap` and `--monthly-cap` set caps on a new key. Needs `login --email`: a key can’t manage keys. | | `groundsocial mcp` | Print MCP client config for the stdio and remote servers. Edits nothing. | | `groundsocial reddit [args] [flags]` | Read Reddit data; one command per endpoint. | | `groundsocial estimate [:count] …` | Price a job before running it. Local and free; needs no key. | | `groundsocial endpoints` | Every reddit command with its price. Free. | ## Reading data The reddit commands are `subreddit`, `subreddit-posts`, `post`, `more-comments`, `user`, `user-posts`, `user-comments`, `search-posts` and `search-subreddits`. Path parameters (or the search query) are positional; everything else is a flag with the API’s own name. Listings take `--max-pages ` to follow the cursor. ```bash groundsocial reddit subreddit-posts LocalLLaMA --sort new --limit 25 groundsocial reddit search-posts "self-hosted backups" --sort new --max-pages 3 --json groundsocial estimate search-posts:100 post:20 ``` ## Global flags - `--json`: machine output on stdout, `{ok: true, …}` or `{ok: false, error}`. - `--api-key `: use this key for one command (otherwise the environment, then the config file). - `--api-url `: API base URL. - `--help`, `--version`. Errors in `--json` mode carry `code`, `message`, `next_action` and `suggested_commands`, and where useful `likely_cause`, `retry_after`, `request_id` or the signup `challenge`. ## Examples Set up: ```bash npx -y @groundsocial/cli init groundsocial balance groundsocial reddit post 1y3k9qa --json ``` --json error: ```json { "ok": false, "error": { "code": "unknown_command", "message": "Unknown command reddit posts. Did you mean reddit post?", "next_action": "Pick one of: subreddit, subreddit-posts, post, …", "suggested_commands": [ "groundsocial reddit post " ] } } ``` --- # TypeScript SDK > `@groundsocial/sdk`: typed calls, paging, retries and the cost of every call. URL: https://groundsocial.dev/docs/sdk > **Not on npm yet** The SDK, CLI and stdio MCP server are not published yet. Until they are, use the REST API or the remote MCP server, and don't install packages named `@groundsocial/…` from npm: they aren't ours. ```bash npm i @groundsocial/sdk ``` ## Create a client ```ts import { createClient } from '@groundsocial/sdk' const client = createClient({ apiKey: process.env.GROUNDSOCIAL_API_KEY }) ``` | Option | Default | What it does | | --- | --- | --- | | `apiKey` | `GROUNDSOCIAL_API_KEY` | Your key. Pass `null` for keyless mode (pay per call with `paymentHandler`). | | `baseUrl` | `GROUNDSOCIAL_API_URL`, then the public API | Where to send calls. | | `sessionToken` | none | A dashboard session, for key management (a key can’t manage keys). | | `maxRetries` | 2 | Retries for 429, 5xx and network errors, honouring `Retry-After`. | | `timeoutMs` | 60000 | Per attempt. | | `userAgent` | none | Identifies your app in our logs. | | `onResponse` | none | Called after every call with its cost: `creditsCharged`, `creditsRemaining`, `requestId`, `attempts`. | | `paymentHandler` | none | Answers a 402 by paying (MPP or x402) and returning the headers to retry with. | | `headers`, `fetch` | none | Extra headers; a custom fetch. | Keys are only sent over https or to a loopback address, unless you set `allowInsecureTransport`. ## Reddit methods | Method | Returns | | --- | --- | | `reddit.subreddit(name)` | A subreddit (`t5`). | | `reddit.subredditPosts(name, { sort, t, limit })` | Listing of posts. | | `reddit.post(id, { sort, limit })` | `{ post, comments }`. | | `reddit.moreComments(postId, children, { sort })` | The expanded comments of a `more` item. | | `reddit.user(name)` | A user (`t2`). | | `reddit.userPosts(name)` / `reddit.userComments(name)` | Listings. | | `reddit.searchPosts(q, { subreddit, sort, t })` | Listing of posts. | | `reddit.searchSubreddits(q)` | Listing of subreddits. | Responses are Reddit’s own Thing and Listing JSON, typed from the OpenAPI document. `client.call(operationId, input)` calls any operation by id with one flat input object and returns `{ status, data, meta }`. ## Paging Listing methods return a `ListingPromise`. Await it for one page; iterate it for more. Nothing is fetched or charged until you do one of the two, and each page is one call. ```ts const page = await client.reddit.subredditPosts('typescript', { sort: 'new' }) for await (const post of client.reddit.subredditPosts('typescript').items({ maxItems: 250 })) {} for await (const page of client.reddit.userComments('quiet_ops').pages({ maxPages: 5 })) {} ``` ## Errors Failures throw `ApiError` with `code`, `status`, `message`, `hint`, `docsUrl`, `retryable`, `requestId`, `details` and `retryAfterSeconds`. Use `isApiError(err)` to narrow. See [Errors](https://groundsocial.dev/docs/errors). ## Accounts and signup - `client.account()`: credits left and which key is calling. Free. - `client.onboarding.signup({ agentName, purpose })`: agent self-signup. Returns `{ status: "created", api_key, … }` or `{ status: "challenge", challenge }`; call again with `challengeToken` and `answer`. - `client.onboarding.deviceStart(clientName)` and `devicePoll(deviceCode)`: device login. - `client.onboarding.emailStart(email)`, `emailVerify(email, code)`, `me()`, `listKeys`, `createKey`, `revokeKey`: dashboard calls with a session token. ## Examples TypeScript: ```ts import { createClient, isApiError } from '@groundsocial/sdk' const client = createClient({ apiKey: process.env.GROUNDSOCIAL_API_KEY }) try { for await (const post of client.reddit.searchPosts('self-hosted backups').items({ maxItems: 100 })) { console.log(post.data.subreddit, post.data.title) } } catch (err) { if (isApiError(err)) console.error(err.code, err.hint) } ``` --- # PRAW and snoowrap > Keep your PRAW or snoowrap script: point it at our compatible host and use your key. URL: https://groundsocial.dev/docs/praw **Change one URL.** The compatible host `https://reddit.groundsocial.dev` serves Reddit’s own paths and JSON, so PRAW, snoowrap and go-reddit keep working for reads. Billing, refunds and spend caps are the same as the REST API. ```python reddit = praw.Reddit( client_id="groundsocial", # anything client_secret=os.environ["GROUNDSOCIAL_API_KEY"], # your API key user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", reddit_url="https://reddit.groundsocial.dev", ) ``` snoowrap takes `endpointDomain: ""` and uses `oauth.` and `www.`. ## Auth `POST /api/v1/access_token` accepts `client_credentials`, `password`, `refresh_token` and the installed-client grant. Put your key in the client secret (client id: anything), or in the client id with an empty secret, or in `password`. The token lasts 24 hours and dies at once if you revoke the key. The key itself is also accepted as the bearer. ## What works | Reddit path | Served by | | --- | --- | | `/`, `/{sort}`, `/r/{sub}`, `/r/{sub}/{hot,new,top,rising,controversial}` | Subreddit posts (`popular` for the front page) | | `/r/{sub}/about` | Subreddit | | `/comments/{id}`, `/r/{sub}/comments/{id}[/{slug}]` | Post with comments, as `[Listing(t3), Listing(comments)]` | | `/api/morechildren` | More comments (`replace_more`) | | `/api/info?id=t3_…` | One post or subreddit call per item | | `/user/{u}/about`, `/user/{u}/{submitted,comments}` | User, user posts, user comments | | `/search`, `/r/{sub}/search`, `/subreddits/search` | Search posts or subreddits | | `/api/v1/me` | A synthetic read-only user, free | - `.json` suffixes, trailing slashes and `raw_json=1` are accepted. - Parameters are read leniently like Reddit: `limit` is clamped to 1–100; a bad `after`, `t` or `sort` is ignored. - Errors keep Reddit’s body (`{"message": "Not Found", "error": 404}`) plus our `code`, `detail` and `hint`. > **Read-only.** Any write (submit, comment, vote, message) and `/api/v1/me/*` answer `403 {"error": 403, "message": "read-only API"}`. ## Rate-limit headers We limit by credits, not a request window. `x-ratelimit-remaining` is your balance (never below 1, so the client fails fast on a 402 instead of sleeping), `x-ratelimit-used` is 0 and `x-ratelimit-reset` the seconds to the next 10-minute boundary. PRAW’s limiter never delays a request. ## Examples PRAW: ```python import os, praw reddit = praw.Reddit( client_id="groundsocial", client_secret=os.environ["GROUNDSOCIAL_API_KEY"], user_agent="my-app/1.0", oauth_url="https://reddit.groundsocial.dev", reddit_url="https://reddit.groundsocial.dev", ) for post in reddit.subreddit("selfhosted").hot(limit=10): print(post.score, post.title) ``` snoowrap: ```ts import Snoowrap from 'snoowrap' const r = new Snoowrap({ userAgent: 'my-app/1.0', clientId: 'groundsocial', clientSecret: process.env.GROUNDSOCIAL_API_KEY, endpointDomain: 'reddit.groundsocial.dev', }) ``` --- # Legal and compliance > What the data is, what you may do with it, and how removal requests work. URL: https://groundsocial.dev/docs/compliance - **Public data only.** We return what anyone can see on Reddit without signing in. No private communities, no private messages, no data behind a login. - **Read-only.** Nothing posts, votes, comments or messages. - **No logged-in sessions and no CAPTCHA solving.** A challenge from Reddit is treated as a failed fetch, and the call is refunded. - **Deleted content stays deleted.** We serve what Reddit shows at the time of the call and never restore removed posts or comments. - **Removal requests.** A Reddit user can ask us to purge cached copies of their content at [data removal](https://groundsocial.dev/legal/data-removal). ## Acceptable use You may not use the API to harass, threaten or dox anyone; to re-identify people behind pseudonymous accounts; to build profiles of individuals; to send spam or coordinate manipulation; or for anything unlawful. We suspend accounts that do. ## Your responsibilities You are responsible for how you store and use the data, including privacy law where you operate and Reddit’s own terms where they apply to you. If you keep data, honour deletions: re-fetch and drop items that are gone. Full text: [Terms](https://groundsocial.dev/legal/terms) and [Privacy](https://groundsocial.dev/legal/privacy). > Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit. --- # API reference > Every operation, generated from the OpenAPI document. URL: https://groundsocial.dev/docs/api OpenAPI 3.1: [https://groundsocial.dev/openapi.json](https://groundsocial.dev/openapi.json). Base URL: `https://api.groundsocial.dev`. ## Reddit - [`GET /v1/reddit/subreddits/{name}`](https://groundsocial.dev/docs/api/reddit-subreddit-get): A subreddit: description, rules, member count, flags. - [`GET /v1/reddit/subreddits/{name}/posts`](https://groundsocial.dev/docs/api/reddit-subreddit-posts): Posts in a subreddit, by hot, new, top, rising or controversial. - [`GET /v1/reddit/posts/{id}`](https://groundsocial.dev/docs/api/reddit-post-get): One post with its full comment tree. - [`POST /v1/reddit/posts/{id}/more`](https://groundsocial.dev/docs/api/reddit-post-comments): Comments on a post, paginated, with "more" threads expanded. - [`GET /v1/reddit/users/{name}`](https://groundsocial.dev/docs/api/reddit-user-get): A public user profile: karma, age, flags. - [`GET /v1/reddit/users/{name}/posts`](https://groundsocial.dev/docs/api/reddit-user-posts): Posts a user submitted. - [`GET /v1/reddit/users/{name}/comments`](https://groundsocial.dev/docs/api/reddit-user-comments): Comments a user wrote. - [`GET /v1/reddit/search/posts`](https://groundsocial.dev/docs/api/reddit-search-posts): Search posts across Reddit or in one subreddit. - [`GET /v1/reddit/search/subreddits`](https://groundsocial.dev/docs/api/reddit-search-subreddits): Find subreddits by name or topic. ## Agents - [`POST /v1/agent/signup`](https://groundsocial.dev/docs/api/agent-signup): Create an account with no human: get an API key and a claim link. ## Claims - [`GET /v1/claims/{token}`](https://groundsocial.dev/docs/api/claims-get): What a claim link is for: the agent account, its credits, whether it was claimed. - [`POST /v1/claims/{token}/accept`](https://groundsocial.dev/docs/api/claims-accept): Become the owner of an agent-created account. Its API key keeps working. ## Device login - [`POST /v1/device/code`](https://groundsocial.dev/docs/api/device-code): Start a device login: show the person user_code and verification_uri, then poll. - [`POST /v1/device/token`](https://groundsocial.dev/docs/api/device-token): Poll for the API key. Errors are the RFC 8628 codes. - [`GET /v1/device/lookup`](https://groundsocial.dev/docs/api/device-lookup): Which client a pending user code belongs to, for the approval page. - [`POST /v1/device/approve`](https://groundsocial.dev/docs/api/device-approve): Approve a device login for one of your accounts, or decline it. ## Dashboard auth - [`POST /v1/auth/email/start`](https://groundsocial.dev/docs/api/auth-email-start): Email a 6-digit sign-in code. Same answer whether or not the address has an account. - [`POST /v1/auth/email/verify`](https://groundsocial.dev/docs/api/auth-email-verify): Exchange the emailed code for a 30-day session. Creates the user on first sign-in. - [`POST /v1/auth/logout`](https://groundsocial.dev/docs/api/auth-logout): End this session. - [`GET /v1/me`](https://groundsocial.dev/docs/api/me-get): The signed-in person and every account they belong to, with balances. ## Dashboard keys - [`GET /v1/accounts/{id}/keys`](https://groundsocial.dev/docs/api/keys-list): The account’s API keys, with caps and spend so far. Never the secrets. - [`POST /v1/accounts/{id}/keys`](https://groundsocial.dev/docs/api/keys-create): Create a key. The secret is in this response only. - [`PATCH /v1/accounts/{id}/keys/{key_id}`](https://groundsocial.dev/docs/api/keys-caps): Set or clear a key’s daily and monthly spend caps. Applies from its next call. - [`DELETE /v1/accounts/{id}/keys/{key_id}`](https://groundsocial.dev/docs/api/keys-revoke): Revoke a key. It stops working at once; revoking twice is a no-op. - [`GET /v1/accounts/{id}/usage`](https://groundsocial.dev/docs/api/accounts-usage): Calls, credits and errors per UTC day and per endpoint. Last 30 days by default. ## Billing - [`POST /v1/billing/checkout`](https://groundsocial.dev/docs/api/billing-checkout): A Stripe Checkout page for a credit pack. ## Credits - [`POST /v1/credits/topup`](https://groundsocial.dev/docs/api/credits-topup): Add credits to your account, paid over MPP or x402, with no human. ## Platforms - [`GET /v1/platforms`](https://groundsocial.dev/docs/api/platforms-list): Every platform, its status, and its endpoints with their prices. --- # GET /v1/reddit/subreddits/{name} > A subreddit: description, rules, member count, flags. URL: https://groundsocial.dev/docs/api/reddit-subreddit-get | | | | --- | --- | | Request | `GET /v1/reddit/subreddits/{name}` | | Operation id | `reddit.subreddit.get` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | A subreddit: description, rules, member count, flags. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Subreddit name, with or without "r/". "all" and "popular" also work for posts. Example: `typescript`. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The subreddit. | `Subreddit` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### Subreddit fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"t5"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/subreddits/typescript" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/subreddits/typescript', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/subreddits/typescript", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/reddit/subreddits/{name}/posts > Posts in a subreddit, by hot, new, top, rising or controversial. URL: https://groundsocial.dev/docs/api/reddit-subreddit-posts | | | | --- | --- | | Request | `GET /v1/reddit/subreddits/{name}/posts` | | Operation id | `reddit.subreddit.posts` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Posts in a subreddit, by hot, new, top, rising or controversial. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Subreddit name, with or without "r/". "all" and "popular" also work for posts. Example: `typescript`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `sort` | `"hot" \| "new" \| "top" \| "rising" \| "controversial"` | no | Listing order. Default hot. One of `hot`, `new`, `top`, `rising`, `controversial`. | | `t` | `"hour" \| "day" \| "week" \| "month" \| "year" \| "all"` | no | Time window for top and controversial. Default day. One of `hour`, `day`, `week`, `month`, `year`, `all`. | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | A page of posts. | `LinkListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### LinkListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/subreddits/typescript/posts" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/subreddits/typescript/posts', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/subreddits/typescript/posts", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/reddit/posts/{id} > One post with its full comment tree. URL: https://groundsocial.dev/docs/api/reddit-post-get | | | | --- | --- | | Request | `GET /v1/reddit/posts/{id}` | | Operation id | `reddit.post.get` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | One post with its full comment tree. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | A post id (1y1u285), fullname (t3_1y1u285) or post URL. Example: `1y1u285`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `sort` | `"confidence" \| "top" \| "new" \| "controversial" \| "old" \| "qa"` | no | Comment order. Default confidence ("best"). One of `confidence`, `top`, `new`, `controversial`, `old`, `qa`. | | `limit` | `integer` | no | Top-level comments, 1 to 500. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The post and its comment tree. | `PostWithComments` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### PostWithComments fields | Field | Type | Description | | --- | --- | --- | | `post` | `Link` | | | `comments` | `CommentTree` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/posts/1y1u285" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/posts/1y1u285', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/posts/1y1u285", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/reddit/posts/{id}/more > Comments on a post, paginated, with "more" threads expanded. URL: https://groundsocial.dev/docs/api/reddit-post-comments | | | | --- | --- | | Request | `POST /v1/reddit/posts/{id}/more` | | Operation id | `reddit.post.comments` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Comments on a post, paginated, with "more" threads expanded. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | A post id (1y1u285), fullname (t3_1y1u285) or post URL. Example: `1y1u285`. | ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `children` | `string[]` | yes | Comment ids from a `more` item's `data.children`, up to 100. | | `sort` | `"confidence" \| "top" \| "new" \| "controversial" \| "old" \| "qa"` | no | Comment order. Default confidence. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The expanded comments, flat, each with its parent_id. | | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/reddit/posts/1y1u285/more" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"children":["m5f9z9z"]}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/posts/1y1u285/more', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"children":["m5f9z9z"]}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/reddit/posts/1y1u285/more", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"children":["m5f9z9z"]}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/reddit/users/{name} > A public user profile: karma, age, flags. URL: https://groundsocial.dev/docs/api/reddit-user-get | | | | --- | --- | | Request | `GET /v1/reddit/users/{name}` | | Operation id | `reddit.user.get` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | A public user profile: karma, age, flags. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Username, with or without "u/". Example: `spez`. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The user. | `Account` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### Account fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"t2"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/users/spez" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/users/spez', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/users/spez", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/reddit/users/{name}/posts > Posts a user submitted. URL: https://groundsocial.dev/docs/api/reddit-user-posts | | | | --- | --- | | Request | `GET /v1/reddit/users/{name}/posts` | | Operation id | `reddit.user.posts` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Posts a user submitted. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Username, with or without "u/". Example: `spez`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Posts the user submitted, newest first. | `LinkListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### LinkListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/users/spez/posts" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/users/spez/posts', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/users/spez/posts", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/reddit/users/{name}/comments > Comments a user wrote. URL: https://groundsocial.dev/docs/api/reddit-user-comments | | | | --- | --- | | Request | `GET /v1/reddit/users/{name}/comments` | | Operation id | `reddit.user.comments` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Comments a user wrote. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Username, with or without "u/". Example: `spez`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Comments the user wrote, newest first. | `CommentListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### CommentListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/users/spez/comments" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/users/spez/comments', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/users/spez/comments", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/reddit/search/posts > Search posts across Reddit or in one subreddit. URL: https://groundsocial.dev/docs/api/reddit-search-posts | | | | --- | --- | | Request | `GET /v1/reddit/search/posts` | | Operation id | `reddit.search.posts` | | Cost | 2 credits, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Search posts across Reddit or in one subreddit. ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `q` | `string` | yes | Search query. Example: `typescript narrowing`. | | `subreddit` | `string` | no | Search only this subreddit. Example: `typescript`. | | `sort` | `"relevance" \| "new" \| "top" \| "comments"` | no | Result order. Default relevance. One of `relevance`, `new`, `top`, `comments`. | | `t` | `"hour" \| "day" \| "week" \| "month" \| "year" \| "all"` | no | Time window for top and controversial. Default day. One of `hour`, `day`, `week`, `month`, `year`, `all`. | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Matching posts. | `LinkListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### LinkListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/search/posts?q=typescript%20narrowing" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/search/posts?q=typescript%20narrowing', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/search/posts?q=typescript%20narrowing", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/reddit/search/subreddits > Find subreddits by name or topic. URL: https://groundsocial.dev/docs/api/reddit-search-subreddits | | | | --- | --- | | Request | `GET /v1/reddit/search/subreddits` | | Operation id | `reddit.search.subreddits` | | Cost | 1 credit, refunded if the call fails | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Find subreddits by name or topic. ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `q` | `string` | yes | Name or topic. Example: `typescript`. | | `limit` | `integer` | no | Items per page, 1 to 100. Default 25. | | `after` | `string` | no | Cursor: the previous page's `data.after`. Omit for the first page. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Matching subreddits. | `SubredditListing` | | `400` | Invalid input. Nothing was charged. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Not enough credits, a spend cap was reached, or payment is required. | `Error` | | `403` | The target is private, or the account is suspended. | `Error` | | `404` | The subreddit, post or user does not exist. | `Error` | | `429` | Too many requests. Wait for Retry-After seconds. | `Error` | | `503` | Reddit is temporarily unavailable. Retryable; nothing was charged. | `Error` | ### SubredditListing fields | Field | Type | Description | | --- | --- | --- | | `kind` | `"Listing"` | | | `data` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/reddit/search/subreddits?q=typescript" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/reddit/search/subreddits?q=typescript', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/reddit/search/subreddits?q=typescript", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/platforms > Every platform, its status, and its endpoints with their prices. URL: https://groundsocial.dev/docs/api/platforms-list | | | | --- | --- | | Request | `GET /v1/platforms` | | Operation id | `platforms.list` | | Cost | Free | | Auth | None. | Free, and needs no API key. Planned platforms are listed with no endpoints; only live and beta ones are callable. ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The platform directory. | `PlatformDirectory` | ### PlatformDirectory fields | Field | Type | Description | | --- | --- | --- | | `platforms` | `object[]` | | | `keyless_usd_per_credit` | `number` | | | `failed_calls_are_charged` | `false` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/platforms" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/platforms', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/platforms", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/agent/signup > Create an account with no human: get an API key and a claim link. URL: https://groundsocial.dev/docs/api/agent-signup | | | | --- | --- | | Request | `POST /v1/agent/signup` | | Operation id | `agent.signup` | | Cost | Free | | Auth | None. | No key needed. May first answer 428 with a one-word question; answer it yourself and POST again with `challenge_token` and `answer` (the 428 body has a ready-to-run curl). Free credits on signup; a person can later claim the account at `claim_url` and the key keeps working. Limited per network per day: sign up only if you have no key at all. ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `agent_name` | `string` | no | Who is signing up, shown to the person who claims the account. | | `purpose` | `string` | no | What the account is for, in a few words. Goes into message_for_human. | | `challenge_token` | `string` | no | From a 428 response: `error.details.challenge.token`. | | `answer` | `string` | no | Your answer to the question: one word from it. | | `c` | `string` | no | Short for challenge_token. | | `a` | `string` | no | Short for answer. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `201` | A new Groundsocial account and its API key. | `AgentSignup` | | `400` | Invalid input. | `Error` | | `428` | Answer the question in error.details.challenge first (challenge_required), or the answer was wrong or expired (challenge_failed) and this is a new question. | `Error` | | `429` | Too many signups (signup_limited) or questions (challenge_locked) from this network. Wait Retry-After seconds. | `Error` | | `503` | Signup is switched off (signup_disabled). Tell your human. | `Error` | ### AgentSignup fields | Field | Type | Description | | --- | --- | --- | | `api_key` | `string` | Shown once. Send it as "Authorization: Bearer ". | | `key_id` | `string` | | | `account_id` | `string` | | | `credits` | `integer` | | | `claim_url` | `string` | For your human: they open it to own the account. Treat it like a password. | | `claim_expires_at` | `string` | | | `message_for_human` | `string` | A short note to forward to your person as-is. | | `docs` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/agent/signup" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/agent/signup', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/agent/signup", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/claims/{token} > What a claim link is for: the agent account, its credits, whether it was claimed. URL: https://groundsocial.dev/docs/api/claims-get | | | | --- | --- | | Request | `GET /v1/claims/{token}` | | Operation id | `claims.get` | | Cost | Free | | Auth | None. | ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `token` | `string` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The claim. | `Claim` | | `404` | Unknown or expired link. | `Error` | ### Claim fields | Field | Type | Description | | --- | --- | --- | | `account_id` | `string` | | | `agent_name` | `string` | | | `credits` | `integer` | | | `created_at` | `string` | | | `expires_at` | `string` | | | `claimed` | `boolean` | | | `claimed_at` | `string \| null` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/claims/clm_token_from_the_link" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/claims/clm_token_from_the_link', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/claims/clm_token_from_the_link", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/claims/{token}/accept > Become the owner of an agent-created account. Its API key keeps working. URL: https://groundsocial.dev/docs/api/claims-accept | | | | --- | --- | | Request | `POST /v1/claims/{token}/accept` | | Operation id | `claims.accept` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | For a signed-in person in the dashboard. Agents must never call this: relay claim_url to your human instead. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `token` | `string` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Claimed. Accepting again as the same person is a no-op. | `Claim` | | `401` | Not signed in. | `Error` | | `404` | Unknown or expired link. | `Error` | | `409` | Someone else claimed it (already_claimed). | `Error` | ### Claim fields | Field | Type | Description | | --- | --- | --- | | `account_id` | `string` | | | `agent_name` | `string` | | | `credits` | `integer` | | | `created_at` | `string` | | | `expires_at` | `string` | | | `claimed` | `boolean` | | | `claimed_at` | `string \| null` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/claims/clm_token_from_the_link/accept" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/claims/clm_token_from_the_link/accept', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/claims/clm_token_from_the_link/accept", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/auth/email/start > Email a 6-digit sign-in code. Same answer whether or not the address has an account. URL: https://groundsocial.dev/docs/api/auth-email-start | | | | --- | --- | | Request | `POST /v1/auth/email/start` | | Operation id | `auth.email.start` | | Cost | Free | | Auth | None. | ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | `string` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `202` | Code sent. | | | `400` | Not an email address. | `Error` | | `429` | Too many codes for this address or network. Wait Retry-After seconds. | `Error` | | `503` | The email could not be sent. Retry shortly. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/auth/email/start" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"email":"you@example.com"}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/auth/email/start', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"email":"you@example.com"}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/auth/email/start", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"email":"you@example.com"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/auth/email/verify > Exchange the emailed code for a 30-day session. Creates the user on first sign-in. URL: https://groundsocial.dev/docs/api/auth-email-verify | | | | --- | --- | | Request | `POST /v1/auth/email/verify` | | Operation id | `auth.email.verify` | | Cost | Free | | Auth | None. | Codes last 10 minutes and allow 5 tries; only the most recent code works. A new person gets a personal account with the signup credits. ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | `string` | yes | | | `code` | `string` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Signed in. | `Session` | | `400` | Wrong, expired or used code (invalid_code). | `Error` | ### Session fields | Field | Type | Description | | --- | --- | --- | | `session_token` | `string` | Send as "Authorization: Bearer ". Also set as an HttpOnly cookie. | | `expires_at` | `string` | | | `is_new_user` | `boolean` | | | `user` | `User` | | | `accounts` | `MemberAccount[]` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/auth/email/verify" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"email":"you@example.com","code":""}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/auth/email/verify', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"email":"you@example.com","code":""}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/auth/email/verify", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"email":"you@example.com","code":""}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/auth/logout > End this session. URL: https://groundsocial.dev/docs/api/auth-logout | | | | --- | --- | | Request | `POST /v1/auth/logout` | | Operation id | `auth.logout` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Signed out. | | | `401` | Not signed in. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/auth/logout" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/auth/logout', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/auth/logout", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/me > The signed-in person and every account they belong to, with balances. URL: https://groundsocial.dev/docs/api/me-get | | | | --- | --- | | Request | `GET /v1/me` | | Operation id | `me.get` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | You. | | | `401` | Not signed in. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/me" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/me', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/me", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/device/code > Start a device login: show the person user_code and verification_uri, then poll. URL: https://groundsocial.dev/docs/api/device-code | | | | --- | --- | | Request | `POST /v1/device/code` | | Operation id | `device.code` | | Cost | Free | | Auth | None. | ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `client_name` | `string` | yes | Shown to the person approving, and the new key’s name. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Started. | `DeviceAuthorization` | | `400` | Invalid input. | `Error` | | `429` | Too many device logins from this network. | `Error` | ### DeviceAuthorization fields | Field | Type | Description | | --- | --- | --- | | `device_code` | `string` | Secret. Poll POST /v1/device/token with it. | | `user_code` | `string` | | | `verification_uri` | `string` | | | `verification_uri_complete` | `string` | | | `expires_in` | `integer` | | | `interval` | `integer` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/device/code" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"client_name":""}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/device/code', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"client_name":""}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/device/code", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"client_name":""}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/device/token > Poll for the API key. Errors are the RFC 8628 codes. URL: https://groundsocial.dev/docs/api/device-token | | | | --- | --- | | Request | `POST /v1/device/token` | | Operation id | `device.token` | | Cost | Free | | Auth | None. | Poll every 5 seconds. `authorization_pending`: keep polling. `slow_down`: add 5 seconds to your interval. `access_denied`: the person declined; stop. `expired_token`: start again. ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `device_code` | `string` | no | | | `grant_type` | `"urn:ietf:params:oauth:grant-type:device_code"` | no | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Approved: the new API key, shown once. | `DeviceToken` | | `400` | authorization_pending, slow_down, access_denied, expired_token, or invalid input. | `Error` | ### DeviceToken fields | Field | Type | Description | | --- | --- | --- | | `api_key` | `string` | | | `key_id` | `string` | | | `account_id` | `string` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/device/token" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/device/token', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/device/token", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/device/lookup > Which client a pending user code belongs to, for the approval page. URL: https://groundsocial.dev/docs/api/device-lookup | | | | --- | --- | | Request | `GET /v1/device/lookup` | | Operation id | `device.lookup` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `user_code` | `string` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The pending login. | | | `401` | Not signed in. | `Error` | | `404` | No pending login with that code. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/device/lookup?user_code=user_code" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/device/lookup?user_code=user_code', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/device/lookup?user_code=user_code", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/device/approve > Approve a device login for one of your accounts, or decline it. URL: https://groundsocial.dev/docs/api/device-approve | | | | --- | --- | | Request | `POST /v1/device/approve` | | Operation id | `device.approve` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `user_code` | `string` | yes | | | `account_id` | `string` | no | Required when approving. | | `approve` | `boolean` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Decided. | | | `400` | Invalid input. | `Error` | | `401` | Not signed in. | `Error` | | `403` | Only owners and admins can approve logins for an account. | `Error` | | `404` | No pending login with that code, or not your account. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/device/approve" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"user_code":"","approve":""}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/device/approve', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"user_code":"","approve":""}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/device/approve", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"user_code":"","approve":""}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/accounts/{id}/keys > The account’s API keys, with caps and spend so far. Never the secrets. URL: https://groundsocial.dev/docs/api/keys-list | | | | --- | --- | | Request | `GET /v1/accounts/{id}/keys` | | Operation id | `keys.list` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Example: `acct_01J…`. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The keys. | | | `401` | Not signed in, or an API key was sent (keys cannot manage keys). | `Error` | | `404` | No such account among yours, or no such key on it. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/accounts/acct_01J…/keys', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/accounts/{id}/keys > Create a key. The secret is in this response only. URL: https://groundsocial.dev/docs/api/keys-create | | | | --- | --- | | Request | `POST /v1/accounts/{id}/keys` | | Operation id | `keys.create` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Example: `acct_01J…`. | ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `daily_spend_cap_credits` | `integer \| null` | no | Credits; null for no cap. 0 stops the key spending at all. | | `monthly_spend_cap_credits` | `integer \| null` | no | Credits; null for no cap. 0 stops the key spending at all. | | `name` | `string` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `201` | The new key, with its secret. | | | `400` | Invalid input. | `Error` | | `401` | Not signed in, or an API key was sent (keys cannot manage keys). | `Error` | | `403` | Members can’t create keys; owners and admins can. | `Error` | | `404` | No such account among yours, or no such key on it. | `Error` | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":""}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/accounts/acct_01J…/keys', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"name":""}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"name":""}, ) res.raise_for_status() data = res.json() ``` --- # PATCH /v1/accounts/{id}/keys/{key_id} > Set or clear a key’s daily and monthly spend caps. Applies from its next call. URL: https://groundsocial.dev/docs/api/keys-caps | | | | --- | --- | | Request | `PATCH /v1/accounts/{id}/keys/{key_id}` | | Operation id | `keys.caps` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Example: `acct_01J…`. | | `key_id` | `string` | yes | | ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `daily_spend_cap_credits` | `integer \| null` | no | Credits; null for no cap. 0 stops the key spending at all. | | `monthly_spend_cap_credits` | `integer \| null` | no | Credits; null for no cap. 0 stops the key spending at all. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The key with its new caps. | `ApiKey` | | `400` | Invalid input. | `Error` | | `401` | Not signed in, or an API key was sent (keys cannot manage keys). | `Error` | | `403` | Members can’t change caps; owners and admins can. | `Error` | | `404` | No such account among yours, or no such key on it. | `Error` | ### ApiKey fields | Field | Type | Description | | --- | --- | --- | | `id` | `string` | | | `name` | `string` | | | `display_prefix` | `string` | The key’s first characters, to tell keys apart. | | `source` | `"dashboard" \| "agent_signup" \| "cli" \| "oauth"` | | | `scopes` | `string[]` | | | `daily_spend_cap_credits` | `integer \| null` | | | `monthly_spend_cap_credits` | `integer \| null` | | | `spent_today_credits` | `integer` | | | `spent_this_month_credits` | `integer` | | | `last_used_at` | `string \| null` | | | `expires_at` | `string \| null` | | | `revoked_at` | `string \| null` | | | `created_at` | `string` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys/key_01J…" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/accounts/acct_01J…/keys/key_01J…', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys/key_01J…", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={}, ) res.raise_for_status() data = res.json() ``` --- # DELETE /v1/accounts/{id}/keys/{key_id} > Revoke a key. It stops working at once; revoking twice is a no-op. URL: https://groundsocial.dev/docs/api/keys-revoke | | | | --- | --- | | Request | `DELETE /v1/accounts/{id}/keys/{key_id}` | | Operation id | `keys.revoke` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Example: `acct_01J…`. | | `key_id` | `string` | yes | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | The revoked key. | `ApiKey` | | `401` | Not signed in, or an API key was sent (keys cannot manage keys). | `Error` | | `403` | Members can’t revoke keys; owners and admins can. | `Error` | | `404` | No such account among yours, or no such key on it. | `Error` | ### ApiKey fields | Field | Type | Description | | --- | --- | --- | | `id` | `string` | | | `name` | `string` | | | `display_prefix` | `string` | The key’s first characters, to tell keys apart. | | `source` | `"dashboard" \| "agent_signup" \| "cli" \| "oauth"` | | | `scopes` | `string[]` | | | `daily_spend_cap_credits` | `integer \| null` | | | `monthly_spend_cap_credits` | `integer \| null` | | | `spent_today_credits` | `integer` | | | `spent_this_month_credits` | `integer` | | | `last_used_at` | `string \| null` | | | `expires_at` | `string \| null` | | | `revoked_at` | `string \| null` | | | `created_at` | `string` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys/key_01J…" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/accounts/acct_01J…/keys/key_01J…', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/accounts/acct_01J…/keys/key_01J…", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # GET /v1/accounts/{id}/usage > Calls, credits and errors per UTC day and per endpoint. Last 30 days by default. URL: https://groundsocial.dev/docs/api/accounts-usage | | | | --- | --- | | Request | `GET /v1/accounts/{id}/usage` | | Operation id | `accounts.usage` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Example: `acct_01J…`. | ## Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `from` | `string` | no | | | `to` | `string` | no | | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Usage. | `Usage` | | `400` | Invalid range. | `Error` | | `401` | Not signed in, or an API key was sent (keys cannot manage keys). | `Error` | | `404` | No such account among yours, or no such key on it. | `Error` | ### Usage fields | Field | Type | Description | | --- | --- | --- | | `from` | `string` | | | `to` | `string` | | | `totals` | `object` | | | `days` | `object[]` | | | `endpoints` | `object[]` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl "https://api.groundsocial.dev/v1/accounts/acct_01J…/usage" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/accounts/acct_01J…/usage', { headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.get( "https://api.groundsocial.dev/v1/accounts/acct_01J…/usage", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/credits/topup > Add credits to your account, paid over MPP or x402, with no human. URL: https://groundsocial.dev/docs/api/credits-topup | | | | --- | --- | | Request | `POST /v1/credits/topup` | | Operation id | `credits.topup` | | Cost | Free | | Auth | API key: `Authorization: Bearer ` or `x-api-key`. | Send `{"pack": "starter"}` or `{"credits": 25000}`. The first call answers 402 with challenges for the exact amount; pay one and retry the same request with the credential. With the key in Authorization, send the MPP credential in Payment-Authorization. Applied once per payment. ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Credits added. | `TopupResult` | | `400` | Not a pack, or credits outside the allowed range. | `Error` | | `401` | Missing or invalid API key. | `Error` | | `402` | Payment required (with challenges), or the payment was refused. | `Error` | | `404` | Top-ups are not enabled on this server. | `Error` | | `503` | Payments are temporarily unavailable. Nothing was charged. | `Error` | ### TopupResult fields | Field | Type | Description | | --- | --- | --- | | `credits_added` | `integer` | | | `balance` | `integer` | | | `payment` | `object` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/credits/topup" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/credits/topup', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` }, }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/credits/topup", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, ) res.raise_for_status() data = res.json() ``` --- # POST /v1/billing/checkout > A Stripe Checkout page for a credit pack. URL: https://groundsocial.dev/docs/api/billing-checkout | | | | --- | --- | | Request | `POST /v1/billing/checkout` | | Operation id | `billing.checkout` | | Cost | Free | | Auth | Dashboard session: `Authorization: Bearer `. API keys are refused. | Signed in: send account_id (you must be an owner or admin). With an API key: buys for the key’s own account, so an agent can pass the URL to its human. Credits are added when Stripe confirms payment. ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `account_id` | `string` | no | The account to buy for. Optional with an API key (its own account). | | `pack` | `string` | yes | One of starter, builder, scale, volume. | ## Responses | Status | Meaning | Schema | | --- | --- | --- | | `200` | Open `url` to pay. | `CheckoutSession` | | `400` | Unknown pack, or account_id missing. | `Error` | | `401` | Not signed in, or an invalid API key. | `Error` | | `403` | Not an owner or admin, or a key buying for another account. | `Error` | | `404` | No such account among yours, or card purchases are off. | `Error` | ### CheckoutSession fields | Field | Type | Description | | --- | --- | --- | | `url` | `string` | Stripe Checkout page. Open it, or hand it to a person. | | `session_id` | `string` | | | `pack` | `string` | | | `credits` | `integer` | | | `usd` | `string` | | Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do. ## Example cURL: ```bash curl -X POST "https://api.groundsocial.dev/v1/billing/checkout" \ -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"pack":""}' ``` TypeScript: ```ts const res = await fetch('https://api.groundsocial.dev/v1/billing/checkout', { method: 'POST', headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({"pack":""}), }) if (!res.ok) throw new Error((await res.json()).error.hint) const data = await res.json() ``` Python: ```python import os, requests res = requests.post( "https://api.groundsocial.dev/v1/billing/checkout", headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}, json={"pack":""}, ) res.raise_for_status() data = res.json() ```