# List posts

List public posts from one or more subreddits, with new, hot, top, and rising rankings and cursor pagination. May take up to 60 seconds.

- Platform: [Reddit](https://docs.upscrape.com/docs/platforms/reddit)
- Capability ID: `reddit.posts.list`
- Cost: 1 credit per request
- Maximum runtime: 60 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "limit": 25,
    "sort": "new",
    "subreddits": "webdev,startups"
  },
  "capability": "reddit.posts.list"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `after` | `string` | No | Opaque cursor from a previous result's next field. |
| `limit` | `integer` | No | Page size (default 50). From 1 to 100. Default: `50`. |
| `sort` | `string` | No | Reddit listing order. Allowed values: `new`, `hot`, `top`, `rising`. Default: `new`. |
| `subreddits` | `string` | Yes | Required comma-separated individual community names. Aggregate feeds all and popular are unavailable. For global post search, use reddit.posts.search. |
| `time` | `string` | No | Ranking window. Primarily affects top listings. Allowed values: `hour`, `day`, `week`, `month`, `year`, `all`. Default: `all`. |

### Example input

```json
{
  "limit": 25,
  "sort": "new",
  "subreddits": "webdev,startups"
}
```

## Response

Successful output is returned in `results[0].data`.

Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "items": [
    {
      "author": "Latter-Ad2194",
      "body": "i need to convert a dynamic website into static without the access to its wp files or wp admin access The static site should be entirely same like every minor details like header/footer elements size, logo placement etc",
      "created_utc": 1787376778,
      "id": "t3_1vv3ov2",
      "nsfw": false,
      "num_comments": 0,
      "num_comments_available": true,
      "permalink": "https://www.reddit.com/r/webdev/comments/1vv3ov2/how_do_i_clone_a_website/",
      "score": 1,
      "score_available": true,
      "subreddit": "webdev",
      "title": "How do I clone a website",
      "type": "post",
      "url": null
    },
    {
      "author": "Lower_Fishing_2672",
      "body": "I just started learning code, and I use Visual Code Studio with Python. I was ecstatic to learn but with my few hours of learning I would use the chat feature whenever I’m stuck like the AI thingy. It makes me feel bad cause it feels like I’m not LEARNING just cheating if that makes sense. In a world that has been plagued with AI, how do you guys manage? How do you feel? Do you treat it as another…",
      "created_utc": 1787374963,
      "id": "t3_1vv345x",
      "nsfw": false,
      "num_comments": 17,
      "num_comments_available": true,
      "permalink": "https://www.reddit.com/r/webdev/comments/1vv345x/just_started_but_feel_bad/",
      "score": 5,
      "score_available": true,
      "subreddit": "webdev",
      "title": "Just Started But Feel Bad",
      "type": "post",
      "url": null
    },
    {
      "author": "velvetmoth_24",
      "body": "Hey everyone! I’ve recently started exploring web development as a hobby and I’m really enjoying the process of learning by building small projects. I already have a decent understanding of HTML, CSS, and JavaScript, although I haven’t had much experience building larger or production-level websites yet. I’m thinking of using Astro for my next projects because I really like its approach to perform…",
      "created_utc": 1787374339,
      "id": "t3_1vv2wl0",
      "nsfw": false,
      "num_comments": 4,
      "num_comments_available": true,
      "permalink": "https://www.reddit.com/r/webdev/comments/1vv2wl0/looking_for_some_astro_advice/",
      "score": 4,
      "score_available": true,
      "subreddit": "webdev",
      "title": "Looking for some Astro advice",
      "type": "post",
      "url": null
    }
  ],
  "next": "[redacted:token]"
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 3 items |
| `items` | `array` | 3 items |
| `next` | `string` | [redacted:token] |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
