---
title: "PRAW and snoowrap"
description: "Keep your PRAW or snoowrap script: point it at our compatible host and use your key."
canonical_url: https://groundsocial.dev/docs/praw
---
# PRAW and snoowrap

> Keep your PRAW or snoowrap script: point it at our compatible host and use your key.

> ## Agent Instructions
> The Groundsocial REST API is at https://api.groundsocial.dev (OpenAPI: https://groundsocial.dev/openapi.json). Set yourself up with https://groundsocial.dev/SKILL.md; the MCP server is https://api.groundsocial.dev/mcp. Every docs page is Markdown at its URL plus `.md`; the index is https://groundsocial.dev/llms.txt.

**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: "<domain>"` and uses `oauth.<domain>` and `www.<domain>`.

## 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',
})
```

_Canonical HTML: https://groundsocial.dev/docs/praw_

## Site Navigation

### Global Hub
- [Home](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Endpoints](https://groundsocial.dev/endpoints.md)
- [For agents](https://groundsocial.dev/agents.md)
- [Docs](https://groundsocial.dev/docs.md)
- [Compare](https://groundsocial.dev/compare.md)
- [Changelog](https://groundsocial.dev/changelog.md)
- [llms.txt](https://groundsocial.dev/llms.txt)
- [Agent skill](https://groundsocial.dev/SKILL.md)

### On This Topic
- [Groundsocial docs](https://groundsocial.dev/docs.md)
- [Quickstart](https://groundsocial.dev/docs/quickstart.md)
- [Authentication](https://groundsocial.dev/docs/authentication.md)
- [Credits and payments](https://groundsocial.dev/docs/payments.md)
- [Rate limits](https://groundsocial.dev/docs/rate-limits.md)
- [Errors](https://groundsocial.dev/docs/errors.md)
- [Data freshness and caching](https://groundsocial.dev/docs/freshness.md)
- [MCP server](https://groundsocial.dev/docs/mcp.md)
- [SKILL.md, llms.txt and Markdown twins](https://groundsocial.dev/docs/skill.md)
- [CLI](https://groundsocial.dev/docs/cli.md)
- [TypeScript SDK](https://groundsocial.dev/docs/sdk.md)
- [Legal and compliance](https://groundsocial.dev/docs/compliance.md)
- [API reference](https://groundsocial.dev/docs/api.md)

## Structured data

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://groundsocial.dev/"},{"@type":"ListItem","position":2,"name":"Docs","item":"https://groundsocial.dev/docs"},{"@type":"ListItem","position":3,"name":"PRAW and snoowrap","item":"https://groundsocial.dev/docs/praw"}]}
```
