# ThreadAPI Docs > Guides and API reference for ThreadAPI. Index: https://threadapi.dev/llms.txt # ThreadAPI API > Public REST API for billing, user balance, and Reddit data extraction. Source: https://threadapi.dev/api/ · Markdown: https://threadapi.dev/api/index.md Public REST API for billing, user balance, and Reddit data extraction. Version: 1.0.0 ## Servers - `https://api.threadapi.dev` ## Sections - [System](/api/tags/System/) - [User](/api/tags/User/) - [Jobs](/api/tags/Jobs/) - [Reddit](/api/tags/Reddit/) - [Monitors](/api/tags/Monitors/) # Create Monitor > Creates a new keyword monitor across Reddit posts and/or comments. Billed 10 credits upfront for the first 24 hours. Daily match volume and webhooks are free. Source: https://threadapi.dev/api/Monitors/createMonitor/ · Markdown: https://threadapi.dev/api/Monitors/createMonitor/index.md Path: ThreadAPI API › Monitors `POST /v1/monitors` Creates a new keyword monitor across Reddit posts and/or comments. Billed 10 credits upfront for the first 24 hours. Daily match volume and webhooks are free. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Request body _Required._ - `name` (`createMonitor.name`; string, required) - example `"Mentions of restic"` - `keywords` (`createMonitor.keywords`; array, required) - example `["restic","\"borg backup\""]` - `exclude` (`createMonitor.exclude`; array, optional) - example `["hiring"]` - `subreddits` (`createMonitor.subreddits`; array, optional) - example `["selfhosted","DataHoarder"]` - `posts` (`createMonitor.posts`; boolean, optional) - default `true` - `comments` (`createMonitor.comments`; boolean, optional) - default `true` - `nsfw` (`createMonitor.nsfw`; boolean, optional) - default `false` - `webhook_url` (`createMonitor.webhook_url`; string, optional) - example `"https://example.com/hook"` - `webhook_kind` (`createMonitor.webhook_kind`; string, optional) - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"` ## Example request ```json { "name": "Mentions of restic", "keywords": [ "restic", "\"borg backup\"" ], "exclude": [ "hiring" ], "subreddits": [ "selfhosted", "DataHoarder" ], "posts": true, "comments": true, "nsfw": false, "webhook_url": "https://example.com/hook", "webhook_kind": "generic" } ``` ## Code samples ### cURL ```bash curl --request POST \ --url https://api.threadapi.dev/v1/monitors \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "name": "Mentions of restic", "keywords": [ "restic", "\"borg backup\"" ], "exclude": [ "hiring" ], "subreddits": [ "selfhosted", "DataHoarder" ], "posts": true, "comments": true, "nsfw": false, "webhook_url": "https://example.com/hook", "webhook_kind": "generic" } ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors'; const options = { method: 'POST', headers: {'Content-Type': 'application/json', Authorization: 'Bearer '}, body: JSON.stringify({ name: 'Mentions of restic', keywords: ['restic', '"borg backup"'], exclude: ['hiring'], subreddits: ['selfhosted', 'DataHoarder'], posts: true, comments: true, nsfw: false, webhook_url: 'https://example.com/hook', webhook_kind: 'generic' }) }; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors" payload = { "name": "Mentions of restic", "keywords": ["restic", "\"borg backup\""], "exclude": ["hiring"], "subreddits": ["selfhosted", "DataHoarder"], "posts": True, "comments": True, "nsfw": False, "webhook_url": "https://example.com/hook", "webhook_kind": "generic" } headers = { "Content-Type": "application/json", "Authorization": "Bearer " } response = requests.post(url, json=payload, headers=headers) print(response.text) ``` ## Responses ### 201 Created monitor and HMAC secret #### Example ```json { "monitor": { "id": "string", "name": "string", "keywords": [ "string" ], "exclude": [ "string" ], "subreddits": [ "string" ], "include_posts": true, "include_comments": true, "nsfw": true, "webhook_url": "string", "webhook_kind": "generic", "status": "active", "webhook_failing": true, "next_charge_at": "2019-08-24T14:15:22Z", "last_match_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "webhook_secret": "string" } ``` - `monitor` (`createMonitor.response.201.monitor`; object, optional) - `id` (`createMonitor.response.201.monitor.id`; string, required) - `name` (`createMonitor.response.201.monitor.name`; string, required) - `keywords` (`createMonitor.response.201.monitor.keywords`; array, required) - `include_posts` (`createMonitor.response.201.monitor.include_posts`; boolean, required) - `include_comments` (`createMonitor.response.201.monitor.include_comments`; boolean, required) - `nsfw` (`createMonitor.response.201.monitor.nsfw`; boolean, required) - `status` (`createMonitor.response.201.monitor.status`; string, required) - one of `"active"`, `"paused"`, `"paused_balance"`, `"deleted"` - `next_charge_at` (`createMonitor.response.201.monitor.next_charge_at`; string, required) - format `date-time` - `created_at` (`createMonitor.response.201.monitor.created_at`; string, required) - format `date-time` - `updated_at` (`createMonitor.response.201.monitor.updated_at`; string, required) - format `date-time` - `exclude` (`createMonitor.response.201.monitor.exclude`; array, optional) - `subreddits` (`createMonitor.response.201.monitor.subreddits`; array, optional) - `webhook_url` (`createMonitor.response.201.monitor.webhook_url`; string | null, optional) - `webhook_kind` (`createMonitor.response.201.monitor.webhook_kind`; string | null, optional) - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null` - `webhook_failing` (`createMonitor.response.201.monitor.webhook_failing`; boolean, optional) - `last_match_at` (`createMonitor.response.201.monitor.last_match_at`; string | null, optional) - format `date-time` - `webhook_secret` (`createMonitor.response.201.webhook_secret`; string, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`createMonitor.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`createMonitor.response.400.error.code`; string, required) - example `"not_found"` - `message` (`createMonitor.response.400.error.message`; string, required) - `retryable` (`createMonitor.response.400.error.retryable`; boolean, required) - `retry_after` (`createMonitor.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`createMonitor.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`createMonitor.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`createMonitor.response.401.error.code`; string, required) - example `"not_found"` - `message` (`createMonitor.response.401.error.message`; string, required) - `retryable` (`createMonitor.response.401.error.retryable`; boolean, required) - `retry_after` (`createMonitor.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`createMonitor.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`createMonitor.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`createMonitor.response.402.error.code`; string, required) - example `"not_found"` - `message` (`createMonitor.response.402.error.message`; string, required) - `retryable` (`createMonitor.response.402.error.retryable`; boolean, required) - `retry_after` (`createMonitor.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`createMonitor.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`createMonitor.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`createMonitor.response.429.error.code`; string, required) - example `"not_found"` - `message` (`createMonitor.response.429.error.message`; string, required) - `retryable` (`createMonitor.response.429.error.retryable`; boolean, required) - `retry_after` (`createMonitor.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`createMonitor.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Delete Monitor > Soft-deletes a monitor. Charging stops immediately. Source: https://threadapi.dev/api/Monitors/deleteMonitor/ · Markdown: https://threadapi.dev/api/Monitors/deleteMonitor/index.md Path: ThreadAPI API › Monitors `DELETE /v1/monitors/{id}` Soft-deletes a monitor. Charging stops immediately. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`deleteMonitor.path.id`; string, required) ## Code samples ### cURL ```bash curl --request DELETE \ --url 'https://api.threadapi.dev/v1/monitors/' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors/'; const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors/" headers = {"Authorization": "Bearer "} response = requests.delete(url, headers=headers) print(response.text) ``` ## Responses ### 200 Monitor deleted #### Example ```json { "status": "deleted" } ``` - `status` (`deleteMonitor.response.200.status`; string, optional) - example `"deleted"` ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`deleteMonitor.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`deleteMonitor.response.401.error.code`; string, required) - example `"not_found"` - `message` (`deleteMonitor.response.401.error.message`; string, required) - `retryable` (`deleteMonitor.response.401.error.retryable`; boolean, required) - `retry_after` (`deleteMonitor.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`deleteMonitor.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`deleteMonitor.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`deleteMonitor.response.404.error.code`; string, required) - example `"not_found"` - `message` (`deleteMonitor.response.404.error.message`; string, required) - `retryable` (`deleteMonitor.response.404.error.retryable`; boolean, required) - `retry_after` (`deleteMonitor.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`deleteMonitor.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Get Monitor > Returns monitor configuration and 24-hour/7-day delivery and match statistics. Source: https://threadapi.dev/api/Monitors/getMonitor/ · Markdown: https://threadapi.dev/api/Monitors/getMonitor/index.md Path: ThreadAPI API › Monitors `GET /v1/monitors/{id}` Returns monitor configuration and 24-hour/7-day delivery and match statistics. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`getMonitor.path.id`; string, required) ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/monitors/' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors/'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors/" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 Monitor with statistics #### Example ```json { "monitor": { "id": "string", "name": "string", "keywords": [ "string" ], "exclude": [ "string" ], "subreddits": [ "string" ], "include_posts": true, "include_comments": true, "nsfw": true, "webhook_url": "string", "webhook_kind": "generic", "status": "active", "webhook_failing": true, "next_charge_at": "2019-08-24T14:15:22Z", "last_match_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "stats": { "matches_today": 0, "suppressed_today": 0, "matches_7d": 0, "last_match_at": "2019-08-24T14:15:22Z", "delivery_failures_24h": 0 } } ``` - `monitor` (`getMonitor.response.200.monitor`; object, optional) - `id` (`getMonitor.response.200.monitor.id`; string, required) - `name` (`getMonitor.response.200.monitor.name`; string, required) - `keywords` (`getMonitor.response.200.monitor.keywords`; array, required) - `include_posts` (`getMonitor.response.200.monitor.include_posts`; boolean, required) - `include_comments` (`getMonitor.response.200.monitor.include_comments`; boolean, required) - `nsfw` (`getMonitor.response.200.monitor.nsfw`; boolean, required) - `status` (`getMonitor.response.200.monitor.status`; string, required) - one of `"active"`, `"paused"`, `"paused_balance"`, `"deleted"` - `next_charge_at` (`getMonitor.response.200.monitor.next_charge_at`; string, required) - format `date-time` - `created_at` (`getMonitor.response.200.monitor.created_at`; string, required) - format `date-time` - `updated_at` (`getMonitor.response.200.monitor.updated_at`; string, required) - format `date-time` - `exclude` (`getMonitor.response.200.monitor.exclude`; array, optional) - `subreddits` (`getMonitor.response.200.monitor.subreddits`; array, optional) - `webhook_url` (`getMonitor.response.200.monitor.webhook_url`; string | null, optional) - `webhook_kind` (`getMonitor.response.200.monitor.webhook_kind`; string | null, optional) - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null` - `webhook_failing` (`getMonitor.response.200.monitor.webhook_failing`; boolean, optional) - `last_match_at` (`getMonitor.response.200.monitor.last_match_at`; string | null, optional) - format `date-time` - `stats` (`getMonitor.response.200.stats`; object, optional) - `matches_today` (`getMonitor.response.200.stats.matches_today`; integer, required) - `suppressed_today` (`getMonitor.response.200.stats.suppressed_today`; integer, required) - `matches_7d` (`getMonitor.response.200.stats.matches_7d`; integer, required) - `delivery_failures_24h` (`getMonitor.response.200.stats.delivery_failures_24h`; integer, required) - `last_match_at` (`getMonitor.response.200.stats.last_match_at`; string | null, optional) - format `date-time` ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getMonitor.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getMonitor.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getMonitor.response.401.error.message`; string, required) - `retryable` (`getMonitor.response.401.error.retryable`; boolean, required) - `retry_after` (`getMonitor.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getMonitor.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getMonitor.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getMonitor.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getMonitor.response.404.error.message`; string, required) - `retryable` (`getMonitor.response.404.error.retryable`; boolean, required) - `retry_after` (`getMonitor.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getMonitor.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Get Monitor Matches > Returns matches collected by the monitor. Supports streaming pagination via `after`, or reverse chronological sorting with `order=newest`. Source: https://threadapi.dev/api/Monitors/getMonitorMatches/ · Markdown: https://threadapi.dev/api/Monitors/getMonitorMatches/index.md Path: ThreadAPI API › Monitors `GET /v1/monitors/{id}/matches` Returns matches collected by the monitor. Supports streaming pagination via `after`, or reverse chronological sorting with `order=newest`. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`getMonitorMatches.path.id`; string, required) ## Query parameters - `order` (`getMonitorMatches.query.order`; string, optional) — Sort ordering for returned matches. - one of `"oldest"`, `"newest"`; default `"oldest"` - `after` (`getMonitorMatches.query.after`; string, optional) — With `order=oldest`, cursor for the next page of matches. - `before` (`getMonitorMatches.query.before`; string, optional) — With `order=newest`, cursor for the next page of matches. - `limit` (`getMonitorMatches.query.limit`; integer, optional) — Maximum items to return. - min 1; max 200; default `100` ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/monitors//matches' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors//matches'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors//matches" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 List of matches #### Example ```json { "items": [ { "id": "string", "monitor_id": "string", "thing_id": "string", "kind": "post", "subreddit": "string", "author": "string", "title": "string", "body": "string", "permalink": "string", "post_id": "string", "created_utc": "2019-08-24T14:15:22Z", "matched_terms": [ "string" ], "suppressed": true, "delivery_status": "none", "delivered_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z" } ], "after": "string", "before": "string" } ``` - `items` (`getMonitorMatches.response.200.items`; array, optional) - `id` (`getMonitorMatches.response.200.items.id`; string, required) - `monitor_id` (`getMonitorMatches.response.200.items.monitor_id`; string, required) - `thing_id` (`getMonitorMatches.response.200.items.thing_id`; string, required) - `kind` (`getMonitorMatches.response.200.items.kind`; string, required) - one of `"post"`, `"comment"` - `subreddit` (`getMonitorMatches.response.200.items.subreddit`; string, required) - `author` (`getMonitorMatches.response.200.items.author`; string, required) - `title` (`getMonitorMatches.response.200.items.title`; string, required) - `body` (`getMonitorMatches.response.200.items.body`; string, required) - `permalink` (`getMonitorMatches.response.200.items.permalink`; string, required) - `post_id` (`getMonitorMatches.response.200.items.post_id`; string, required) - `created_utc` (`getMonitorMatches.response.200.items.created_utc`; string, required) - format `date-time` - `matched_terms` (`getMonitorMatches.response.200.items.matched_terms`; array, required) - `suppressed` (`getMonitorMatches.response.200.items.suppressed`; boolean, required) - `delivery_status` (`getMonitorMatches.response.200.items.delivery_status`; string, required) - one of `"none"`, `"pending"`, `"delivered"`, `"failed"`, `"skipped"` - `created_at` (`getMonitorMatches.response.200.items.created_at`; string, required) - format `date-time` - `delivered_at` (`getMonitorMatches.response.200.items.delivered_at`; string | null, optional) - format `date-time` - `after` (`getMonitorMatches.response.200.after`; string, optional) — With `order=oldest`, the cursor for the next page when one is waiting. - `before` (`getMonitorMatches.response.200.before`; string, optional) ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getMonitorMatches.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getMonitorMatches.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getMonitorMatches.response.401.error.message`; string, required) - `retryable` (`getMonitorMatches.response.401.error.retryable`; boolean, required) - `retry_after` (`getMonitorMatches.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getMonitorMatches.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getMonitorMatches.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getMonitorMatches.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getMonitorMatches.response.404.error.message`; string, required) - `retryable` (`getMonitorMatches.response.404.error.retryable`; boolean, required) - `retry_after` (`getMonitorMatches.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getMonitorMatches.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # List Monitors > Returns all monitors configured by the authenticated user. Source: https://threadapi.dev/api/Monitors/listMonitors/ · Markdown: https://threadapi.dev/api/Monitors/listMonitors/index.md Path: ThreadAPI API › Monitors `GET /v1/monitors` Returns all monitors configured by the authenticated user. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Code samples ### cURL ```bash curl --request GET \ --url https://api.threadapi.dev/v1/monitors \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 List of monitors #### Example ```json { "items": [ { "id": "string", "name": "string", "keywords": [ "string" ], "exclude": [ "string" ], "subreddits": [ "string" ], "include_posts": true, "include_comments": true, "nsfw": true, "webhook_url": "string", "webhook_kind": "generic", "status": "active", "webhook_failing": true, "next_charge_at": "2019-08-24T14:15:22Z", "last_match_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ], "limit": 0, "used": 0, "daily_match_cap": 0 } ``` - `items` (`listMonitors.response.200.items`; array, optional) - `id` (`listMonitors.response.200.items.id`; string, required) - `name` (`listMonitors.response.200.items.name`; string, required) - `keywords` (`listMonitors.response.200.items.keywords`; array, required) - `include_posts` (`listMonitors.response.200.items.include_posts`; boolean, required) - `include_comments` (`listMonitors.response.200.items.include_comments`; boolean, required) - `nsfw` (`listMonitors.response.200.items.nsfw`; boolean, required) - `status` (`listMonitors.response.200.items.status`; string, required) - one of `"active"`, `"paused"`, `"paused_balance"`, `"deleted"` - `next_charge_at` (`listMonitors.response.200.items.next_charge_at`; string, required) - format `date-time` - `created_at` (`listMonitors.response.200.items.created_at`; string, required) - format `date-time` - `updated_at` (`listMonitors.response.200.items.updated_at`; string, required) - format `date-time` - `exclude` (`listMonitors.response.200.items.exclude`; array, optional) - `subreddits` (`listMonitors.response.200.items.subreddits`; array, optional) - `webhook_url` (`listMonitors.response.200.items.webhook_url`; string | null, optional) - `webhook_kind` (`listMonitors.response.200.items.webhook_kind`; string | null, optional) - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null` - `webhook_failing` (`listMonitors.response.200.items.webhook_failing`; boolean, optional) - `last_match_at` (`listMonitors.response.200.items.last_match_at`; string | null, optional) - format `date-time` - `limit` (`listMonitors.response.200.limit`; integer, optional) - `used` (`listMonitors.response.200.used`; integer, optional) - `daily_match_cap` (`listMonitors.response.200.daily_match_cap`; integer, optional) ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listMonitors.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listMonitors.response.401.error.code`; string, required) - example `"not_found"` - `message` (`listMonitors.response.401.error.message`; string, required) - `retryable` (`listMonitors.response.401.error.retryable`; boolean, required) - `retry_after` (`listMonitors.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listMonitors.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Pause Monitor > Pauses a monitor, halting match tracking and daily charges. Source: https://threadapi.dev/api/Monitors/pauseMonitor/ · Markdown: https://threadapi.dev/api/Monitors/pauseMonitor/index.md Path: ThreadAPI API › Monitors `POST /v1/monitors/{id}/pause` Pauses a monitor, halting match tracking and daily charges. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`pauseMonitor.path.id`; string, required) ## Code samples ### cURL ```bash curl --request POST \ --url 'https://api.threadapi.dev/v1/monitors//pause' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors//pause'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors//pause" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.text) ``` ## Responses ### 200 Monitor paused #### Example ```json { "status": "paused" } ``` - `status` (`pauseMonitor.response.200.status`; string, optional) - example `"paused"` ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`pauseMonitor.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`pauseMonitor.response.401.error.code`; string, required) - example `"not_found"` - `message` (`pauseMonitor.response.401.error.message`; string, required) - `retryable` (`pauseMonitor.response.401.error.retryable`; boolean, required) - `retry_after` (`pauseMonitor.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`pauseMonitor.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`pauseMonitor.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`pauseMonitor.response.404.error.code`; string, required) - example `"not_found"` - `message` (`pauseMonitor.response.404.error.message`; string, required) - `retryable` (`pauseMonitor.response.404.error.retryable`; boolean, required) - `retry_after` (`pauseMonitor.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`pauseMonitor.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Resume Monitor > Resumes a paused monitor. Immediately charges 10 credits for the next 24 hours. Source: https://threadapi.dev/api/Monitors/resumeMonitor/ · Markdown: https://threadapi.dev/api/Monitors/resumeMonitor/index.md Path: ThreadAPI API › Monitors `POST /v1/monitors/{id}/resume` Resumes a paused monitor. Immediately charges 10 credits for the next 24 hours. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`resumeMonitor.path.id`; string, required) ## Code samples ### cURL ```bash curl --request POST \ --url 'https://api.threadapi.dev/v1/monitors//resume' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors//resume'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors//resume" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.text) ``` ## Responses ### 200 Resumed monitor #### Example ```json { "monitor": { "id": "string", "name": "string", "keywords": [ "string" ], "exclude": [ "string" ], "subreddits": [ "string" ], "include_posts": true, "include_comments": true, "nsfw": true, "webhook_url": "string", "webhook_kind": "generic", "status": "active", "webhook_failing": true, "next_charge_at": "2019-08-24T14:15:22Z", "last_match_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } } ``` - `monitor` (`resumeMonitor.response.200.monitor`; object, optional) - `id` (`resumeMonitor.response.200.monitor.id`; string, required) - `name` (`resumeMonitor.response.200.monitor.name`; string, required) - `keywords` (`resumeMonitor.response.200.monitor.keywords`; array, required) - `include_posts` (`resumeMonitor.response.200.monitor.include_posts`; boolean, required) - `include_comments` (`resumeMonitor.response.200.monitor.include_comments`; boolean, required) - `nsfw` (`resumeMonitor.response.200.monitor.nsfw`; boolean, required) - `status` (`resumeMonitor.response.200.monitor.status`; string, required) - one of `"active"`, `"paused"`, `"paused_balance"`, `"deleted"` - `next_charge_at` (`resumeMonitor.response.200.monitor.next_charge_at`; string, required) - format `date-time` - `created_at` (`resumeMonitor.response.200.monitor.created_at`; string, required) - format `date-time` - `updated_at` (`resumeMonitor.response.200.monitor.updated_at`; string, required) - format `date-time` - `exclude` (`resumeMonitor.response.200.monitor.exclude`; array, optional) - `subreddits` (`resumeMonitor.response.200.monitor.subreddits`; array, optional) - `webhook_url` (`resumeMonitor.response.200.monitor.webhook_url`; string | null, optional) - `webhook_kind` (`resumeMonitor.response.200.monitor.webhook_kind`; string | null, optional) - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null` - `webhook_failing` (`resumeMonitor.response.200.monitor.webhook_failing`; boolean, optional) - `last_match_at` (`resumeMonitor.response.200.monitor.last_match_at`; string | null, optional) - format `date-time` ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`resumeMonitor.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`resumeMonitor.response.401.error.code`; string, required) - example `"not_found"` - `message` (`resumeMonitor.response.401.error.message`; string, required) - `retryable` (`resumeMonitor.response.401.error.retryable`; boolean, required) - `retry_after` (`resumeMonitor.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`resumeMonitor.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`resumeMonitor.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`resumeMonitor.response.402.error.code`; string, required) - example `"not_found"` - `message` (`resumeMonitor.response.402.error.message`; string, required) - `retryable` (`resumeMonitor.response.402.error.retryable`; boolean, required) - `retry_after` (`resumeMonitor.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`resumeMonitor.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`resumeMonitor.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`resumeMonitor.response.404.error.code`; string, required) - example `"not_found"` - `message` (`resumeMonitor.response.404.error.message`; string, required) - `retryable` (`resumeMonitor.response.404.error.retryable`; boolean, required) - `retry_after` (`resumeMonitor.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`resumeMonitor.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Rotate Webhook Secret > Generates and returns a new HMAC secret for generic webhooks. Source: https://threadapi.dev/api/Monitors/rotateMonitorSecret/ · Markdown: https://threadapi.dev/api/Monitors/rotateMonitorSecret/index.md Path: ThreadAPI API › Monitors `POST /v1/monitors/{id}/rotate-secret` Generates and returns a new HMAC secret for generic webhooks. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`rotateMonitorSecret.path.id`; string, required) ## Code samples ### cURL ```bash curl --request POST \ --url 'https://api.threadapi.dev/v1/monitors//rotate-secret' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors//rotate-secret'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors//rotate-secret" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.text) ``` ## Responses ### 200 New secret #### Example ```json { "webhook_secret": "string" } ``` - `webhook_secret` (`rotateMonitorSecret.response.200.webhook_secret`; string, optional) ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`rotateMonitorSecret.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`rotateMonitorSecret.response.401.error.code`; string, required) - example `"not_found"` - `message` (`rotateMonitorSecret.response.401.error.message`; string, required) - `retryable` (`rotateMonitorSecret.response.401.error.retryable`; boolean, required) - `retry_after` (`rotateMonitorSecret.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`rotateMonitorSecret.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`rotateMonitorSecret.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`rotateMonitorSecret.response.404.error.code`; string, required) - example `"not_found"` - `message` (`rotateMonitorSecret.response.404.error.message`; string, required) - `retryable` (`rotateMonitorSecret.response.404.error.retryable`; boolean, required) - `retry_after` (`rotateMonitorSecret.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`rotateMonitorSecret.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Test Webhook Delivery > Sends a sample test match to the configured webhook URL. Rate limited to 5 per minute. Source: https://threadapi.dev/api/Monitors/testMonitor/ · Markdown: https://threadapi.dev/api/Monitors/testMonitor/index.md Path: ThreadAPI API › Monitors `POST /v1/monitors/{id}/test` Sends a sample test match to the configured webhook URL. Rate limited to 5 per minute. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`testMonitor.path.id`; string, required) ## Code samples ### cURL ```bash curl --request POST \ --url 'https://api.threadapi.dev/v1/monitors//test' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors//test'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors//test" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.text) ``` ## Responses ### 200 Test delivery outcome #### Example ```json { "delivered": true, "status": 0, "error": "string" } ``` - `delivered` (`testMonitor.response.200.delivered`; boolean, optional) - `status` (`testMonitor.response.200.status`; integer, optional) - `error` (`testMonitor.response.200.error`; string | null, optional) ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`testMonitor.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`testMonitor.response.401.error.code`; string, required) - example `"not_found"` - `message` (`testMonitor.response.401.error.message`; string, required) - `retryable` (`testMonitor.response.401.error.retryable`; boolean, required) - `retry_after` (`testMonitor.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`testMonitor.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`testMonitor.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`testMonitor.response.404.error.code`; string, required) - example `"not_found"` - `message` (`testMonitor.response.404.error.message`; string, required) - `retryable` (`testMonitor.response.404.error.retryable`; boolean, required) - `retry_after` (`testMonitor.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`testMonitor.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`testMonitor.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`testMonitor.response.429.error.code`; string, required) - example `"not_found"` - `message` (`testMonitor.response.429.error.message`; string, required) - `retryable` (`testMonitor.response.429.error.retryable`; boolean, required) - `retry_after` (`testMonitor.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`testMonitor.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Update Monitor > Updates monitor settings. Changing the webhook URL clears any webhook_failing status. Source: https://threadapi.dev/api/Monitors/updateMonitor/ · Markdown: https://threadapi.dev/api/Monitors/updateMonitor/index.md Path: ThreadAPI API › Monitors `PATCH /v1/monitors/{id}` Updates monitor settings. Changing the webhook URL clears any webhook_failing status. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Path parameters - `id` (`updateMonitor.path.id`; string, required) ## Request body _Required._ - `name` (`updateMonitor.name`; string, optional) - `keywords` (`updateMonitor.keywords`; array, optional) - `exclude` (`updateMonitor.exclude`; array, optional) - `subreddits` (`updateMonitor.subreddits`; array, optional) - `posts` (`updateMonitor.posts`; boolean, optional) - `comments` (`updateMonitor.comments`; boolean, optional) - `nsfw` (`updateMonitor.nsfw`; boolean, optional) - `webhook_url` (`updateMonitor.webhook_url`; string | null, optional) - `webhook_kind` (`updateMonitor.webhook_kind`; string | null, optional) - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null` ## Example request ```json { "name": "string", "keywords": [ "string" ], "exclude": [ "string" ], "subreddits": [ "string" ], "posts": true, "comments": true, "nsfw": true, "webhook_url": "string", "webhook_kind": "generic" } ``` ## Code samples ### cURL ```bash curl --request PATCH \ --url 'https://api.threadapi.dev/v1/monitors/' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "name": "string", "keywords": [ "string" ], "exclude": [ "string" ], "subreddits": [ "string" ], "posts": true, "comments": true, "nsfw": true, "webhook_url": "string", "webhook_kind": "generic" } ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/monitors/'; const options = { method: 'PATCH', headers: {'Content-Type': 'application/json', Authorization: 'Bearer '}, body: JSON.stringify({ name: 'string', keywords: ['string'], exclude: ['string'], subreddits: ['string'], posts: true, comments: true, nsfw: true, webhook_url: 'string', webhook_kind: 'generic' }) }; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/monitors/" payload = { "name": "string", "keywords": ["string"], "exclude": ["string"], "subreddits": ["string"], "posts": True, "comments": True, "nsfw": True, "webhook_url": "string", "webhook_kind": "generic" } headers = { "Content-Type": "application/json", "Authorization": "Bearer " } response = requests.patch(url, json=payload, headers=headers) print(response.text) ``` ## Responses ### 200 Updated monitor #### Example ```json { "monitor": { "id": "string", "name": "string", "keywords": [ "string" ], "exclude": [ "string" ], "subreddits": [ "string" ], "include_posts": true, "include_comments": true, "nsfw": true, "webhook_url": "string", "webhook_kind": "generic", "status": "active", "webhook_failing": true, "next_charge_at": "2019-08-24T14:15:22Z", "last_match_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } } ``` - `monitor` (`updateMonitor.response.200.monitor`; object, optional) - `id` (`updateMonitor.response.200.monitor.id`; string, required) - `name` (`updateMonitor.response.200.monitor.name`; string, required) - `keywords` (`updateMonitor.response.200.monitor.keywords`; array, required) - `include_posts` (`updateMonitor.response.200.monitor.include_posts`; boolean, required) - `include_comments` (`updateMonitor.response.200.monitor.include_comments`; boolean, required) - `nsfw` (`updateMonitor.response.200.monitor.nsfw`; boolean, required) - `status` (`updateMonitor.response.200.monitor.status`; string, required) - one of `"active"`, `"paused"`, `"paused_balance"`, `"deleted"` - `next_charge_at` (`updateMonitor.response.200.monitor.next_charge_at`; string, required) - format `date-time` - `created_at` (`updateMonitor.response.200.monitor.created_at`; string, required) - format `date-time` - `updated_at` (`updateMonitor.response.200.monitor.updated_at`; string, required) - format `date-time` - `exclude` (`updateMonitor.response.200.monitor.exclude`; array, optional) - `subreddits` (`updateMonitor.response.200.monitor.subreddits`; array, optional) - `webhook_url` (`updateMonitor.response.200.monitor.webhook_url`; string | null, optional) - `webhook_kind` (`updateMonitor.response.200.monitor.webhook_kind`; string | null, optional) - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null` - `webhook_failing` (`updateMonitor.response.200.monitor.webhook_failing`; boolean, optional) - `last_match_at` (`updateMonitor.response.200.monitor.last_match_at`; string | null, optional) - format `date-time` ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`updateMonitor.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`updateMonitor.response.400.error.code`; string, required) - example `"not_found"` - `message` (`updateMonitor.response.400.error.message`; string, required) - `retryable` (`updateMonitor.response.400.error.retryable`; boolean, required) - `retry_after` (`updateMonitor.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`updateMonitor.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`updateMonitor.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`updateMonitor.response.401.error.code`; string, required) - example `"not_found"` - `message` (`updateMonitor.response.401.error.message`; string, required) - `retryable` (`updateMonitor.response.401.error.retryable`; boolean, required) - `retry_after` (`updateMonitor.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`updateMonitor.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`updateMonitor.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`updateMonitor.response.404.error.code`; string, required) - example `"not_found"` - `message` (`updateMonitor.response.404.error.message`; string, required) - `retryable` (`updateMonitor.response.404.error.retryable`; boolean, required) - `retry_after` (`updateMonitor.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`updateMonitor.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Read Post > Returns a Reddit post with its nested comment tree and synthesized discussion digest, formatted as JSON, Markdown, or a graph. Reddit hides long threads behind "load more comments"; threadapi automatically follows those links until it has collected the requested comments. The digest highlights OP follow-up replies, top-upvoted comments, and controversial discussions. Source: https://threadapi.dev/api/Reddit/getPost/ · Markdown: https://threadapi.dev/api/Reddit/getPost/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/post` Returns a Reddit post with its nested comment tree and synthesized discussion digest, formatted as JSON, Markdown, or a graph. Reddit hides long threads behind "load more comments"; threadapi automatically follows those links until it has collected the requested comments. The digest highlights OP follow-up replies, top-upvoted comments, and controversial discussions. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `url` (`getPost.query.url`; string, optional) — Reddit post URL (any reddit.com, redd.it, or share link) or post ID. Either `url` or `id` is required. - `id` (`getPost.query.id`; string, optional) — Post ID (e.g. `1x144ok`) or `t3_` fullname. Alternative to `url`. - `comment` (`getPost.query.comment`; string, optional) — Comment ID to focus on. When set, returns its parent ancestor chain and direct replies. - `context` (`getPost.query.context`; integer, optional) — Number of ancestor context levels to include above the focused comment. - min 0; max 8; default `3` - `max_comments` (`getPost.query.max_comments`; integer, optional) — Maximum comments to return. Set to `0` to return the post alone. - min 0; max 2000; default `200` - `format` (`getPost.query.format`; string, optional) — Response format: `json` (complete post and digest), `md` (Markdown for LLMs), or `graph` (discussion digest only). - one of `"json"`, `"md"`, `"graph"`; default `"json"` ## Code samples ### cURL ```bash curl --request GET \ --url https://api.threadapi.dev/v1/reddit/post \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/post'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/post" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 The post. #### Body (application/json) - `post` (`getPost.response.200.post`; object, optional) - `id` (`getPost.response.200.post.id`; string, optional) - `name` (`getPost.response.200.post.name`; string, optional) - `domain` (`getPost.response.200.post.domain`; string, optional) - `is_self` (`getPost.response.200.post.is_self`; boolean, optional) - `flair` (`getPost.response.200.post.flair`; string, optional) - `spoiler` (`getPost.response.200.post.spoiler`; boolean, optional) - `is_pinned` (`getPost.response.200.post.is_pinned`; boolean, optional) - `locked` (`getPost.response.200.post.locked`; boolean, optional) - `removed` (`getPost.response.200.post.removed`; boolean, optional) - `subreddit` (`getPost.response.200.post.subreddit`; string, optional) - `title` (`getPost.response.200.post.title`; string, optional) - `author` (`getPost.response.200.post.author`; string, optional) - `score` (`getPost.response.200.post.score`; integer, optional) - `upvote_ratio` (`getPost.response.200.post.upvote_ratio`; number, optional) - `comments_count` (`getPost.response.200.post.comments_count`; integer, optional) - `url` (`getPost.response.200.post.url`; string, optional) - `permalink` (`getPost.response.200.post.permalink`; string, optional) - `body` (`getPost.response.200.post.body`; string, optional) - `is_video` (`getPost.response.200.post.is_video`; boolean, optional) - `is_nsfw` (`getPost.response.200.post.is_nsfw`; boolean, optional) - `media` (`getPost.response.200.post.media`; array, optional) - `type` (`getPost.response.200.post.media.type`; string, optional) - one of `"image"`, `"video"`, `"gallery"` - `url` (`getPost.response.200.post.media.url`; string, optional) - `width` (`getPost.response.200.post.media.width`; integer, optional) - `height` (`getPost.response.200.post.media.height`; integer, optional) - `caption` (`getPost.response.200.post.media.caption`; string, optional) - `poll` (`getPost.response.200.post.poll`; object, optional) - `total_votes` (`getPost.response.200.post.poll.total_votes`; integer, optional) - `is_closed` (`getPost.response.200.post.poll.is_closed`; boolean, optional) - `options` (`getPost.response.200.post.poll.options`; array, optional) - `id` (`getPost.response.200.post.poll.options.id`; string, optional) - `text` (`getPost.response.200.post.poll.options.text`; string, optional) - `vote_count` (`getPost.response.200.post.poll.options.vote_count`; integer, optional) - `crosspost_of` (`getPost.response.200.post.crosspost_of`; object, optional) - `id` (`getPost.response.200.post.crosspost_of.id`; string, optional) - `subreddit` (`getPost.response.200.post.crosspost_of.subreddit`; string, optional) - `title` (`getPost.response.200.post.crosspost_of.title`; string, optional) - `author` (`getPost.response.200.post.crosspost_of.author`; string, optional) - `permalink` (`getPost.response.200.post.crosspost_of.permalink`; string, optional) - `comments` (`getPost.response.200.post.comments`; array, optional) - `id` (`getPost.response.200.post.comments.id`; string, optional) - `parent_id` (`getPost.response.200.post.comments.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.post.comments.author`; string, optional) - `score` (`getPost.response.200.post.comments.score`; integer, optional) - `body` (`getPost.response.200.post.comments.body`; string, optional) - `depth` (`getPost.response.200.post.comments.depth`; integer, optional) - `is_op` (`getPost.response.200.post.comments.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.post.comments.replies`; array, optional) - `id` (`getPost.response.200.post.comments.replies.id`; string, optional) - `parent_id` (`getPost.response.200.post.comments.replies.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.post.comments.replies.author`; string, optional) - `score` (`getPost.response.200.post.comments.replies.score`; integer, optional) - `body` (`getPost.response.200.post.comments.replies.body`; string, optional) - `depth` (`getPost.response.200.post.comments.replies.depth`; integer, optional) - `is_op` (`getPost.response.200.post.comments.replies.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.post.comments.replies.replies`; array, optional) - `discussion_graph` (`getPost.response.200.discussion_graph`; object, optional) - `post_id` (`getPost.response.200.discussion_graph.post_id`; string, optional) - `title` (`getPost.response.200.discussion_graph.title`; string, optional) - `author` (`getPost.response.200.discussion_graph.author`; string, optional) - `author_followups` (`getPost.response.200.discussion_graph.author_followups`; array, optional) — The original poster's own comments in the thread. - `id` (`getPost.response.200.discussion_graph.author_followups.id`; string, optional) - `parent_id` (`getPost.response.200.discussion_graph.author_followups.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.discussion_graph.author_followups.author`; string, optional) - `score` (`getPost.response.200.discussion_graph.author_followups.score`; integer, optional) - `body` (`getPost.response.200.discussion_graph.author_followups.body`; string, optional) - `depth` (`getPost.response.200.discussion_graph.author_followups.depth`; integer, optional) - `is_op` (`getPost.response.200.discussion_graph.author_followups.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.discussion_graph.author_followups.replies`; array, optional) - `id` (`getPost.response.200.discussion_graph.author_followups.replies.id`; string, optional) - `parent_id` (`getPost.response.200.discussion_graph.author_followups.replies.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.discussion_graph.author_followups.replies.author`; string, optional) - `score` (`getPost.response.200.discussion_graph.author_followups.replies.score`; integer, optional) - `body` (`getPost.response.200.discussion_graph.author_followups.replies.body`; string, optional) - `depth` (`getPost.response.200.discussion_graph.author_followups.replies.depth`; integer, optional) - `is_op` (`getPost.response.200.discussion_graph.author_followups.replies.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.discussion_graph.author_followups.replies.replies`; array, optional) - `most_upvoted` (`getPost.response.200.discussion_graph.most_upvoted`; array, optional) — Highest-score comments excluding OP, AutoModerator and deleted comments. - `id` (`getPost.response.200.discussion_graph.most_upvoted.id`; string, optional) - `parent_id` (`getPost.response.200.discussion_graph.most_upvoted.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.discussion_graph.most_upvoted.author`; string, optional) - `score` (`getPost.response.200.discussion_graph.most_upvoted.score`; integer, optional) - `body` (`getPost.response.200.discussion_graph.most_upvoted.body`; string, optional) - `depth` (`getPost.response.200.discussion_graph.most_upvoted.depth`; integer, optional) - `is_op` (`getPost.response.200.discussion_graph.most_upvoted.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.discussion_graph.most_upvoted.replies`; array, optional) - `id` (`getPost.response.200.discussion_graph.most_upvoted.replies.id`; string, optional) - `parent_id` (`getPost.response.200.discussion_graph.most_upvoted.replies.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.discussion_graph.most_upvoted.replies.author`; string, optional) - `score` (`getPost.response.200.discussion_graph.most_upvoted.replies.score`; integer, optional) - `body` (`getPost.response.200.discussion_graph.most_upvoted.replies.body`; string, optional) - `depth` (`getPost.response.200.discussion_graph.most_upvoted.replies.depth`; integer, optional) - `is_op` (`getPost.response.200.discussion_graph.most_upvoted.replies.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.discussion_graph.most_upvoted.replies.replies`; array, optional) - `controversial` (`getPost.response.200.discussion_graph.controversial`; array, optional) — Highly controversial comments with negative score or dissenting engagement, excluding OP. - `id` (`getPost.response.200.discussion_graph.controversial.id`; string, optional) - `parent_id` (`getPost.response.200.discussion_graph.controversial.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.discussion_graph.controversial.author`; string, optional) - `score` (`getPost.response.200.discussion_graph.controversial.score`; integer, optional) - `body` (`getPost.response.200.discussion_graph.controversial.body`; string, optional) - `depth` (`getPost.response.200.discussion_graph.controversial.depth`; integer, optional) - `is_op` (`getPost.response.200.discussion_graph.controversial.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.discussion_graph.controversial.replies`; array, optional) - `id` (`getPost.response.200.discussion_graph.controversial.replies.id`; string, optional) - `parent_id` (`getPost.response.200.discussion_graph.controversial.replies.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getPost.response.200.discussion_graph.controversial.replies.author`; string, optional) - `score` (`getPost.response.200.discussion_graph.controversial.replies.score`; integer, optional) - `body` (`getPost.response.200.discussion_graph.controversial.replies.body`; string, optional) - `depth` (`getPost.response.200.discussion_graph.controversial.replies.depth`; integer, optional) - `is_op` (`getPost.response.200.discussion_graph.controversial.replies.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getPost.response.200.discussion_graph.controversial.replies.replies`; array, optional) - `total_analyzed` (`getPost.response.200.discussion_graph.total_analyzed`; integer, optional) - `meta` (`getPost.response.200.meta`; object, optional) - `comments_returned` (`getPost.response.200.meta.comments_returned`; integer, optional) — Comments in the response. - `comments_total` (`getPost.response.200.meta.comments_total`; integer, optional) — Reddit's comment count, deleted and hidden comments included. - `has_more` (`getPost.response.200.meta.has_more`; boolean, optional) — A larger max_comments would return more. - `max_comments` (`getPost.response.200.meta.max_comments`; integer, optional) - `credits_used` (`getPost.response.200.meta.credits_used`; integer, optional) - `cache` (`getPost.response.200.meta.cache`; string, optional) - `cache_age_seconds` (`getPost.response.200.meta.cache_age_seconds`; integer, optional) — Seconds since the cached thread was stored, present for a stale response. - `limited_by_balance` (`getPost.response.200.meta.limited_by_balance`; boolean, optional) - `focus_comment_id` (`getPost.response.200.meta.focus_comment_id`; string, optional) — Comment ID when a comment permalink was requested. ##### Example ```json { "post": { "id": "string", "name": "string", "domain": "string", "is_self": true, "flair": "string", "spoiler": true, "is_pinned": true, "locked": true, "removed": true, "subreddit": "string", "title": "string", "author": "string", "score": 0, "upvote_ratio": 0, "comments_count": 0, "url": "string", "permalink": "string", "body": "string", "is_video": true, "is_nsfw": true, "media": [ { "type": "image", "url": "string", "width": 0, "height": 0, "caption": "string" } ], "poll": { "total_votes": 0, "is_closed": true, "options": [ { "id": "string", "text": "string", "vote_count": 0 } ] }, "crosspost_of": { "id": "string", "subreddit": "string", "title": "string", "author": "string", "permalink": "string" }, "comments": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ] }, "discussion_graph": { "post_id": "string", "title": "string", "author": "string", "author_followups": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ], "most_upvoted": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ], "controversial": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ], "total_analyzed": 0 }, "meta": { "comments_returned": 0, "comments_total": 0, "has_more": true, "max_comments": 0, "credits_used": 0, "cache": "string", "cache_age_seconds": 0, "limited_by_balance": true, "focus_comment_id": "string" } } ``` #### Body (text/markdown) ##### Example ```text string ``` ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getPost.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getPost.response.400.error.code`; string, required) - example `"not_found"` - `message` (`getPost.response.400.error.message`; string, required) - `retryable` (`getPost.response.400.error.retryable`; boolean, required) - `retry_after` (`getPost.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getPost.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getPost.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getPost.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getPost.response.401.error.message`; string, required) - `retryable` (`getPost.response.401.error.retryable`; boolean, required) - `retry_after` (`getPost.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getPost.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getPost.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getPost.response.402.error.code`; string, required) - example `"not_found"` - `message` (`getPost.response.402.error.message`; string, required) - `retryable` (`getPost.response.402.error.retryable`; boolean, required) - `retry_after` (`getPost.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getPost.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 403 Reddit does not show this content to logged-out readers, e.g. a private or quarantined subreddit (`reddit_refused`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getPost.response.403.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getPost.response.403.error.code`; string, required) - example `"not_found"` - `message` (`getPost.response.403.error.message`; string, required) - `retryable` (`getPost.response.403.error.retryable`; boolean, required) - `retry_after` (`getPost.response.403.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getPost.response.403.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getPost.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getPost.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getPost.response.404.error.message`; string, required) - `retryable` (`getPost.response.404.error.retryable`; boolean, required) - `retry_after` (`getPost.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getPost.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getPost.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getPost.response.429.error.code`; string, required) - example `"not_found"` - `message` (`getPost.response.429.error.message`; string, required) - `retryable` (`getPost.response.429.error.retryable`; boolean, required) - `retry_after` (`getPost.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getPost.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getPost.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getPost.response.503.error.code`; string, required) - example `"not_found"` - `message` (`getPost.response.503.error.message`; string, required) - `retryable` (`getPost.response.503.error.retryable`; boolean, required) - `retry_after` (`getPost.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getPost.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Get Subreddit Details > Retrieves subreddit metadata, community settings, subscriber stats, and moderation rules. Source: https://threadapi.dev/api/Reddit/getSubreddit/ · Markdown: https://threadapi.dev/api/Reddit/getSubreddit/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/subreddit` Retrieves subreddit metadata, community settings, subscriber stats, and moderation rules. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `sub` (`getSubreddit.query.sub`; string, required) — Subreddit name, with or without `r/`. ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/subreddit?sub=golang' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/subreddit?sub=golang'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/subreddit?sub=golang" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 Subreddit metadata and rules. #### Example ```json { "name": "string", "title": "string", "public_description": "string", "description": "string", "subscribers": 0, "is_nsfw": true, "type": "string", "url": "string", "icon": "string", "rules": [ { "kind": "string", "short_name": "string", "description": "string", "violation_reason": "string", "priority": 0 } ] } ``` - `name` (`getSubreddit.response.200.name`; string, optional) - `title` (`getSubreddit.response.200.title`; string, optional) - `public_description` (`getSubreddit.response.200.public_description`; string, optional) - `description` (`getSubreddit.response.200.description`; string, optional) - `subscribers` (`getSubreddit.response.200.subscribers`; integer, optional) - `is_nsfw` (`getSubreddit.response.200.is_nsfw`; boolean, optional) - `type` (`getSubreddit.response.200.type`; string, optional) - `url` (`getSubreddit.response.200.url`; string, optional) - `icon` (`getSubreddit.response.200.icon`; string, optional) - `rules` (`getSubreddit.response.200.rules`; array, optional) - `kind` (`getSubreddit.response.200.rules.kind`; string, optional) - `short_name` (`getSubreddit.response.200.rules.short_name`; string, optional) - `description` (`getSubreddit.response.200.rules.description`; string, optional) - `violation_reason` (`getSubreddit.response.200.rules.violation_reason`; string, optional) - `priority` (`getSubreddit.response.200.rules.priority`; integer, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubreddit.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubreddit.response.400.error.code`; string, required) - example `"not_found"` - `message` (`getSubreddit.response.400.error.message`; string, required) - `retryable` (`getSubreddit.response.400.error.retryable`; boolean, required) - `retry_after` (`getSubreddit.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubreddit.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubreddit.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubreddit.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getSubreddit.response.401.error.message`; string, required) - `retryable` (`getSubreddit.response.401.error.retryable`; boolean, required) - `retry_after` (`getSubreddit.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubreddit.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubreddit.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubreddit.response.402.error.code`; string, required) - example `"not_found"` - `message` (`getSubreddit.response.402.error.message`; string, required) - `retryable` (`getSubreddit.response.402.error.retryable`; boolean, required) - `retry_after` (`getSubreddit.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubreddit.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 403 Reddit does not show this content to logged-out readers, e.g. a private or quarantined subreddit (`reddit_refused`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubreddit.response.403.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubreddit.response.403.error.code`; string, required) - example `"not_found"` - `message` (`getSubreddit.response.403.error.message`; string, required) - `retryable` (`getSubreddit.response.403.error.retryable`; boolean, required) - `retry_after` (`getSubreddit.response.403.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubreddit.response.403.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubreddit.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubreddit.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getSubreddit.response.404.error.message`; string, required) - `retryable` (`getSubreddit.response.404.error.retryable`; boolean, required) - `retry_after` (`getSubreddit.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubreddit.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubreddit.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubreddit.response.429.error.code`; string, required) - example `"not_found"` - `message` (`getSubreddit.response.429.error.message`; string, required) - `retryable` (`getSubreddit.response.429.error.retryable`; boolean, required) - `retry_after` (`getSubreddit.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubreddit.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubreddit.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubreddit.response.503.error.code`; string, required) - example `"not_found"` - `message` (`getSubreddit.response.503.error.message`; string, required) - `retryable` (`getSubreddit.response.503.error.retryable`; boolean, required) - `retry_after` (`getSubreddit.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubreddit.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # List Subreddit Comments > Fetches recent comments posted across an entire subreddit in reverse chronological order. Source: https://threadapi.dev/api/Reddit/getSubredditComments/ · Markdown: https://threadapi.dev/api/Reddit/getSubredditComments/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/subreddit/comments` Fetches recent comments posted across an entire subreddit in reverse chronological order. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `sub` (`getSubredditComments.query.sub`; string, required) — Subreddit name (e.g. `golang` or `r/golang`). - `limit` (`getSubredditComments.query.limit`; integer, optional) — Number of items per page. - min 1; max 100; default `25` - `after` (`getSubredditComments.query.after`; string, optional) — Pagination cursor from the previous page's `after` field. - `nsfw` (`getSubredditComments.query.nsfw`; boolean, optional) — Include NSFW content (filtered out by default). - default `false` ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/subreddit/comments?sub=golang' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/subreddit/comments?sub=golang'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/subreddit/comments?sub=golang" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 Subreddit comments. #### Example ```json { "subreddit": "string", "query": "string", "sort": "string", "count": 0, "items": [ { "id": "string", "name": "string", "post_id": "string", "post_title": "string", "subreddit": "string", "author": "string", "score": 0, "body": "string", "permalink": "string", "is_op": true } ], "after": "string", "filtered_nsfw": 0 } ``` - `sort` (`getSubredditComments.response.200.sort`; string, required) - `count` (`getSubredditComments.response.200.count`; integer, required) - `items` (`getSubredditComments.response.200.items`; array, required) - `id` (`getSubredditComments.response.200.items.id`; string, optional) - `name` (`getSubredditComments.response.200.items.name`; string, optional) - `post_id` (`getSubredditComments.response.200.items.post_id`; string, optional) - `post_title` (`getSubredditComments.response.200.items.post_title`; string, optional) - `subreddit` (`getSubredditComments.response.200.items.subreddit`; string, optional) - `author` (`getSubredditComments.response.200.items.author`; string, optional) - `score` (`getSubredditComments.response.200.items.score`; integer, optional) - `body` (`getSubredditComments.response.200.items.body`; string, optional) - `permalink` (`getSubredditComments.response.200.items.permalink`; string, optional) - `is_op` (`getSubredditComments.response.200.items.is_op`; boolean, optional) - `filtered_nsfw` (`getSubredditComments.response.200.filtered_nsfw`; integer, required) - `subreddit` (`getSubredditComments.response.200.subreddit`; string | null, optional) - `query` (`getSubredditComments.response.200.query`; string | null, optional) - `after` (`getSubredditComments.response.200.after`; string | null, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubredditComments.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubredditComments.response.400.error.code`; string, required) - example `"not_found"` - `message` (`getSubredditComments.response.400.error.message`; string, required) - `retryable` (`getSubredditComments.response.400.error.retryable`; boolean, required) - `retry_after` (`getSubredditComments.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubredditComments.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubredditComments.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubredditComments.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getSubredditComments.response.401.error.message`; string, required) - `retryable` (`getSubredditComments.response.401.error.retryable`; boolean, required) - `retry_after` (`getSubredditComments.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubredditComments.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubredditComments.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubredditComments.response.402.error.code`; string, required) - example `"not_found"` - `message` (`getSubredditComments.response.402.error.message`; string, required) - `retryable` (`getSubredditComments.response.402.error.retryable`; boolean, required) - `retry_after` (`getSubredditComments.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubredditComments.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 403 Insufficient permissions or scope for this endpoint #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubredditComments.response.403.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubredditComments.response.403.error.code`; string, required) - example `"not_found"` - `message` (`getSubredditComments.response.403.error.message`; string, required) - `retryable` (`getSubredditComments.response.403.error.retryable`; boolean, required) - `retry_after` (`getSubredditComments.response.403.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubredditComments.response.403.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubredditComments.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubredditComments.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getSubredditComments.response.404.error.message`; string, required) - `retryable` (`getSubredditComments.response.404.error.retryable`; boolean, required) - `retry_after` (`getSubredditComments.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubredditComments.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubredditComments.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubredditComments.response.429.error.code`; string, required) - example `"not_found"` - `message` (`getSubredditComments.response.429.error.message`; string, required) - `retryable` (`getSubredditComments.response.429.error.retryable`; boolean, required) - `retry_after` (`getSubredditComments.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubredditComments.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getSubredditComments.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getSubredditComments.response.503.error.code`; string, required) - example `"not_found"` - `message` (`getSubredditComments.response.503.error.message`; string, required) - `retryable` (`getSubredditComments.response.503.error.retryable`; boolean, required) - `retry_after` (`getSubredditComments.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getSubredditComments.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Get User Profile > Retrieves a Reddit user's public profile, karma breakdown, creation timestamp, and account flags. Source: https://threadapi.dev/api/Reddit/getUser/ · Markdown: https://threadapi.dev/api/Reddit/getUser/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/user` Retrieves a Reddit user's public profile, karma breakdown, creation timestamp, and account flags. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `name` (`getUser.query.name`; string, required) — Reddit username (e.g. `spez`, with or without `u/`). ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/user?name=spez' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/user?name=spez'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/user?name=spez" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 User profile. #### Example ```json { "name": "string", "post_karma": 0, "comment_karma": 0, "karma": 0, "is_employee": true, "icon": "string", "suspended": true } ``` - `name` (`getUser.response.200.name`; string, optional) - `post_karma` (`getUser.response.200.post_karma`; integer, optional) - `comment_karma` (`getUser.response.200.comment_karma`; integer, optional) - `karma` (`getUser.response.200.karma`; integer, optional) - `is_employee` (`getUser.response.200.is_employee`; boolean, optional) - `icon` (`getUser.response.200.icon`; string, optional) - `suspended` (`getUser.response.200.suspended`; boolean, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUser.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUser.response.400.error.code`; string, required) - example `"not_found"` - `message` (`getUser.response.400.error.message`; string, required) - `retryable` (`getUser.response.400.error.retryable`; boolean, required) - `retry_after` (`getUser.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUser.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUser.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUser.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getUser.response.401.error.message`; string, required) - `retryable` (`getUser.response.401.error.retryable`; boolean, required) - `retry_after` (`getUser.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUser.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUser.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUser.response.402.error.code`; string, required) - example `"not_found"` - `message` (`getUser.response.402.error.message`; string, required) - `retryable` (`getUser.response.402.error.retryable`; boolean, required) - `retry_after` (`getUser.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUser.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUser.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUser.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getUser.response.404.error.message`; string, required) - `retryable` (`getUser.response.404.error.retryable`; boolean, required) - `retry_after` (`getUser.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUser.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUser.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUser.response.429.error.code`; string, required) - example `"not_found"` - `message` (`getUser.response.429.error.message`; string, required) - `retryable` (`getUser.response.429.error.retryable`; boolean, required) - `retry_after` (`getUser.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUser.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUser.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUser.response.503.error.code`; string, required) - example `"not_found"` - `message` (`getUser.response.503.error.message`; string, required) - `retryable` (`getUser.response.503.error.retryable`; boolean, required) - `retry_after` (`getUser.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUser.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # List User Comments > Lists comments posted by a specific Reddit user across all communities. Source: https://threadapi.dev/api/Reddit/getUserComments/ · Markdown: https://threadapi.dev/api/Reddit/getUserComments/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/user/comments` Lists comments posted by a specific Reddit user across all communities. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `name` (`getUserComments.query.name`; string, required) — Reddit username. - `sort` (`getUserComments.query.sort`; string, optional) - one of `"new"`, `"hot"`, `"top"`; default `"new"` - `t` (`getUserComments.query.t`; string, optional) — Time window when sorting by `top` or `controversial`. - one of `"hour"`, `"day"`, `"week"`, `"month"`, `"year"`, `"all"` - `limit` (`getUserComments.query.limit`; integer, optional) — Number of items per page. - min 1; max 100; default `25` - `after` (`getUserComments.query.after`; string, optional) — Pagination cursor from the previous page's `after` field. - `nsfw` (`getUserComments.query.nsfw`; boolean, optional) — Include NSFW content (filtered out by default). - default `false` ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/user/comments?name=spez' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/user/comments?name=spez'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/user/comments?name=spez" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 Submitted comments. #### Example ```json { "subreddit": "string", "query": "string", "sort": "string", "count": 0, "items": [ { "id": "string", "name": "string", "post_id": "string", "post_title": "string", "subreddit": "string", "author": "string", "score": 0, "body": "string", "permalink": "string", "is_op": true } ], "after": "string", "filtered_nsfw": 0 } ``` - `sort` (`getUserComments.response.200.sort`; string, required) - `count` (`getUserComments.response.200.count`; integer, required) - `items` (`getUserComments.response.200.items`; array, required) - `id` (`getUserComments.response.200.items.id`; string, optional) - `name` (`getUserComments.response.200.items.name`; string, optional) - `post_id` (`getUserComments.response.200.items.post_id`; string, optional) - `post_title` (`getUserComments.response.200.items.post_title`; string, optional) - `subreddit` (`getUserComments.response.200.items.subreddit`; string, optional) - `author` (`getUserComments.response.200.items.author`; string, optional) - `score` (`getUserComments.response.200.items.score`; integer, optional) - `body` (`getUserComments.response.200.items.body`; string, optional) - `permalink` (`getUserComments.response.200.items.permalink`; string, optional) - `is_op` (`getUserComments.response.200.items.is_op`; boolean, optional) - `filtered_nsfw` (`getUserComments.response.200.filtered_nsfw`; integer, required) - `subreddit` (`getUserComments.response.200.subreddit`; string | null, optional) - `query` (`getUserComments.response.200.query`; string | null, optional) - `after` (`getUserComments.response.200.after`; string | null, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserComments.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserComments.response.400.error.code`; string, required) - example `"not_found"` - `message` (`getUserComments.response.400.error.message`; string, required) - `retryable` (`getUserComments.response.400.error.retryable`; boolean, required) - `retry_after` (`getUserComments.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserComments.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserComments.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserComments.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getUserComments.response.401.error.message`; string, required) - `retryable` (`getUserComments.response.401.error.retryable`; boolean, required) - `retry_after` (`getUserComments.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserComments.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserComments.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserComments.response.402.error.code`; string, required) - example `"not_found"` - `message` (`getUserComments.response.402.error.message`; string, required) - `retryable` (`getUserComments.response.402.error.retryable`; boolean, required) - `retry_after` (`getUserComments.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserComments.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserComments.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserComments.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getUserComments.response.404.error.message`; string, required) - `retryable` (`getUserComments.response.404.error.retryable`; boolean, required) - `retry_after` (`getUserComments.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserComments.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserComments.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserComments.response.429.error.code`; string, required) - example `"not_found"` - `message` (`getUserComments.response.429.error.message`; string, required) - `retryable` (`getUserComments.response.429.error.retryable`; boolean, required) - `retry_after` (`getUserComments.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserComments.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserComments.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserComments.response.503.error.code`; string, required) - example `"not_found"` - `message` (`getUserComments.response.503.error.message`; string, required) - `retryable` (`getUserComments.response.503.error.retryable`; boolean, required) - `retry_after` (`getUserComments.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserComments.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # List User Posts > Lists submissions posted by a specific Reddit user across all communities. Source: https://threadapi.dev/api/Reddit/getUserPosts/ · Markdown: https://threadapi.dev/api/Reddit/getUserPosts/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/user/posts` Lists submissions posted by a specific Reddit user across all communities. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `name` (`getUserPosts.query.name`; string, required) — Reddit username. - `sort` (`getUserPosts.query.sort`; string, optional) - one of `"new"`, `"hot"`, `"top"`; default `"new"` - `t` (`getUserPosts.query.t`; string, optional) — Time window when sorting by `top` or `controversial`. - one of `"hour"`, `"day"`, `"week"`, `"month"`, `"year"`, `"all"` - `limit` (`getUserPosts.query.limit`; integer, optional) — Number of items per page. - min 1; max 100; default `25` - `after` (`getUserPosts.query.after`; string, optional) — Pagination cursor from the previous page's `after` field. - `nsfw` (`getUserPosts.query.nsfw`; boolean, optional) — Include NSFW content (filtered out by default). - default `false` ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/user/posts?name=spez' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/user/posts?name=spez'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/user/posts?name=spez" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 Submitted posts. #### Example ```json { "subreddit": "string", "query": "string", "sort": "string", "count": 0, "items": [ { "id": "string", "name": "string", "domain": "string", "is_self": true, "flair": "string", "spoiler": true, "is_pinned": true, "locked": true, "removed": true, "subreddit": "string", "title": "string", "author": "string", "score": 0, "upvote_ratio": 0, "comments_count": 0, "url": "string", "permalink": "string", "body": "string", "is_video": true, "is_nsfw": true, "media": [ { "type": "image", "url": "string", "width": 0, "height": 0, "caption": "string" } ], "poll": { "total_votes": 0, "is_closed": true, "options": [ { "id": "string", "text": "string", "vote_count": 0 } ] }, "crosspost_of": { "id": "string", "subreddit": "string", "title": "string", "author": "string", "permalink": "string" }, "comments": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ] } ], "after": "string", "filtered_nsfw": 0 } ``` - `sort` (`getUserPosts.response.200.sort`; string, required) - `count` (`getUserPosts.response.200.count`; integer, required) - `items` (`getUserPosts.response.200.items`; array, required) - `id` (`getUserPosts.response.200.items.id`; string, optional) - `name` (`getUserPosts.response.200.items.name`; string, optional) - `domain` (`getUserPosts.response.200.items.domain`; string, optional) - `is_self` (`getUserPosts.response.200.items.is_self`; boolean, optional) - `flair` (`getUserPosts.response.200.items.flair`; string, optional) - `spoiler` (`getUserPosts.response.200.items.spoiler`; boolean, optional) - `is_pinned` (`getUserPosts.response.200.items.is_pinned`; boolean, optional) - `locked` (`getUserPosts.response.200.items.locked`; boolean, optional) - `removed` (`getUserPosts.response.200.items.removed`; boolean, optional) - `subreddit` (`getUserPosts.response.200.items.subreddit`; string, optional) - `title` (`getUserPosts.response.200.items.title`; string, optional) - `author` (`getUserPosts.response.200.items.author`; string, optional) - `score` (`getUserPosts.response.200.items.score`; integer, optional) - `upvote_ratio` (`getUserPosts.response.200.items.upvote_ratio`; number, optional) - `comments_count` (`getUserPosts.response.200.items.comments_count`; integer, optional) - `url` (`getUserPosts.response.200.items.url`; string, optional) - `permalink` (`getUserPosts.response.200.items.permalink`; string, optional) - `body` (`getUserPosts.response.200.items.body`; string, optional) - `is_video` (`getUserPosts.response.200.items.is_video`; boolean, optional) - `is_nsfw` (`getUserPosts.response.200.items.is_nsfw`; boolean, optional) - `media` (`getUserPosts.response.200.items.media`; array, optional) - `type` (`getUserPosts.response.200.items.media.type`; string, optional) - one of `"image"`, `"video"`, `"gallery"` - `url` (`getUserPosts.response.200.items.media.url`; string, optional) - `width` (`getUserPosts.response.200.items.media.width`; integer, optional) - `height` (`getUserPosts.response.200.items.media.height`; integer, optional) - `caption` (`getUserPosts.response.200.items.media.caption`; string, optional) - `poll` (`getUserPosts.response.200.items.poll`; object, optional) - `total_votes` (`getUserPosts.response.200.items.poll.total_votes`; integer, optional) - `is_closed` (`getUserPosts.response.200.items.poll.is_closed`; boolean, optional) - `options` (`getUserPosts.response.200.items.poll.options`; array, optional) - `id` (`getUserPosts.response.200.items.poll.options.id`; string, optional) - `text` (`getUserPosts.response.200.items.poll.options.text`; string, optional) - `vote_count` (`getUserPosts.response.200.items.poll.options.vote_count`; integer, optional) - `crosspost_of` (`getUserPosts.response.200.items.crosspost_of`; object, optional) - `id` (`getUserPosts.response.200.items.crosspost_of.id`; string, optional) - `subreddit` (`getUserPosts.response.200.items.crosspost_of.subreddit`; string, optional) - `title` (`getUserPosts.response.200.items.crosspost_of.title`; string, optional) - `author` (`getUserPosts.response.200.items.crosspost_of.author`; string, optional) - `permalink` (`getUserPosts.response.200.items.crosspost_of.permalink`; string, optional) - `comments` (`getUserPosts.response.200.items.comments`; array, optional) - `id` (`getUserPosts.response.200.items.comments.id`; string, optional) - `parent_id` (`getUserPosts.response.200.items.comments.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getUserPosts.response.200.items.comments.author`; string, optional) - `score` (`getUserPosts.response.200.items.comments.score`; integer, optional) - `body` (`getUserPosts.response.200.items.comments.body`; string, optional) - `depth` (`getUserPosts.response.200.items.comments.depth`; integer, optional) - `is_op` (`getUserPosts.response.200.items.comments.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getUserPosts.response.200.items.comments.replies`; array, optional) - `id` (`getUserPosts.response.200.items.comments.replies.id`; string, optional) - `parent_id` (`getUserPosts.response.200.items.comments.replies.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`getUserPosts.response.200.items.comments.replies.author`; string, optional) - `score` (`getUserPosts.response.200.items.comments.replies.score`; integer, optional) - `body` (`getUserPosts.response.200.items.comments.replies.body`; string, optional) - `depth` (`getUserPosts.response.200.items.comments.replies.depth`; integer, optional) - `is_op` (`getUserPosts.response.200.items.comments.replies.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`getUserPosts.response.200.items.comments.replies.replies`; array, optional) - `filtered_nsfw` (`getUserPosts.response.200.filtered_nsfw`; integer, required) - `subreddit` (`getUserPosts.response.200.subreddit`; string | null, optional) - `query` (`getUserPosts.response.200.query`; string | null, optional) - `after` (`getUserPosts.response.200.after`; string | null, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserPosts.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserPosts.response.400.error.code`; string, required) - example `"not_found"` - `message` (`getUserPosts.response.400.error.message`; string, required) - `retryable` (`getUserPosts.response.400.error.retryable`; boolean, required) - `retry_after` (`getUserPosts.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserPosts.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserPosts.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserPosts.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getUserPosts.response.401.error.message`; string, required) - `retryable` (`getUserPosts.response.401.error.retryable`; boolean, required) - `retry_after` (`getUserPosts.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserPosts.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserPosts.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserPosts.response.402.error.code`; string, required) - example `"not_found"` - `message` (`getUserPosts.response.402.error.message`; string, required) - `retryable` (`getUserPosts.response.402.error.retryable`; boolean, required) - `retry_after` (`getUserPosts.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserPosts.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserPosts.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserPosts.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getUserPosts.response.404.error.message`; string, required) - `retryable` (`getUserPosts.response.404.error.retryable`; boolean, required) - `retry_after` (`getUserPosts.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserPosts.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserPosts.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserPosts.response.429.error.code`; string, required) - example `"not_found"` - `message` (`getUserPosts.response.429.error.message`; string, required) - `retryable` (`getUserPosts.response.429.error.retryable`; boolean, required) - `retry_after` (`getUserPosts.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserPosts.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserPosts.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserPosts.response.503.error.code`; string, required) - example `"not_found"` - `message` (`getUserPosts.response.503.error.message`; string, required) - `retryable` (`getUserPosts.response.503.error.retryable`; boolean, required) - `retry_after` (`getUserPosts.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserPosts.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # List Subreddit Posts > Lists posts from a subreddit sorted by community filters (`hot`, `new`, `top`, `rising`). Returns up to 100 posts per page. Source: https://threadapi.dev/api/Reddit/listSubredditPosts/ · Markdown: https://threadapi.dev/api/Reddit/listSubredditPosts/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/subreddit/posts` Lists posts from a subreddit sorted by community filters (`hot`, `new`, `top`, `rising`). Returns up to 100 posts per page. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `sub` (`listSubredditPosts.query.sub`; string, required) — Subreddit name, with or without `r/`. - `sort` (`listSubredditPosts.query.sort`; string, optional) - one of `"hot"`, `"new"`, `"top"`, `"rising"`; default `"hot"` - `t` (`listSubredditPosts.query.t`; string, optional) — Time window when sorting by `top` or `controversial`. - one of `"hour"`, `"day"`, `"week"`, `"month"`, `"year"`, `"all"` - `limit` (`listSubredditPosts.query.limit`; integer, optional) — Number of items per page. - min 1; max 100; default `25` - `after` (`listSubredditPosts.query.after`; string, optional) — Pagination cursor from the previous page's `after` field. - `nsfw` (`listSubredditPosts.query.nsfw`; boolean, optional) — Include NSFW content (filtered out by default). - default `false` ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/subreddit/posts?sub=golang' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/subreddit/posts?sub=golang'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/subreddit/posts?sub=golang" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 The posts. #### Example ```json { "subreddit": "string", "query": "string", "sort": "string", "count": 0, "items": [ { "id": "string", "name": "string", "domain": "string", "is_self": true, "flair": "string", "spoiler": true, "is_pinned": true, "locked": true, "removed": true, "subreddit": "string", "title": "string", "author": "string", "score": 0, "upvote_ratio": 0, "comments_count": 0, "url": "string", "permalink": "string", "body": "string", "is_video": true, "is_nsfw": true, "media": [ { "type": "image", "url": "string", "width": 0, "height": 0, "caption": "string" } ], "poll": { "total_votes": 0, "is_closed": true, "options": [ { "id": "string", "text": "string", "vote_count": 0 } ] }, "crosspost_of": { "id": "string", "subreddit": "string", "title": "string", "author": "string", "permalink": "string" }, "comments": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ] } ], "after": "string", "filtered_nsfw": 0 } ``` - `sort` (`listSubredditPosts.response.200.sort`; string, required) - `count` (`listSubredditPosts.response.200.count`; integer, required) - `items` (`listSubredditPosts.response.200.items`; array, required) - `id` (`listSubredditPosts.response.200.items.id`; string, optional) - `name` (`listSubredditPosts.response.200.items.name`; string, optional) - `domain` (`listSubredditPosts.response.200.items.domain`; string, optional) - `is_self` (`listSubredditPosts.response.200.items.is_self`; boolean, optional) - `flair` (`listSubredditPosts.response.200.items.flair`; string, optional) - `spoiler` (`listSubredditPosts.response.200.items.spoiler`; boolean, optional) - `is_pinned` (`listSubredditPosts.response.200.items.is_pinned`; boolean, optional) - `locked` (`listSubredditPosts.response.200.items.locked`; boolean, optional) - `removed` (`listSubredditPosts.response.200.items.removed`; boolean, optional) - `subreddit` (`listSubredditPosts.response.200.items.subreddit`; string, optional) - `title` (`listSubredditPosts.response.200.items.title`; string, optional) - `author` (`listSubredditPosts.response.200.items.author`; string, optional) - `score` (`listSubredditPosts.response.200.items.score`; integer, optional) - `upvote_ratio` (`listSubredditPosts.response.200.items.upvote_ratio`; number, optional) - `comments_count` (`listSubredditPosts.response.200.items.comments_count`; integer, optional) - `url` (`listSubredditPosts.response.200.items.url`; string, optional) - `permalink` (`listSubredditPosts.response.200.items.permalink`; string, optional) - `body` (`listSubredditPosts.response.200.items.body`; string, optional) - `is_video` (`listSubredditPosts.response.200.items.is_video`; boolean, optional) - `is_nsfw` (`listSubredditPosts.response.200.items.is_nsfw`; boolean, optional) - `media` (`listSubredditPosts.response.200.items.media`; array, optional) - `type` (`listSubredditPosts.response.200.items.media.type`; string, optional) - one of `"image"`, `"video"`, `"gallery"` - `url` (`listSubredditPosts.response.200.items.media.url`; string, optional) - `width` (`listSubredditPosts.response.200.items.media.width`; integer, optional) - `height` (`listSubredditPosts.response.200.items.media.height`; integer, optional) - `caption` (`listSubredditPosts.response.200.items.media.caption`; string, optional) - `poll` (`listSubredditPosts.response.200.items.poll`; object, optional) - `total_votes` (`listSubredditPosts.response.200.items.poll.total_votes`; integer, optional) - `is_closed` (`listSubredditPosts.response.200.items.poll.is_closed`; boolean, optional) - `options` (`listSubredditPosts.response.200.items.poll.options`; array, optional) - `id` (`listSubredditPosts.response.200.items.poll.options.id`; string, optional) - `text` (`listSubredditPosts.response.200.items.poll.options.text`; string, optional) - `vote_count` (`listSubredditPosts.response.200.items.poll.options.vote_count`; integer, optional) - `crosspost_of` (`listSubredditPosts.response.200.items.crosspost_of`; object, optional) - `id` (`listSubredditPosts.response.200.items.crosspost_of.id`; string, optional) - `subreddit` (`listSubredditPosts.response.200.items.crosspost_of.subreddit`; string, optional) - `title` (`listSubredditPosts.response.200.items.crosspost_of.title`; string, optional) - `author` (`listSubredditPosts.response.200.items.crosspost_of.author`; string, optional) - `permalink` (`listSubredditPosts.response.200.items.crosspost_of.permalink`; string, optional) - `comments` (`listSubredditPosts.response.200.items.comments`; array, optional) - `id` (`listSubredditPosts.response.200.items.comments.id`; string, optional) - `parent_id` (`listSubredditPosts.response.200.items.comments.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`listSubredditPosts.response.200.items.comments.author`; string, optional) - `score` (`listSubredditPosts.response.200.items.comments.score`; integer, optional) - `body` (`listSubredditPosts.response.200.items.comments.body`; string, optional) - `depth` (`listSubredditPosts.response.200.items.comments.depth`; integer, optional) - `is_op` (`listSubredditPosts.response.200.items.comments.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`listSubredditPosts.response.200.items.comments.replies`; array, optional) - `id` (`listSubredditPosts.response.200.items.comments.replies.id`; string, optional) - `parent_id` (`listSubredditPosts.response.200.items.comments.replies.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`listSubredditPosts.response.200.items.comments.replies.author`; string, optional) - `score` (`listSubredditPosts.response.200.items.comments.replies.score`; integer, optional) - `body` (`listSubredditPosts.response.200.items.comments.replies.body`; string, optional) - `depth` (`listSubredditPosts.response.200.items.comments.replies.depth`; integer, optional) - `is_op` (`listSubredditPosts.response.200.items.comments.replies.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`listSubredditPosts.response.200.items.comments.replies.replies`; array, optional) - `filtered_nsfw` (`listSubredditPosts.response.200.filtered_nsfw`; integer, required) - `subreddit` (`listSubredditPosts.response.200.subreddit`; string | null, optional) - `query` (`listSubredditPosts.response.200.query`; string | null, optional) - `after` (`listSubredditPosts.response.200.after`; string | null, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listSubredditPosts.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listSubredditPosts.response.400.error.code`; string, required) - example `"not_found"` - `message` (`listSubredditPosts.response.400.error.message`; string, required) - `retryable` (`listSubredditPosts.response.400.error.retryable`; boolean, required) - `retry_after` (`listSubredditPosts.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listSubredditPosts.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listSubredditPosts.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listSubredditPosts.response.401.error.code`; string, required) - example `"not_found"` - `message` (`listSubredditPosts.response.401.error.message`; string, required) - `retryable` (`listSubredditPosts.response.401.error.retryable`; boolean, required) - `retry_after` (`listSubredditPosts.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listSubredditPosts.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listSubredditPosts.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listSubredditPosts.response.402.error.code`; string, required) - example `"not_found"` - `message` (`listSubredditPosts.response.402.error.message`; string, required) - `retryable` (`listSubredditPosts.response.402.error.retryable`; boolean, required) - `retry_after` (`listSubredditPosts.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listSubredditPosts.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 403 Reddit does not show this content to logged-out readers, e.g. a private or quarantined subreddit (`reddit_refused`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listSubredditPosts.response.403.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listSubredditPosts.response.403.error.code`; string, required) - example `"not_found"` - `message` (`listSubredditPosts.response.403.error.message`; string, required) - `retryable` (`listSubredditPosts.response.403.error.retryable`; boolean, required) - `retry_after` (`listSubredditPosts.response.403.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listSubredditPosts.response.403.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listSubredditPosts.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listSubredditPosts.response.404.error.code`; string, required) - example `"not_found"` - `message` (`listSubredditPosts.response.404.error.message`; string, required) - `retryable` (`listSubredditPosts.response.404.error.retryable`; boolean, required) - `retry_after` (`listSubredditPosts.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listSubredditPosts.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listSubredditPosts.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listSubredditPosts.response.429.error.code`; string, required) - example `"not_found"` - `message` (`listSubredditPosts.response.429.error.message`; string, required) - `retryable` (`listSubredditPosts.response.429.error.retryable`; boolean, required) - `retry_after` (`listSubredditPosts.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listSubredditPosts.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`listSubredditPosts.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`listSubredditPosts.response.503.error.code`; string, required) - example `"not_found"` - `message` (`listSubredditPosts.response.503.error.message`; string, required) - `retryable` (`listSubredditPosts.response.503.error.retryable`; boolean, required) - `retry_after` (`listSubredditPosts.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`listSubredditPosts.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Batch Look Up Posts by ID (POST) > Batch look up up to 100 Reddit posts by fullname (`t3_`), bare ID, or URL via JSON request body or query parameter. Any missing IDs are recorded under `missing`. Source: https://threadapi.dev/api/Reddit/postPostsBatch/ · Markdown: https://threadapi.dev/api/Reddit/postPostsBatch/index.md Path: ThreadAPI API › Reddit `POST /v1/reddit/posts/batch` Batch look up up to 100 Reddit posts by fullname (`t3_`), bare ID, or URL via JSON request body or query parameter. Any missing IDs are recorded under `missing`. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Request body Post IDs as a JSON array or comma-separated string. - `ids` (`postPostsBatch.ids`; array, optional) - example `["t3_1x1ai6v","t3_1xagllz"]` ## Example request ```json { "ids": [ "t3_1x1ai6v", "t3_1xagllz" ] } ``` ## Code samples ### cURL ```bash curl --request POST \ --url https://api.threadapi.dev/v1/reddit/posts/batch \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "ids": [ "t3_1x1ai6v", "t3_1xagllz" ] } ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/posts/batch'; const options = { method: 'POST', headers: {'Content-Type': 'application/json', Authorization: 'Bearer '}, body: JSON.stringify({ids: ['t3_1x1ai6v', 't3_1xagllz']}) }; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/posts/batch" payload = { "ids": ["t3_1x1ai6v", "t3_1xagllz"] } headers = { "Content-Type": "application/json", "Authorization": "Bearer " } response = requests.post(url, json=payload, headers=headers) print(response.text) ``` ## Responses ### 200 The requested posts. #### Example ```json { "items": [ { "id": "string", "name": "string", "domain": "string", "is_self": true, "flair": "string", "spoiler": true, "is_pinned": true, "locked": true, "removed": true, "subreddit": "string", "title": "string", "author": "string", "score": 0, "upvote_ratio": 0, "comments_count": 0, "url": "string", "permalink": "string", "body": "string", "is_video": true, "is_nsfw": true, "media": [ { "type": "image", "url": "string", "width": 0, "height": 0, "caption": "string" } ], "poll": { "total_votes": 0, "is_closed": true, "options": [ { "id": "string", "text": "string", "vote_count": 0 } ] }, "crosspost_of": { "id": "string", "subreddit": "string", "title": "string", "author": "string", "permalink": "string" }, "comments": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ] } ], "missing": [ "string" ] } ``` - `items` (`postPostsBatch.response.200.items`; array, required) - `id` (`postPostsBatch.response.200.items.id`; string, optional) - `name` (`postPostsBatch.response.200.items.name`; string, optional) - `domain` (`postPostsBatch.response.200.items.domain`; string, optional) - `is_self` (`postPostsBatch.response.200.items.is_self`; boolean, optional) - `flair` (`postPostsBatch.response.200.items.flair`; string, optional) - `spoiler` (`postPostsBatch.response.200.items.spoiler`; boolean, optional) - `is_pinned` (`postPostsBatch.response.200.items.is_pinned`; boolean, optional) - `locked` (`postPostsBatch.response.200.items.locked`; boolean, optional) - `removed` (`postPostsBatch.response.200.items.removed`; boolean, optional) - `subreddit` (`postPostsBatch.response.200.items.subreddit`; string, optional) - `title` (`postPostsBatch.response.200.items.title`; string, optional) - `author` (`postPostsBatch.response.200.items.author`; string, optional) - `score` (`postPostsBatch.response.200.items.score`; integer, optional) - `upvote_ratio` (`postPostsBatch.response.200.items.upvote_ratio`; number, optional) - `comments_count` (`postPostsBatch.response.200.items.comments_count`; integer, optional) - `url` (`postPostsBatch.response.200.items.url`; string, optional) - `permalink` (`postPostsBatch.response.200.items.permalink`; string, optional) - `body` (`postPostsBatch.response.200.items.body`; string, optional) - `is_video` (`postPostsBatch.response.200.items.is_video`; boolean, optional) - `is_nsfw` (`postPostsBatch.response.200.items.is_nsfw`; boolean, optional) - `media` (`postPostsBatch.response.200.items.media`; array, optional) - `type` (`postPostsBatch.response.200.items.media.type`; string, optional) - one of `"image"`, `"video"`, `"gallery"` - `url` (`postPostsBatch.response.200.items.media.url`; string, optional) - `width` (`postPostsBatch.response.200.items.media.width`; integer, optional) - `height` (`postPostsBatch.response.200.items.media.height`; integer, optional) - `caption` (`postPostsBatch.response.200.items.media.caption`; string, optional) - `poll` (`postPostsBatch.response.200.items.poll`; object, optional) - `total_votes` (`postPostsBatch.response.200.items.poll.total_votes`; integer, optional) - `is_closed` (`postPostsBatch.response.200.items.poll.is_closed`; boolean, optional) - `options` (`postPostsBatch.response.200.items.poll.options`; array, optional) - `id` (`postPostsBatch.response.200.items.poll.options.id`; string, optional) - `text` (`postPostsBatch.response.200.items.poll.options.text`; string, optional) - `vote_count` (`postPostsBatch.response.200.items.poll.options.vote_count`; integer, optional) - `crosspost_of` (`postPostsBatch.response.200.items.crosspost_of`; object, optional) - `id` (`postPostsBatch.response.200.items.crosspost_of.id`; string, optional) - `subreddit` (`postPostsBatch.response.200.items.crosspost_of.subreddit`; string, optional) - `title` (`postPostsBatch.response.200.items.crosspost_of.title`; string, optional) - `author` (`postPostsBatch.response.200.items.crosspost_of.author`; string, optional) - `permalink` (`postPostsBatch.response.200.items.crosspost_of.permalink`; string, optional) - `comments` (`postPostsBatch.response.200.items.comments`; array, optional) - `id` (`postPostsBatch.response.200.items.comments.id`; string, optional) - `parent_id` (`postPostsBatch.response.200.items.comments.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`postPostsBatch.response.200.items.comments.author`; string, optional) - `score` (`postPostsBatch.response.200.items.comments.score`; integer, optional) - `body` (`postPostsBatch.response.200.items.comments.body`; string, optional) - `depth` (`postPostsBatch.response.200.items.comments.depth`; integer, optional) - `is_op` (`postPostsBatch.response.200.items.comments.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`postPostsBatch.response.200.items.comments.replies`; array, optional) - `id` (`postPostsBatch.response.200.items.comments.replies.id`; string, optional) - `parent_id` (`postPostsBatch.response.200.items.comments.replies.parent_id`; string, optional) — t3_ for a top-level comment, t1_ for a reply. - `author` (`postPostsBatch.response.200.items.comments.replies.author`; string, optional) - `score` (`postPostsBatch.response.200.items.comments.replies.score`; integer, optional) - `body` (`postPostsBatch.response.200.items.comments.replies.body`; string, optional) - `depth` (`postPostsBatch.response.200.items.comments.replies.depth`; integer, optional) - `is_op` (`postPostsBatch.response.200.items.comments.replies.is_op`; boolean, optional) — Written by the original poster (OP). - `replies` (`postPostsBatch.response.200.items.comments.replies.replies`; array, optional) - `missing` (`postPostsBatch.response.200.missing`; array, required) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`postPostsBatch.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`postPostsBatch.response.400.error.code`; string, required) - example `"not_found"` - `message` (`postPostsBatch.response.400.error.message`; string, required) - `retryable` (`postPostsBatch.response.400.error.retryable`; boolean, required) - `retry_after` (`postPostsBatch.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`postPostsBatch.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`postPostsBatch.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`postPostsBatch.response.401.error.code`; string, required) - example `"not_found"` - `message` (`postPostsBatch.response.401.error.message`; string, required) - `retryable` (`postPostsBatch.response.401.error.retryable`; boolean, required) - `retry_after` (`postPostsBatch.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`postPostsBatch.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`postPostsBatch.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`postPostsBatch.response.402.error.code`; string, required) - example `"not_found"` - `message` (`postPostsBatch.response.402.error.message`; string, required) - `retryable` (`postPostsBatch.response.402.error.retryable`; boolean, required) - `retry_after` (`postPostsBatch.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`postPostsBatch.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`postPostsBatch.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`postPostsBatch.response.429.error.code`; string, required) - example `"not_found"` - `message` (`postPostsBatch.response.429.error.message`; string, required) - `retryable` (`postPostsBatch.response.429.error.retryable`; boolean, required) - `retry_after` (`postPostsBatch.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`postPostsBatch.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`postPostsBatch.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`postPostsBatch.response.503.error.code`; string, required) - example `"not_found"` - `message` (`postPostsBatch.response.503.error.message`; string, required) - `retryable` (`postPostsBatch.response.503.error.retryable`; boolean, required) - `retry_after` (`postPostsBatch.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`postPostsBatch.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Search Reddit Comments > Searches Reddit comments globally or scoped to a specific subreddit with pagination support. Source: https://threadapi.dev/api/Reddit/searchComments/ · Markdown: https://threadapi.dev/api/Reddit/searchComments/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/search/comments` Searches Reddit comments globally or scoped to a specific subreddit with pagination support. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `q` (`searchComments.query.q`; string, required) — Search query, 1 to 500 characters. - maxLength 500 - `sub` (`searchComments.query.sub`; string, optional) — Only search this subreddit. - `sort` (`searchComments.query.sort`; string, optional) - one of `"relevance"`, `"new"`, `"top"`; default `"relevance"` - `t` (`searchComments.query.t`; string, optional) — Time window when sorting by `top` or `controversial`. - one of `"hour"`, `"day"`, `"week"`, `"month"`, `"year"`, `"all"` - `after` (`searchComments.query.after`; string, optional) — Pagination cursor from the previous page's `after` field. - `nsfw` (`searchComments.query.nsfw`; boolean, optional) — Include NSFW content (filtered out by default). - default `false` ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/search/comments?q=postgres%20replica%20lag' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/search/comments?q=postgres%20replica%20lag'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/search/comments?q=postgres%20replica%20lag" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 The comments. #### Example ```json { "subreddit": "string", "query": "string", "sort": "string", "count": 0, "items": [ { "id": "string", "name": "string", "post_id": "string", "post_title": "string", "subreddit": "string", "author": "string", "score": 0, "body": "string", "permalink": "string", "is_op": true } ], "after": "string", "filtered_nsfw": 0 } ``` - `sort` (`searchComments.response.200.sort`; string, required) - `count` (`searchComments.response.200.count`; integer, required) - `items` (`searchComments.response.200.items`; array, required) - `id` (`searchComments.response.200.items.id`; string, optional) - `name` (`searchComments.response.200.items.name`; string, optional) - `post_id` (`searchComments.response.200.items.post_id`; string, optional) - `post_title` (`searchComments.response.200.items.post_title`; string, optional) - `subreddit` (`searchComments.response.200.items.subreddit`; string, optional) - `author` (`searchComments.response.200.items.author`; string, optional) - `score` (`searchComments.response.200.items.score`; integer, optional) - `body` (`searchComments.response.200.items.body`; string, optional) - `permalink` (`searchComments.response.200.items.permalink`; string, optional) - `is_op` (`searchComments.response.200.items.is_op`; boolean, optional) - `filtered_nsfw` (`searchComments.response.200.filtered_nsfw`; integer, required) - `subreddit` (`searchComments.response.200.subreddit`; string | null, optional) - `query` (`searchComments.response.200.query`; string | null, optional) - `after` (`searchComments.response.200.after`; string | null, optional) ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchComments.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchComments.response.400.error.code`; string, required) - example `"not_found"` - `message` (`searchComments.response.400.error.message`; string, required) - `retryable` (`searchComments.response.400.error.retryable`; boolean, required) - `retry_after` (`searchComments.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchComments.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchComments.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchComments.response.401.error.code`; string, required) - example `"not_found"` - `message` (`searchComments.response.401.error.message`; string, required) - `retryable` (`searchComments.response.401.error.retryable`; boolean, required) - `retry_after` (`searchComments.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchComments.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchComments.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchComments.response.402.error.code`; string, required) - example `"not_found"` - `message` (`searchComments.response.402.error.message`; string, required) - `retryable` (`searchComments.response.402.error.retryable`; boolean, required) - `retry_after` (`searchComments.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchComments.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 403 Reddit does not show this content to logged-out readers, e.g. a private or quarantined subreddit (`reddit_refused`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchComments.response.403.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchComments.response.403.error.code`; string, required) - example `"not_found"` - `message` (`searchComments.response.403.error.message`; string, required) - `retryable` (`searchComments.response.403.error.retryable`; boolean, required) - `retry_after` (`searchComments.response.403.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchComments.response.403.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchComments.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchComments.response.429.error.code`; string, required) - example `"not_found"` - `message` (`searchComments.response.429.error.message`; string, required) - `retryable` (`searchComments.response.429.error.retryable`; boolean, required) - `retry_after` (`searchComments.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchComments.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchComments.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchComments.response.503.error.code`; string, required) - example `"not_found"` - `message` (`searchComments.response.503.error.message`; string, required) - `retryable` (`searchComments.response.503.error.retryable`; boolean, required) - `retry_after` (`searchComments.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchComments.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Search Reddit Posts > Searches Reddit posts, subreddits, or users matching a query string globally or within a specified subreddit. Source: https://threadapi.dev/api/Reddit/searchPosts/ · Markdown: https://threadapi.dev/api/Reddit/searchPosts/index.md Path: ThreadAPI API › Reddit `GET /v1/reddit/search/posts` Searches Reddit posts, subreddits, or users matching a query string globally or within a specified subreddit. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Query parameters - `q` (`searchPosts.query.q`; string, required) — Search query, 1 to 256 characters. - maxLength 256 - `type` (`searchPosts.query.type`; string, optional) — Content type to search: post, subreddit, or user. - one of `"post"`, `"subreddit"`, `"user"`; default `"post"` - `sub` (`searchPosts.query.sub`; string, optional) — Only search this subreddit. - `sort` (`searchPosts.query.sort`; string, optional) - one of `"relevance"`, `"new"`, `"top"`, `"comments"`; default `"relevance"` - `t` (`searchPosts.query.t`; string, optional) — Time window when sorting by `top` or `controversial`. - one of `"hour"`, `"day"`, `"week"`, `"month"`, `"year"`, `"all"` - `limit` (`searchPosts.query.limit`; integer, optional) — Number of items per page. - min 1; max 100; default `25` - `after` (`searchPosts.query.after`; string, optional) — Pagination cursor from the previous page's `after` field. - `nsfw` (`searchPosts.query.nsfw`; boolean, optional) — Include NSFW content (filtered out by default). - default `false` ## Code samples ### cURL ```bash curl --request GET \ --url 'https://api.threadapi.dev/v1/reddit/search/posts?q=best%20crm%20for%20small%20agency' \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/v1/reddit/search/posts?q=best%20crm%20for%20small%20agency'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/v1/reddit/search/posts?q=best%20crm%20for%20small%20agency" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 The search results. #### Example ```json { "subreddit": "string", "query": "string", "sort": "string", "count": 0, "items": [ { "id": "string", "name": "string", "domain": "string", "is_self": true, "flair": "string", "spoiler": true, "is_pinned": true, "locked": true, "removed": true, "subreddit": "string", "title": "string", "author": "string", "score": 0, "upvote_ratio": 0, "comments_count": 0, "url": "string", "permalink": "string", "body": "string", "is_video": true, "is_nsfw": true, "media": [ { "type": "image", "url": "string", "width": 0, "height": 0, "caption": "string" } ], "poll": { "total_votes": 0, "is_closed": true, "options": [ { "id": "string", "text": "string", "vote_count": 0 } ] }, "crosspost_of": { "id": "string", "subreddit": "string", "title": "string", "author": "string", "permalink": "string" }, "comments": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [ { "id": "string", "parent_id": "string", "author": "string", "score": 0, "body": "string", "depth": 0, "is_op": true, "replies": [] } ] } ] } ], "after": "string", "filtered_nsfw": 0 } ``` One of: - `Listing` - `SubredditListing` - `UserListing` ### 400 Bad request (invalid parameter or unknown action) #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchPosts.response.400.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchPosts.response.400.error.code`; string, required) - example `"not_found"` - `message` (`searchPosts.response.400.error.message`; string, required) - `retryable` (`searchPosts.response.400.error.retryable`; boolean, required) - `retry_after` (`searchPosts.response.400.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchPosts.response.400.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchPosts.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchPosts.response.401.error.code`; string, required) - example `"not_found"` - `message` (`searchPosts.response.401.error.message`; string, required) - `retryable` (`searchPosts.response.401.error.retryable`; boolean, required) - `retry_after` (`searchPosts.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchPosts.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 402 The account has no credits left (`insufficient_credits`). #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchPosts.response.402.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchPosts.response.402.error.code`; string, required) - example `"not_found"` - `message` (`searchPosts.response.402.error.message`; string, required) - `retryable` (`searchPosts.response.402.error.retryable`; boolean, required) - `retry_after` (`searchPosts.response.402.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchPosts.response.402.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchPosts.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchPosts.response.429.error.code`; string, required) - example `"not_found"` - `message` (`searchPosts.response.429.error.message`; string, required) - `retryable` (`searchPosts.response.429.error.retryable`; boolean, required) - `retry_after` (`searchPosts.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchPosts.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 503 A temporary problem reaching Reddit (`upstream_busy`, `upstream_timeout`, `upstream_blocked`, `upstream_error`). Nothing was billed. If `upstream_blocked`, wait for `Retry-After`. #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`searchPosts.response.503.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`searchPosts.response.503.error.code`; string, required) - example `"not_found"` - `message` (`searchPosts.response.503.error.message`; string, required) - `retryable` (`searchPosts.response.503.error.retryable`; boolean, required) - `retry_after` (`searchPosts.response.503.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`searchPosts.response.503.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Health check > Returns service health status, version, commit, and build time. Source: https://threadapi.dev/api/System/getHealth/ · Markdown: https://threadapi.dev/api/System/getHealth/index.md Path: ThreadAPI API › System `GET /api/v1/health` Returns service health status, version, commit, and build time. ## Code samples ### cURL ```bash curl --request GET \ --url https://api.threadapi.dev/api/v1/health ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/api/v1/health'; const options = {method: 'GET'}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/api/v1/health" response = requests.get(url) print(response.text) ``` ## Responses ### 200 Service is healthy #### Example ```json { "status": "ok", "service": "api", "timestamp": "2026-10-23T12:00:00Z", "version": "dev", "commit": "dev", "build_time": "dev" } ``` - `status` (`getHealth.response.200.status`; string, required) - example `"ok"` - `service` (`getHealth.response.200.service`; string, required) - example `"api"` - `timestamp` (`getHealth.response.200.timestamp`; string, required) - format `date-time`; example `"2026-10-23T12:00:00Z"` - `version` (`getHealth.response.200.version`; string, required) - example `"dev"` - `commit` (`getHealth.response.200.commit`; string, required) - example `"dev"` - `build_time` (`getHealth.response.200.build_time`; string, required) - example `"dev"` # Get user credit balance > Returns the authenticated user's ID and current credit balance. Source: https://threadapi.dev/api/User/getUserBalance/ · Markdown: https://threadapi.dev/api/User/getUserBalance/index.md Path: ThreadAPI API › User `GET /api/v1/user/balance` Returns the authenticated user's ID and current credit balance. ## Authentication Requires one of the following: - `bearerAuth`, http, header `Authorization` - `apiKeyAuth`, apiKey, in header, header `x-api-key` ## Code samples ### cURL ```bash curl --request GET \ --url https://api.threadapi.dev/api/v1/user/balance \ --header 'Authorization: Bearer ' ``` ### TypeScript ```typescript const url = 'https://api.threadapi.dev/api/v1/user/balance'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Python ```python import requests url = "https://api.threadapi.dev/api/v1/user/balance" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ## Responses ### 200 Current user balance #### Example ```json { "user_id": "usr_12345", "credit_balance": 100 } ``` - `user_id` (`getUserBalance.response.200.user_id`; string, required) - example `"usr_12345"` - `credit_balance` (`getUserBalance.response.200.credit_balance`; integer, required) - example `100` ### 401 Missing or invalid API key or OAuth access token #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserBalance.response.401.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserBalance.response.401.error.code`; string, required) - example `"not_found"` - `message` (`getUserBalance.response.401.error.message`; string, required) - `retryable` (`getUserBalance.response.401.error.retryable`; boolean, required) - `retry_after` (`getUserBalance.response.401.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserBalance.response.401.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 404 Requested user or resource not found #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserBalance.response.404.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserBalance.response.404.error.code`; string, required) - example `"not_found"` - `message` (`getUserBalance.response.404.error.message`; string, required) - `retryable` (`getUserBalance.response.404.error.retryable`; boolean, required) - `retry_after` (`getUserBalance.response.404.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserBalance.response.404.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 429 Rate limit or daily request quota exceeded #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserBalance.response.429.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserBalance.response.429.error.code`; string, required) - example `"not_found"` - `message` (`getUserBalance.response.429.error.message`; string, required) - `retryable` (`getUserBalance.response.429.error.retryable`; boolean, required) - `retry_after` (`getUserBalance.response.429.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserBalance.response.429.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. ### 500 Internal server error #### Example ```json { "error": { "code": "not_found", "message": "string", "retryable": true, "retry_after": 0, "request_id": "string" } } ``` - `error` (`getUserBalance.response.500.error`; object, required) — Some codes add fields, such as `limit` and `used` on `monitor_limit_reached` and `upgrade_url` on `rate_limited` and `daily_quota_exceeded`. - `code` (`getUserBalance.response.500.error.code`; string, required) - example `"not_found"` - `message` (`getUserBalance.response.500.error.message`; string, required) - `retryable` (`getUserBalance.response.500.error.retryable`; boolean, required) - `retry_after` (`getUserBalance.response.500.error.retry_after`; integer, optional) — Seconds to wait before retrying. - `request_id` (`getUserBalance.response.500.error.request_id`; string, optional) — The request's X-Request-Id; include it when reporting an issue. # Jobs > Billable job execution engine Source: https://threadapi.dev/api/tags/Jobs/ · Markdown: https://threadapi.dev/api/tags/Jobs/index.md Path: ThreadAPI API Billable job execution engine # Monitors > Keyword monitors across Reddit posts and comments with webhook delivery Source: https://threadapi.dev/api/tags/Monitors/ · Markdown: https://threadapi.dev/api/tags/Monitors/index.md Path: ThreadAPI API Keyword monitors across Reddit posts and comments with webhook delivery ## Operations - [List Monitors](/api/Monitors/listMonitors/) - [Create Monitor](/api/Monitors/createMonitor/) - [Get Monitor](/api/Monitors/getMonitor/) - [Delete Monitor](/api/Monitors/deleteMonitor/) - [Update Monitor](/api/Monitors/updateMonitor/) - [Pause Monitor](/api/Monitors/pauseMonitor/) - [Resume Monitor](/api/Monitors/resumeMonitor/) - [Rotate Webhook Secret](/api/Monitors/rotateMonitorSecret/) - [Test Webhook Delivery](/api/Monitors/testMonitor/) - [Get Monitor Matches](/api/Monitors/getMonitorMatches/) # Reddit > Reddit posts, comment trees, subreddit listings and search Source: https://threadapi.dev/api/tags/Reddit/ · Markdown: https://threadapi.dev/api/tags/Reddit/index.md Path: ThreadAPI API Reddit posts, comment trees, subreddit listings and search ## Operations - [Read Post](/api/Reddit/getPost/) - [Batch Look Up Posts by ID (POST)](/api/Reddit/postPostsBatch/) - [List Subreddit Posts](/api/Reddit/listSubredditPosts/) - [Get Subreddit Details](/api/Reddit/getSubreddit/) - [List Subreddit Comments](/api/Reddit/getSubredditComments/) - [Get User Profile](/api/Reddit/getUser/) - [List User Posts](/api/Reddit/getUserPosts/) - [List User Comments](/api/Reddit/getUserComments/) - [Search Reddit Posts](/api/Reddit/searchPosts/) - [Search Reddit Comments](/api/Reddit/searchComments/) # System > System health and operational endpoints Source: https://threadapi.dev/api/tags/System/ · Markdown: https://threadapi.dev/api/tags/System/index.md Path: ThreadAPI API System health and operational endpoints ## Operations - [Health check](/api/System/getHealth/) # User > User balance and account information Source: https://threadapi.dev/api/tags/User/ · Markdown: https://threadapi.dev/api/tags/User/index.md Path: ThreadAPI API User balance and account information ## Operations - [Get user credit balance](/api/User/getUserBalance/) # Quickstart > Read a Reddit post and its comments with one HTTPS request, as JSON or as Markdown for a model. Source: https://threadapi.dev/docs/ · Markdown: https://threadapi.dev/docs/index.md threadapi reads public Reddit for programs and AI agents. One request returns a post with its comment tree, as JSON or as one Markdown document, with a digest of what the thread agrees and argues about. There are also subreddit listings and search, a [remote MCP server](/docs/mcp), and nothing to run on your side: no Reddit app, no OAuth with Reddit, no proxies. > **Base URL** > > All API requests are made against `https://api.threadapi.dev/v1`. 1. ### Get a key Sign in at [app.threadapi.dev](https://app.threadapi.dev/login?utm_source=docs) with Google, GitHub or an email code. New accounts get 100 free credits. Create a key under [API keys](https://app.threadapi.dev/keys?utm_source=docs); it starts with `tapi_`. 2. ### Read a thread ### cURL ```bash curl "https://api.threadapi.dev/v1/reddit/post?format=md&url=https://www.reddit.com/r/selfhosted/comments/1sey9ch/" \ -H "Authorization: Bearer $THREADAPI_API_KEY" ``` ### Python ```python import os, requests r = requests.get( "https://api.threadapi.dev/v1/reddit/post", params={"url": "https://www.reddit.com/r/selfhosted/comments/1sey9ch/"}, headers={"Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}"}, ) r.raise_for_status() thread = r.json() print(thread["post"]["title"], thread["meta"]["comments_returned"]) ``` ### TypeScript ```ts const params = new URLSearchParams({ url: "https://www.reddit.com/r/selfhosted/comments/1sey9ch/", format: "md", }); const res = await fetch(`https://api.threadapi.dev/v1/reddit/post?${params}`, { headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}` }, }); console.log(await res.text()); ``` 3. ### Check what it cost Every successful response has an `X-Credits-Used` header. A post with up to 500 comments costs 1 credit; `max_comments` defaults to 200. See [pricing](/docs/pricing). ## Endpoints - [Post](/api/Reddit/getPost/) — A post, its comments nested as on Reddit, and a discussion digest. - [Subreddit](/api/Reddit/listSubredditPosts/) — Hot, new, top or rising posts in a subreddit. - [Search](/api/Reddit/searchPosts/) — Posts matching a query, across Reddit or in one subreddit. - [MCP Server](/docs/mcp) — The same tools for Claude, Cursor, VS Code and Codex. ## For language models - [llms.txt](/llms.txt) and [llms-full.txt](/llms-full.txt) describe the API in plain text. - The OpenAPI spec is at [/openapi.json](/openapi.json). # Agent Sign-up > Let an AI agent create a threadapi account and API key for a user. The user only reads a 6-digit code from their email back to the agent. Source: https://threadapi.dev/docs/agent-signup/ · Markdown: https://threadapi.dev/docs/agent-signup/index.md An AI agent (a skill, an MCP client, a coding assistant) can create a threadapi account for its user and get an API key without a browser. The user confirms by reading a 6-digit code from their email back to the agent. 1. Ask the user for their email address. 2. `POST https://threadapi.dev/api/agent/signup` with the email. threadapi emails a code and returns a `signup_token`. 3. Ask the user for the code. 4. `POST https://threadapi.dev/api/agent/verify` with the token and the code. The response holds the new `api_key`. 5. Store the key where the user's tools can read it, for example as `THREADAPI_API_KEY`, and use it as a [Bearer token](/docs/authentication). > **Keep the key out of the conversation** > > Write the verify response to a file or a variable instead of printing it, and do not echo `api_key` into the chat. --- ## 1. Request a code ### cURL ```bash curl -s -X POST https://threadapi.dev/api/agent/signup \ -H "Content-Type: application/json" \ -d '{"email": "user@example.com"}' ``` ### Python ```python import requests res = requests.post( "https://threadapi.dev/api/agent/signup", headers={"Content-Type": "application/json"}, json={"email": "user@example.com"}, ) res.raise_for_status() data = res.json() signup_token = data["signup_token"] print("Signup token received, code valid for:", data["expires_in"], "seconds") ``` ### TypeScript ```ts const res = await fetch("https://threadapi.dev/api/agent/signup", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email: "user@example.com" }), }); const data = await res.json(); const signupToken = data.signup_token; console.log(`Signup token received, expires in ${data.expires_in}s`); ``` ```json { "status": "code_sent", "signup_token": "eyJwdXJwb3NlIjoi…", "expires_in": 600, "next": "A 6-digit code was emailed to user@example.com. Ask the user for it, then POST …" } ``` The token and the code are valid for 10 minutes. The answer is the same whether or not the email already has an account. ## 2. Verify the code and get the key ### cURL ```bash curl -s -X POST https://threadapi.dev/api/agent/verify \ -H "Content-Type: application/json" \ -d '{"signup_token": "", "code": "123456"}' \ -o threadapi-signup.json ``` ### Python ```python import requests res = requests.post( "https://threadapi.dev/api/agent/verify", headers={"Content-Type": "application/json"}, json={"signup_token": signup_token, "code": "123456"}, ) res.raise_for_status() auth_info = res.json() api_key = auth_info["api_key"] print("API key created successfully with initial credits:", auth_info["credits"]) ``` ### TypeScript ```ts const res = await fetch("https://threadapi.dev/api/agent/verify", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ signup_token: signupToken, code: "123456" }), }); const authInfo = await res.json(); const apiKey = authInfo.api_key; console.log(`API key created with ${authInfo.credits} credits: ${apiKey}`); ``` `201 Created`: ```json { "status": "account_created", "api_key": "tapi_…", "credits": 100, "limits": { "requests_per_second": 1, "requests_per_day": 100 }, "next": "Store api_key where the user's tools can read it …", "example_request": "GET https://api.threadapi.dev/v1/reddit/post?url=https://www.reddit.com/r/selfhosted/comments/1sey9ch/&format=md", "docs": "https://threadapi.dev/docs", "notes": "The account has 100 free credits; only successful requests use credits. …" } ``` The user can sign in at [app.threadapi.dev](https://app.threadapi.dev/login?utm_source=docs) with the same email to see usage, manage keys, and buy credits. ## Existing accounts If the email already has a threadapi account, `/api/agent/verify` answers `409 account_exists` once the code is correct, and no key is created. The user signs in at [app.threadapi.dev/login](https://app.threadapi.dev/login?utm_source=docs) and creates a key at [app.threadapi.dev/keys](https://app.threadapi.dev/keys?utm_source=docs). ## Free credits and limits New accounts get **100 free credits**, once per email address: a `+tag` or a Gmail address with dots counts as the same mailbox. Outside large email providers, only a few new accounts per email domain get them each day. Until the account buys a pack, its keys can make **1 request per second** and **100 requests per day** (UTC); any [credit pack](/docs/pricing) removes the daily limit. ## Errors Errors use the API's standard envelope: ```json { "error": { "code": "invalid_code", "message": "That code is wrong. Ask the user to check the email and try again. …", "retryable": false } } ``` | Status | Code | What to do | | :--- | :--- | :--- | | 400 | `invalid_email` | Ask the user for a valid email address. | | 400 | `disposable_email` | Temporary inboxes are not accepted. Ask for the user's regular address. | | 400 | `undeliverable_email` | The domain cannot receive mail. Check the address with the user. | | 400 | `invalid_request` | Send `signup_token` and a 6-digit `code`. | | 400 | `invalid_signup_token` | The token is wrong or older than 10 minutes. Start over. | | 400 | `invalid_code` | Ask the user to check the code. After 3 wrong codes, start over. | | 400 | `code_expired` | The code is older than 10 minutes. Start over. | | 400 | `too_many_attempts` | 3 wrong codes. Start over. | | 409 | `account_exists` | The user creates a key on the website (see above). | | 429 | `rate_limited` | Too many sign-ups or codes for this network or email. Try again later. | | 502 | `email_failed` | The code email could not be sent. Retry in a minute. | | 503 | `agent_signup_busy` | Agent sign-up is paused for a while. Try again later, or the user signs up at [app.threadapi.dev](https://app.threadapi.dev/login?utm_source=docs). | | 503 | `agent_signup_disabled` | Agent sign-up is off. The user can sign up at [app.threadapi.dev](https://app.threadapi.dev/login?utm_source=docs). | "Start over" means calling `/api/agent/signup` again, which sends a new code. # Authentication > Send your API key as a Bearer token, and the rate limits that apply to it. Source: https://threadapi.dev/docs/authentication/ · Markdown: https://threadapi.dev/docs/authentication/index.md Every request needs an API key. Send it as a Bearer token: ```http Authorization: Bearer tapi_… ``` or in the `X-Api-Key` header. Keys start with `tapi_`. Create and revoke them under [API keys](https://app.threadapi.dev/api-keys?utm_source=docs); a revoked key stops working within a minute. > **Keep keys on the server** > > Anyone with your key spends your credits. Keep it in an environment variable, not in browser code or a public repository. A missing or unknown key gets `401`: ```json { "error": { "code": "unauthorized", "message": "Invalid or revoked API key.", "retryable": false } } ``` MCP clients can sign in with OAuth instead of a key; see [MCP server](/docs/mcp). ## Rate limits Limits apply per key and rise with the largest pack the account has bought: | Account | Requests | Burst | | :--- | :--- | ---: | | No pack bought yet | 1 per second, 100 per day (UTC) | 20 | | $9 pack | 300 per minute | 50 | | $29 pack | 600 per minute | 100 | | $79 pack | 1,000 per minute | 150 | Over the limit, the API answers `429` with `rate_limited` and a `Retry-After` header in seconds. A free key that has used its 100 requests for the day gets `429 daily_quota_exceeded` until 00:00 UTC; any pack removes the daily limit. Need more? [Contact us](https://threadapi.dev/contact?utm_source=docs). # Changelog > What changed in the threadapi API, newest first. Source: https://threadapi.dev/docs/changelog/ · Markdown: https://threadapi.dev/docs/changelog/index.md ## October 11, 2026 The first public version of the API. **Reading Reddit** - [Post](/api/Reddit/getPost/): a post with up to 2,000 comments, nested as on Reddit, as JSON or one Markdown document. Reddit's "load more comments" links are followed for you. A comment permalink, or `comment` with `context`, returns that comment, its parents and its replies. - A digest on every post: the original poster's replies, the most upvoted comments and the controversial ones, as Reddit reports them. - [Posts batch](/api/Reddit/postPostsBatch/): up to 100 posts and comments by ID or URL in one call. - Subreddits: [posts](/api/Reddit/listSubredditPosts/) by hot, new, top, rising, [newest comments](/api/Reddit/getSubredditComments/), and [description and rules](/api/Reddit/getSubreddit/). - [Search posts](/api/Reddit/searchPosts/) across Reddit or a subreddit, and [comment search](/api/Reddit/searchComments/). - Users: [profile and karma](/api/Reddit/getUser/), [posts](/api/Reddit/getUserPosts/) and [comments](/api/Reddit/getUserComments/). - Every list pages with `after` and leaves out NSFW items unless you pass `nsfw=true`. See [Listings and pages](/docs/listings). **Keyword monitors** - [Monitors](/docs/monitors) watch every new Reddit post and comment for your keywords and send matches to a webhook, Slack or Discord, or keep them for you to poll. 10 credits a day. **Agents** - An [MCP server](/docs/mcp) with seven tools, billed like the routes they call. **Pricing** - One credit is a post with up to 500 comments, or a page of up to 100 items. Credit packs from $9; credits never expire and failed requests are free. See [Pricing](/docs/pricing). # Errors > The error envelope, every error code, and when to retry. Source: https://threadapi.dev/docs/errors/ · Markdown: https://threadapi.dev/docs/errors/index.md Errors share one standard JSON envelope: ```json { "error": { "code": "not_found", "message": "Reddit has no such post or subreddit.", "retryable": false } } ``` When an error response includes `Retry-After`, the envelope also includes `"retry_after"` in seconds: ```json { "error": { "code": "upstream_busy", "message": "Reddit is refusing requests right now. Retry in a few seconds.", "retryable": true, "retry_after": 2, "request_id": "019318b7-4d7a-7f61-b4d2-28cb81a28a21" } } ``` Retry only when `retryable` is `true`, waiting at least `Retry-After` seconds when the response provides one. Failed requests cost zero credits. Every response, error or not, carries an `X-Request-Id` header; include it whenever you report an issue. | Status | Code | Meaning | Retry & Recovery Guidance | | :--- | :--- | :--- | :--- | | 400 | `invalid_request` | A parameter is missing, malformed, or exceeds allowed limits. The message specifies the exact parameter. | No. Fix the request parameters. | | 401 | `unauthorized` | The API key is missing, invalid, or has been revoked. | No. Check `Authorization: Bearer tapi_...` or generate a new key in the [console](https://app.threadapi.dev/api-keys?utm_source=docs). | | 402 | `insufficient_credits` | Your account credit balance is empty. | No immediate retry. [Purchase a credit pack](https://app.threadapi.dev/billing?utm_source=docs) to top up. | | 402 | `monitor_limit_reached` | You have reached the active monitor limit for your plan. The error includes `limit` and `used`. | Delete unused monitors or purchase a larger credit pack to raise the limit. | | 403 | `forbidden_scope` | The API key lacks the required scope for this endpoint. | No. Ensure your key has `reddit:read` scope. | | 403 | `nsfw_subreddit` | The target subreddit is marked NSFW. | Retry with `nsfw=true` query parameter. | | 403 | `reddit_refused` | Reddit refuses access to logged-out readers (private, quarantined, or age-gated community). | No. The content is inaccessible without an authenticated Reddit user session. | | 404 | `not_found` | Reddit has no such post, comment, user, or subreddit, or it has been permanently banned. | No. Confirm the ID, URL, or subreddit name exists. | | 409 | `duplicate_transaction` | Two credit transactions collided on the same transaction number. Rare. | Yes, retry the request. | | 413 | `request_entity_too_large` | The request body is larger than the API accepts. | No. Send a smaller body. | | 429 | `rate_limited` | Exceeded the requests-per-second or burst rate limit for your key, or too many failed sign-in attempts came from your IP. Includes `upgrade_url` when a credit pack would raise the limit. | Yes, after the duration specified in the `Retry-After` header. | | 429 | `daily_quota_exceeded` | A free-tier key used its 100 requests for the current UTC day. | Wait until 00:00 UTC daily quota reset, or [purchase any credit pack](https://app.threadapi.dev/billing?utm_source=docs) to remove the daily limit. | | 500 | `internal` | An unexpected error on our side. Nothing was billed. | Yes, retry shortly; report the `request_id` if it persists. | | 502 | `upstream_error` | Upstream network or HTTP protocol error communicating with Reddit. | Yes, with exponential backoff and jitter. | | 503 | `upstream_busy` | Reddit is refusing connections or upstream egress tunnel capacity is temporarily saturated. | Yes, wait for `Retry-After` seconds (or 1–3 seconds) and retry. | | 503 | `upstream_blocked` | Reddit is temporarily blocking requests. | Yes, wait until the next check as indicated by `Retry-After`. | | 503 | `upstream_timeout` | Reddit took longer than the request deadline to respond. | Yes, retry shortly. | | 503 | `upstream_quota_exhausted` | All upstream Cloudflare Worker accounts have reached daily capacity limits. | No immediate retry. Automatic reset occurs at 00:00 UTC. Check [ThreadAPI Status](https://status.threadapi.dev) for operational updates. | | 503 | `upstream_changed` | Reddit changed its web page markup structure (e.g. comment search). | No. ThreadAPI engineers are notified automatically to deploy an engine parser update. | | 503 | `service_unavailable` | Core billing, authentication, or monitor store is undergoing brief maintenance. | Yes, retry after a few seconds. | ## Notes on Reddit content status A post deleted on Reddit usually still exists as an empty shell: it returns `200 OK` with `[deleted]` as its author and body. A post removed by moderators returns `[removed]`. Neither counts as an error. ## Cached threads during a Reddit block When a cached thread is available, the post endpoint can return it with fewer comments than requested. An expired copy is kept for up to two hours after its normal cache expiry and is marked `X-Cache: STALE`. `X-Cache-Age` and JSON `meta.cache_age_seconds` give its age in seconds. Successful cached reads use the usual credits. A request that needs Reddit and cannot use the cache returns `upstream_blocked` at zero credits. # Getting started > Create an account, get an API key and make your first API call to read Reddit. Source: https://threadapi.dev/docs/getting-started/ · Markdown: https://threadapi.dev/docs/getting-started/index.md ThreadAPI provides real-time access to Reddit posts, comments, subreddits, and user profiles as clean JSON or LLM-ready Markdown. ## 1. Create an account and get an API key 1. Open the [ThreadAPI Console](https://app.threadapi.dev). 2. Sign in with your email address using a one-time code or OAuth. New accounts receive free trial credits. 3. In the console, navigate to **[API Keys](https://app.threadapi.dev/api-keys)** and click **Create Key**. 4. Copy your key immediately (starts with `tapi_`). It is only shown once. > **Keep your API key private** > > Your API key grants access to your credit balance. Always store it in environment variables on your backend or CLI tool, never in public repositories or client-side code. ## 2. Make your first API call Pass your API key in the `Authorization` header as a Bearer token: ### Example: Read subreddit information ### cURL ```bash curl -X GET "https://api.threadapi.dev/v1/reddit/subreddit?sub=selfhosted" \ -H "Authorization: Bearer $THREADAPI_API_KEY" ``` ### Python ```python import os, requests res = requests.get( "https://api.threadapi.dev/v1/reddit/subreddit", headers={"Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}"}, params={"sub": "selfhosted"}, ) res.raise_for_status() sub = res.json() print(sub["name"], "-", sub["title"]) print(f"Subscribers: {sub['subscribers']:,}") ``` ### TypeScript ```ts const res = await fetch("https://api.threadapi.dev/v1/reddit/subreddit?sub=selfhosted", { headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}` }, }); const sub = await res.json(); console.log(`${sub.name} - ${sub.title} (${sub.subscribers} subscribers)`); ``` Response: ```json { "name": "selfhosted", "title": "Self-Hosted Alternatives to Popular Services", "public_description": "A place to share, discuss, discover, assist with, gain assistance for, and critique self-hosted alternatives...", "subscribers": 868722, "created_at": "2014-07-08T09:34:14.239Z", "is_nsfw": false, "type": "public", "url": "/r/selfhosted/", "icon": "https://styles.redditmedia.com/t5_32hch/styles/communityIcon_zttnt3jjmddh1.png?width=64&frame=1&auto=webp&s=4a0dfbfac29b79ce75d06e5079e027aad47a849b", "rules": [ { "priority": 0, "short_name": "Low-Effort / Off-Topic", "description": "All posts must be about self-hosting...", "violation_reason": "Low-Effort / Off-Topic (Not Selfhosted)" } ] } ``` ### Example: Fetch a post and comment tree ### cURL ```bash curl -X GET "https://api.threadapi.dev/v1/reddit/post?url=https://www.reddit.com/r/selfhosted/comments/1sey9ch/&format=json" \ -H "Authorization: Bearer $THREADAPI_API_KEY" ``` ### Python ```python import os, requests res = requests.get( "https://api.threadapi.dev/v1/reddit/post", headers={"Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}"}, params={ "url": "https://www.reddit.com/r/selfhosted/comments/1sey9ch/", "format": "json", }, ) res.raise_for_status() data = res.json() print(data["post"]["title"]) print(f"Comments returned: {data['meta']['comments_returned']}/{data['post']['comments_count']}") ``` ### TypeScript ```ts const params = new URLSearchParams({ url: "https://www.reddit.com/r/selfhosted/comments/1sey9ch/", format: "json", }); const res = await fetch(`https://api.threadapi.dev/v1/reddit/post?${params}`, { headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}` }, }); const data = await res.json(); console.log(`${data.post.title} (${data.meta.comments_returned} comments)`); ``` To receive a clean, structured Markdown digest instead of JSON, pass `format=md`: ### cURL ```bash curl -X GET "https://api.threadapi.dev/v1/reddit/post?url=https://www.reddit.com/r/selfhosted/comments/1sey9ch/&format=md" \ -H "Authorization: Bearer $THREADAPI_API_KEY" ``` ### Python ```python import os, requests res = requests.get( "https://api.threadapi.dev/v1/reddit/post", headers={"Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}"}, params={ "url": "https://www.reddit.com/r/selfhosted/comments/1sey9ch/", "format": "md", }, ) res.raise_for_status() print(res.text) # Plain markdown with indented discussion tree ``` ### TypeScript ```ts const params = new URLSearchParams({ url: "https://www.reddit.com/r/selfhosted/comments/1sey9ch/", format: "md", }); const res = await fetch(`https://api.threadapi.dev/v1/reddit/post?${params}`, { headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}` }, }); const markdown = await res.text(); console.log(markdown); ``` ## 3. Rate limits & billing * **Credits**: Standard listing and post requests cost **1 credit**. Deep comment trees cost 1 credit per 500 comments. * **Response headers**: Every response returns `X-Credits-Used`, `X-Cache` (`HIT` or `MISS`), and `X-Request-Id`. * **Zero charge on failure**: Requests resulting in 4xx or 5xx errors are never billed. * **Top up**: Purchase non-expiring credit packs anytime in the **[Billing Console](https://app.threadapi.dev/billing)**. ## 4. Next steps * **[Interactive Playground](https://app.threadapi.dev/playground)**: Test every endpoint directly in your browser. * **[API Reference](/api/)**: Explore full OpenAPI specifications and interactive curl builders for all endpoints. * **[MCP Server](/docs/mcp)**: Connect Claude, Cursor, VS Code, or Codex to real-time Reddit data via MCP. * **[Keyword Monitors](/docs/monitors)**: Stream new Reddit posts and comments matching your keywords to webhooks or Discord. # Listings and pages > The envelope every list endpoint returns, how to page through it, and how NSFW items are filtered. Source: https://threadapi.dev/docs/listings/ · Markdown: https://threadapi.dev/docs/listings/index.md Every endpoint that returns a list of posts, comments, subreddits or users answers with the same envelope: ```jsonc { "subreddit": "golang", // the subreddit asked for, or null "query": null, // the search query, or null "sort": "top", // the sort Reddit applied "count": 3, // items in this page "items": [ /* posts or comments */ ], "after": "t3_1x0vbyx", // pass back as after= for the next page; null on the last "filtered_nsfw": 0 // NSFW items left out of this page } ``` The item type depends on the endpoint: [Subreddit](/api/Reddit/listSubredditPosts/), [Search posts](/api/Reddit/searchPosts/) and [User posts](/api/Reddit/getUserPosts/) return posts; [Subreddit comments](/api/Reddit/getSubredditComments/), [User comments](/api/Reddit/getUserComments/) and [Comment search](/api/Reddit/searchComments/) return comments. ## Pages Pass the previous page's `after` to get the next one. Each page is one call and 1 credit. ### cURL ```bash curl "https://api.threadapi.dev/v1/reddit/subreddit/posts?sub=golang&sort=new&limit=100&after=t3_1x0vbyx" \ -H "Authorization: Bearer $THREADAPI_API_KEY" ``` ### Python ```python import os, requests res = requests.get( "https://api.threadapi.dev/v1/reddit/subreddit/posts", headers={"Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}"}, params={ "sub": "golang", "sort": "new", "limit": 100, "after": "t3_1x0vbyx", }, ) res.raise_for_status() page = res.json() print(f"Got {page['count']} posts; next page after: {page['after']}") ``` ### TypeScript ```ts const params = new URLSearchParams({ sub: "golang", sort: "new", limit: "100", after: "t3_1x0vbyx", }); const res = await fetch(`https://api.threadapi.dev/v1/reddit/subreddit/posts?${params}`, { headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}` }, }); const page = await res.json(); console.log(`Got ${page.count} posts; next page after: ${page.after}`); ``` `after` is a Reddit fullname (`t3_…` for posts, `t1_…` for comments) except on comment search, where it is an opaque string. Treat it as opaque everywhere and pass it back unchanged. Reddit stops a listing at about 1,000 items, whatever the sort. To go further back, narrow the request: a shorter `t` window, a search with `sub`, or a different sort. ## NSFW Items Reddit marks NSFW are left out unless you pass `nsfw=true`. `filtered_nsfw` counts how many were left out of the page, so a page can hold fewer than `limit` items while `after` is still set. Reading a subreddit that is itself marked NSFW without `nsfw=true` returns 403 `nsfw_subreddit`: ```json {"error":{"code":"nsfw_subreddit","message":"This subreddit is marked NSFW. Pass nsfw=true to read it.","retryable":false}} ``` ## Caching Listings are cached briefly: 30 seconds for `new` and `rising`, a minute for `hot` and search, and 5 minutes for `top` and `controversial` over a day or longer. The `X-Cache` header says whether the page came from the cache (`HIT`) or from Reddit (`MISS`). A cached page costs the same 1 credit. # MCP server > Give Claude, Cursor, VS Code or Codex Reddit posts, subreddits and search through threadapi's remote MCP server. Source: https://threadapi.dev/docs/mcp/ · Markdown: https://threadapi.dev/docs/mcp/index.md threadapi runs a remote MCP server. There's nothing to install: point your client at the URL, then sign in to threadapi when the client asks, or send an API key. | | | | :--- | :--- | | **URL** | `https://api.threadapi.dev/mcp` | | **Transport** | Streamable HTTP | | **Auth** | OAuth sign-in, or `Authorization: Bearer ` | | **Billing** | Tool calls cost the same as the REST routes. Connecting and listing tools is free. | No account yet? An agent can create one for its user: see [Agent sign-up](/docs/agent-signup). ## Tools | Tool | What it does | Credits | | :--- | :--- | :--- | | `get_reddit_post` | Returns a Reddit post (or a comment subtree when given a comment permalink) with its full comment tree (up to max_comments, default 200) as Markdown (default) or JSON. Costs 1 credit for up to 500 comments, and 1 more credit per additional 100 comments. A deleted or private post returns an error and costs nothing. Arguments: `post`, `format`, `max_comments`, `digest`, `comment`, `context`. | 1 for up to 500 comments, +1 per further 100 | | `get_reddit_items` | Looks up to 100 Reddit posts or comments by their ID or URL. Returns posts and comments in request order, listing any that were deleted or not found. Arguments: `ids`. | 1 | | `list_subreddit_posts` | Lists a subreddit's posts (hot, new, top, rising, or controversial) with scores, comment counts, post age, and pagination cursors. Arguments: `subreddit`, `sort`, `time`, `limit`, `after`, `nsfw`. | 1 | | `get_subreddit` | Returns subreddit description, subscriber count, and rules. Arguments: `subreddit`. | 1 | | `get_reddit_user` | Returns a Reddit user profile with karma and account details (1 credit). When include is 'posts' or 'comments', also returns their recent submissions or comments (2 credits). Arguments: `name`, `include`. | 1, or 2 with `include` | | `search_reddit` | Searches Reddit posts, comments, subreddits, or users. Returns scores, links, snippets, and pagination cursors. Arguments: `query`, `type`, `subreddit`, `sort`, `time`, `limit`, `after`, `nsfw`. | 1 | | `list_monitors` | Lists your keyword monitors, their current status (active or paused), match counts, and account limits. | 0 | | `get_monitor_matches` | Returns recent matched posts and comments for a monitor, with match metadata, timestamps, and pagination cursors. Arguments: `monitor_id`, `order`, `after`, `before`, `limit`. | 0 | | `create_monitor` | Creates a keyword monitor. Costs 10 credits a day while it runs; matches are free. Ask the user for confirmation before creating. Arguments: `name`, `keywords`, `exclude`, `subreddits`, `posts`, `comments`, `nsfw`, `webhook_url`, `webhook_kind`. | 10 credits / day | | `update_monitor` | Updates an existing keyword monitor's settings. Free (0 credits). Ask the user for confirmation before updating. Arguments: `monitor_id`, `name`, `keywords`, `exclude`, `subreddits`, `posts`, `comments`, `nsfw`, `webhook_url`, `webhook_kind`. | 0 | | `pause_monitor` | Pauses an active keyword monitor. It stops matching and incurs no daily charges while paused. Free (0 credits). Ask the user for confirmation before pausing. Arguments: `monitor_id`. | 0 | | `resume_monitor` | Resumes a paused keyword monitor. Costs 10 credits a day while it runs; matches are free. Deducts 10 credits for the next 24 hours. Ask the user for confirmation before resuming. Arguments: `monitor_id`. | 10 credits / day | | `delete_monitor` | Permanently deletes a keyword monitor. Free (0 credits). Ask the user for confirmation before deleting. Arguments: `monitor_id`. | 0 | Errors come back as tool errors with a hint for the model, and cost nothing. ## Resources Read-only context providers exposed through MCP URIs: | Resource URI Template | MIME Type | Description | | :--- | :--- | :--- | | `reddit://post/{id}` | `text/markdown` | Direct markdown representation of a raw Reddit post and its full comment tree. | | `reddit://r/{subreddit}/hot` | `text/plain` | Top hot posts from a subreddit in JSON format. | ## Client Setup ### Claude Code 1. Register ThreadAPI in Claude Code: ```bash claude mcp add --transport http threadapi https://api.threadapi.dev/mcp ``` 2. Sign in with OAuth: Run `/mcp` in Claude Code and sign in when the browser opens. ### Claude Desktop / claude.ai 1. Open connector settings in Claude: Navigate to **Settings → Connectors** and click **Add custom connector**. 2. Enter the MCP server URL: ```text https://api.threadapi.dev/mcp ``` 3. Connect and authorize: Click **Connect** and authorize in your browser when prompted. Note: Free Claude accounts support 1 custom connector. ### Cursor 1. Add configuration to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (project-specific): ```json { "mcpServers": { "threadapi": { "url": "https://api.threadapi.dev/mcp" } } } ``` 2. Sign in with OAuth: When prompted by Cursor, authorize in your browser. Tokens refresh automatically. If your client does not open a sign-in page, authenticate with an API key: ```json { "mcpServers": { "threadapi": { "url": "https://api.threadapi.dev/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` ### VS Code Add to `.vscode/mcp.json` or your user settings: ```json { "servers": { "threadapi": { "type": "http", "url": "https://api.threadapi.dev/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` ### Windsurf 1. Add configuration to `~/.codeium/windsurf/mcp_config.json`: ```json { "mcpServers": { "threadapi": { "serverUrl": "https://api.threadapi.dev/mcp" } } } ``` 2. Sign in with OAuth: When prompted by Windsurf, authorize in your browser. Tokens refresh automatically. If your client does not open a sign-in page, authenticate with an API key: ```json { "mcpServers": { "threadapi": { "serverUrl": "https://api.threadapi.dev/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` ### Raw HTTP Send JSON-RPC requests directly over HTTP: ```bash curl -X POST https://api.threadapi.dev/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}' ``` # Monitors > Get new Reddit posts and comments that mention your keywords, by webhook or by polling. Source: https://threadapi.dev/docs/monitors/ · Markdown: https://threadapi.dev/docs/monitors/index.md A monitor watches every new post and comment on Reddit for your keywords. When one matches, threadapi sends it to your webhook (your own endpoint, Slack or Discord) and keeps it for you to read from the API or the [dashboard](https://app.threadapi.dev/monitors?utm_source=docs). A running monitor costs **10 credits per day** (up to 20 keywords). Its matches and deliveries are free. ## How matching works - Keywords match whole words, ignoring case: `rust` matches "Rust" and "RUST" but not "trust" or "rusty". A keyword with several words matches that phrase: `borg backup`. Quotes around a keyword are optional. - Keywords in Chinese, Japanese or Korean match anywhere in the text, since those languages don't separate words with spaces. - A post matches on its title and text, a comment on its text. - An item matches if it contains any keyword and no `exclude` term. - Up to 20 keywords and 20 exclude terms, each 2 to 100 characters. Up to 50 subreddits; leave `subreddits` empty to watch all of Reddit. - Items marked NSFW are skipped unless the monitor has `nsfw: true`. Most matches arrive within 15 seconds of being posted. A post that Reddit is slow to make visible can take about two minutes. If Reddit stops answering threadapi for a while, items posted during that time can be missed. ## Create a monitor ### cURL ```bash curl https://api.threadapi.dev/v1/monitors \ -H "Authorization: Bearer $THREADAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Backup tools", "keywords": ["restic", "borg backup", "kopia"], "exclude": ["hiring"], "subreddits": ["selfhosted", "DataHoarder", "homelab"], "posts": true, "comments": true, "webhook_url": "https://example.com/threadapi-hook" }' ``` ### Python ```python import os, requests res = requests.post( "https://api.threadapi.dev/v1/monitors", headers={ "Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}", "Content-Type": "application/json", }, json={ "name": "Backup tools", "keywords": ["restic", "borg backup", "kopia"], "exclude": ["hiring"], "subreddits": ["selfhosted", "DataHoarder", "homelab"], "posts": True, "comments": True, "webhook_url": "https://example.com/threadapi-hook", }, ) res.raise_for_status() data = res.json() print("Created monitor:", data["monitor"]["id"], data["monitor"]["status"]) ``` ### TypeScript ```ts const res = await fetch("https://api.threadapi.dev/v1/monitors", { method: "POST", headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Backup tools", keywords: ["restic", "borg backup", "kopia"], exclude: ["hiring"], subreddits: ["selfhosted", "DataHoarder", "homelab"], posts: true, comments: true, webhook_url: "https://example.com/threadapi-hook", }), }); const data = await res.json(); console.log("Created monitor:", data.monitor.id, data.monitor.status); ``` | Field | Type | | | :--- | :--- | :--- | | `name` | string | Required. Your label for the monitor. | | `keywords` | string[] | Required. 1 to 20 terms. | | `exclude` | string[] | Skip items containing any of these. | | `subreddits` | string[] | Only watch these, with or without `r/`. Empty means all of Reddit. | | `posts` | boolean | Watch new posts. Default `true`. | | `comments` | boolean | Watch new comments. Default `true`. | | `nsfw` | boolean | Include NSFW items. Default `false`. | | `webhook_url` | string | An `https://` URL to send matches to. Optional: without one, read matches from the API. | | `webhook_kind` | string | `generic`, `slack`, `discord` or `telegram`. Detected from the URL when left out. | Creating a monitor charges 10 credits for its first 24 hours and answers `201`: ```jsonc { "monitor": { "id": "c8nh5roydywdmhsndzqdd269p", "name": "Backup tools", "keywords": ["restic", "borg backup", "kopia"], "exclude": ["hiring"], "subreddits": ["selfhosted", "datahoarder", "homelab"], "include_posts": true, "include_comments": true, "status": "active", "matches_total": 0, "next_charge_at": "2026-10-21T15:00:00Z", "created_at": "2026-10-20T15:00:00Z" } } ``` ## Polling matches If you omit `webhook_url`, you can poll `/v1/monitors/{id}/matches`: ### cURL ```bash curl "https://api.threadapi.dev/v1/monitors/c8nh5roydywdmhsndzqdd269p/matches?limit=50" \ -H "Authorization: Bearer $THREADAPI_API_KEY" ``` ### Python ```python import os, requests res = requests.get( "https://api.threadapi.dev/v1/monitors/c8nh5roydywdmhsndzqdd269p/matches", headers={"Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}"}, params={"limit": 50}, ) res.raise_for_status() matches = res.json()["matches"] for m in matches: print(m["item_type"], m.get("title") or m.get("body", "")[:60]) ``` ### TypeScript ```ts const res = await fetch( "https://api.threadapi.dev/v1/monitors/c8nh5roydywdmhsndzqdd269p/matches?limit=50", { headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}` }, } ); const data = await res.json(); console.log(`Found ${data.matches.length} matches`); ``` Matches are ordered by timestamp with pagination via cursor tokens. # Pricing > Credit packs that never expire. One credit is one page of Reddit, and failed requests are free. Source: https://threadapi.dev/docs/pricing/ · Markdown: https://threadapi.dev/docs/pricing/index.md threadapi sells credit packs. There is no subscription: packs add to one balance and never expire. | Pack | Credits | Per 1,000 | Rate limit | | ---: | ---: | ---: | :--- | | Free, on sign-up | 100 | | 1 request per second, 100 per day | | $9 | 2,000 | $4.50 | 300 per minute | | $29 | 10,000 | $2.90 | 600 per minute | | $79 | 50,000 | $1.58 | 1,000 per minute | Buy packs in the [billing dashboard](https://app.threadapi.dev/billing?utm_source=docs). Over 50,000 a month, [ask about volume pricing](https://threadapi.dev/contact?utm_source=docs). ## What a request costs One credit is one page of Reddit: | Request | Credits | | :--- | ---: | | [Post](/api/Reddit/getPost/) with up to 500 comments | 1 | | Each further 100 comments, or part of 100 | 1 | | Any [listing](/docs/listings) page, up to 100 items: subreddit posts or comments, search, user posts or comments | 1 | | [Comment search](/api/Reddit/searchComments/), one page | 1 | | [Posts batch](/api/Reddit/postPostsBatch/), up to 100 posts and comments | 1 | | [Subreddit](/api/Reddit/getSubreddit/) or [User](/api/Reddit/getUser/) | 1 | | A running [monitor](/docs/monitors), per day (up to 20 keywords) | 10 | | Monitor matches, webhook deliveries, and managing monitors | 0 | | Any failed request | 0 | - A post request asks for 200 comments unless you set `max_comments`, so it costs 1 credit. `max_comments=1000` costs at most 6. - You pay for the comments a response returns, not for the requests threadapi makes to produce it. Retries on our side are never billed. - A response served from cache costs the same as a fresh one. - If your balance covers fewer pages than you asked for, you get what it covers and `meta.limited_by_balance` is `true`. The balance never goes below zero. - MCP tool calls cost the same as the routes they call. The playground in the dashboard is billed like a key. - `X-Credits-Used` on every successful response says what it cost; the [logs](https://app.threadapi.dev/logs?utm_source=docs) list each request. ## Monitors A [monitor](/docs/monitors) charges 10 credits when you create or resume it, then 10 credits every 24 hours while it runs (up to 20 keywords, matches free). Pausing or deleting it stops the charges. When a renewal finds insufficient credits, the monitor stops until you add credits and resume it. How many monitors you can run depends on the largest pack you've bought: | | Monitors | Matches per monitor per day | | :--- | ---: | ---: | | Free | 1 | 200 | | $9 pack | 5 | 1,000 | | $29 pack | 20 | 1,000 | | $79 pack | 50 | 1,000 | Low-balance emails say how many days your running monitors have left. ## Refunds Within 14 days of buying a pack, if none of its credits were used. Email [hello@threadapi.dev](mailto:hello@threadapi.dev). # Versioning & Stability > ThreadAPI API versioning policy, additive-only stability commitments, and 90-day deprecation lifecycle. Source: https://threadapi.dev/docs/versioning/ · Markdown: https://threadapi.dev/docs/versioning/index.md ThreadAPI is designed for automated pipelines, AI agents, and production systems. We treat API stability as a non-negotiable contract: breaking changes break agent workflows and production applications. This document outlines our versioning strategy, backward compatibility commitments, and deprecation lifecycle. --- ## API Versioning Scheme The current stable API version is **v1**, accessible via the `/v1` base URL: ```http https://api.threadapi.dev/v1 ``` All public REST endpoints are prefixed with `/v1`. New major API versions (e.g., `/v2`) will only be introduced if fundamental, incompatible protocol transformations are required. --- ## The v1 Additive-Only Commitment For the entire lifespan of `/v1`, ThreadAPI commits to **additive-only backward compatibility**. Existing client integrations will continue to function without modification. ### Non-breaking changes (Permitted anytime) The following changes may occur without a major version bump or advance deprecation period: - **New endpoints**: Adding new REST paths or MCP tools. - **New response fields**: Adding new keys to existing JSON response payloads. - **New optional parameters**: Adding new optional query parameters or optional request body fields. - **Relaxed constraints**: Increasing rate limits, loosening input validations, or expanding allowable enum values. - **New error codes**: Adding specific error codes for new features or edge conditions (existing error codes retain their semantics). ### Breaking changes (Prohibited in v1) ThreadAPI will **never** perform the following changes within `/v1`: - Removing or renaming existing endpoints. - Removing, renaming, or changing the type of existing response fields. - Removing or renaming existing query parameters or path parameters. - Changing an optional request parameter to required. - Altering the semantic meaning of existing fields or error codes. --- ## 90-Day Deprecation Policy If an endpoint, parameter, or behavior is ever marked for retirement or replacement: 1. **Advance Notice**: ThreadAPI provides a minimum of **90 calendar days advance notice** before any endpoint or feature is discontinued. 2. **Notification Channels**: - Published in the [Changelog](/docs/changelog). - Flagged in the [OpenAPI specification](/openapi.json) with `deprecated: true`. - Direct email notification to account owners with active usage of the deprecated feature. 3. **HTTP Deprecation Headers**: During the active deprecation window, requests to the deprecated endpoint will return standard HTTP deprecation headers compliant with [RFC 9211](https://www.rfc-editor.org/rfc/rfc9211) and [RFC 8594](https://www.rfc-editor.org/rfc/rfc8594): - `Deprecation: @` — The Unix timestamp or date when deprecation became effective. - `Sunset: ` — The exact future date and time when the endpoint will cease operation. - `Link: ; rel="deprecation"` — Link to the relevant migration guide. Example response headers during deprecation: ```http HTTP/1.1 200 OK Content-Type: application/json Deprecation: @1735689600 Sunset: Mon, 30 Jun 2027 00:00:00 GMT Link: ; rel="deprecation" X-Request-Id: 019318b7-4d7a-7f61-b4d2-28cb81a28a21 ``` Once the `Sunset` date has passed, requests to retired endpoints will return `410 Gone` or `404 Not Found` with an actionable error explanation. --- ## Client Integration Best Practices To ensure long-term resilience across API updates, we recommend the following practices: - **Tolerant Reader Pattern**: Parse JSON responses defensively. Your deserializer should ignore unfamiliar fields rather than failing when new fields are added. - **Check Deprecation Headers**: Configure logging or alerting in your API gateway/client to warn when response headers contain `Deprecation` or `Sunset`. - **Use Formal Parameter Names**: Avoid unofficial parameter aliases and use canonical parameters documented in the [API Reference](/api/). - **Honor HTTP Status Codes & Envelopes**: Inspect HTTP status codes and the standard `{"error": {"code": "...", "retryable": bool}}` envelope rather than matching raw HTTP error strings.