# Reddit Post (`reddit.post`)

One Reddit post by URL: title, body, author, subreddit, score, upvote ratio, comment count and flags.

Docs: https://primaryapi.com/docs/api-reference/reddit/post

- Endpoint: `POST https://api.primaryapi.com/v1/run/reddit.post`
- Category: Social · Platform: `reddit` · Kind: lookup · Status: live
- Price: 2 credits per call; up to 5 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=reddit.post`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `url` | string | yes |  | max 2048 chars | Reddit post URL, e.g. "https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_united_states/". Also accepted: old./new./m.reddit.com, /comments/<id>, /gallery/<id>, redd.it/<id>, a relative /r/<sub>/comments/<id>/ permalink or the bare post id. Share links (/r/<sub>/s/<token>) work on URL-based sources only. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `id` | string | Post id (base36, without the t3_ prefix) |
| `title` | string \| null |  |
| `body` | string \| null | Self-post body (markdown); null for link posts |
| `author` | string \| null |  |
| `authorId` | string \| null | Author account id (without the t2_ prefix) |
| `subreddit` | string \| null |  |
| `score` | integer \| null |  |
| `upvoteRatio` | number \| null | Upvote ratio 0-1 |
| `numComments` | integer \| null |  |
| `createdUtc` | integer \| null | Creation time, UTC epoch seconds |
| `editedUtc` | integer \| null | Last edit time, UTC epoch seconds; null when never edited |
| `permalink` | string \| null | Absolute reddit.com URL of the post |
| `url` | string \| null | Link target (external URL for link posts, the post itself for self posts) |
| `domain` | string \| null |  |
| `image` | string \| null | First image / preview URL when present |
| `isNsfw` | boolean \| null |  |
| `isLocked` | boolean \| null |  |
| `isArchived` | boolean \| null |  |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/reddit.post" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.reddit.com/r/webscraping/comments/1flgwup/after_2_months_learning_scraping_im_sharing_what_i/"}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "id": "string",
      "title": "string",
      "body": "string",
      "author": "string",
      "authorId": "string",
      "subreddit": "string",
      "score": 0,
      "upvoteRatio": 0,
      "numComments": 0,
      "createdUtc": 0,
      "editedUtc": 0,
      "permalink": "string",
      "url": "https://www.reddit.com/r/webscraping/comments/1flgwup/after_2_months_learning_scraping_im_sharing_what_i/",
      "domain": "string",
      "image": "string",
      "isNsfw": true,
      "isLocked": true,
      "isArchived": true
    }
  },
  "provider": "PrimaryAPI",
  "credits": 2,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z"
}
```

## Pricing and reliability

- Usual price: 2 credits per call
- Price ceiling: up to 5 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=reddit.post`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Legal

Served from third-party scrapers: Reddit’s Data API Terms (rev. 2026-07-20, §3.1-3.2) forbid reselling its own API, and Reddit sued scraping vendors in 2025 (Reddit v. SerpApi et al., SDNY 25-cv-08736). Usernames and user content are personal data under GDPR/CCPA even when pseudonymous: use for lawful purposes only, honour deletions, do not keep removed content, and do not train AI models on it without rightsholder permission (Data API Terms §2.4).

