# Reddit — Zapi reference > Browse subreddits, users, and post discussions. **Base URL:** `https://api.zpi.web.id` **Auth:** Send `x-api-key: YOUR_KEY` header on every request. Get a free key at https://zpi.web.id/dashboard/keys. **Response envelope:** `{ status, message, content }` **Rate limit:** 60 req/min on free tier. **Related:** - Detail page: https://zpi.web.id/api/social-media/reddit - Endpoint catalog: https://zpi.web.id/category/social-media - Concise index: https://zpi.web.id/llms.txt - Full reference: https://zpi.web.id/llms-full.txt --- ## Reddit **Category:** social-media · **Slug:** `reddit` **Detail page:** https://zpi.web.id/api/social-media/reddit Browse subreddits, users, and post discussions. **Tags:** reddit, social ### User Fetch a user profile and submissions. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/social-media:reddit/user/:username` - **Cache TTL:** 300s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `username` | string | path | yes | Reddit username (without the u/ prefix) | | `after` | string | query | no | Cursor from a previous response's `after` field | **cURL:** ```bash curl "https://api.zpi.web.id/v1/social-media:reddit/user/:username?after=t3_1vdnb3e" \ -H "x-api-key: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/social-media:reddit/user/:username?after=t3_1vdnb3e", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/social-media:reddit/user/:username?after=t3_1vdnb3e", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` --- ### Post Fetch a post and its comment discussion. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/social-media:reddit/post/:postId` - **Cache TTL:** 300s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `postId` | string | path | yes | Reddit post ID, or a full reddit.com post URL | | `sub` | string | query | no | Subreddit, only needed when it cannot be read from a URL | | `limit` | number | query | no | Max comments to return. Default 100 | **cURL:** ```bash curl "https://api.zpi.web.id/v1/social-media:reddit/post/:postId?sub=programming&limit=50" \ -H "x-api-key: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/social-media:reddit/post/:postId?sub=programming&limit=50", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/social-media:reddit/post/:postId?sub=programming&limit=50", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` --- ### Subreddit Fetch posts from a subreddit. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/social-media:reddit/subreddit/:sub` - **Cache TTL:** 300s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `sub` | string | path | yes | Subreddit name (without the /r/ prefix) | | `sort` | enum(hot|new|top|rising) | query | no | Listing sort order. Default hot | | `time` | enum(hour|day|week|month|year|all) | query | no | Time window, only meaningful when sort=top | | `after` | string | query | no | Cursor from a previous response's `after` field | **cURL:** ```bash curl "https://api.zpi.web.id/v1/social-media:reddit/subreddit/:sub?sort=hot&time=week&after=t3_1vdnb3e" \ -H "x-api-key: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/social-media:reddit/subreddit/:sub?sort=hot&time=week&after=t3_1vdnb3e", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/social-media:reddit/subreddit/:sub?sort=hot&time=week&after=t3_1vdnb3e", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` --- _Generated: 2026-08-06T15:02:13.406Z_