# Reddit

Measured Reddit data, one operation per call. The POST is the entity: score, upvote ratio, comment count, kind and permalink on every row. There is no profile card — Reddit publishes none we can measure. ops: posts (one user's recent submissions — u/name or a profile URL), subreddit (a subreddit's listing under one sort: hot | newest | top | rising; `postedWithin` applies to top only), comments (top comments on up to ten posts, by permalink or bare id), search (posts across Reddit matching a keyword — what Reddit is saying about something; sorts relevance | hot | top | newest | most\_commented), history (stored score / comment-count series of posts already held, free). Ops are independent — issue several as PARALLEL tool calls. Fresh fetches cost credits; anything already held is free.

`POST https://api.zomler.com/api/v1/platforms/reddit`

-   [posts](#posts)
-   [subreddit](#subreddit)
-   [comments](#comments)
-   [search](#search)
-   [history](#history)

## posts

from 25 credits for 10 · fresh for 1 day

One user's recent submissions — score, comment count, upvote ratio and the kind of each post.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subject` (required) | string | — | ≤400 chars |
| `limit` | integer | `10` | 1-50 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/reddit \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "posts",
    "subject": "example"
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/reddit", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "posts",
      "subject": "example"
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/reddit",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "posts",
        "subject": "example"
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## subreddit

from 25 credits for 10

A subreddit's listing under one sort. `postedWithin` applies to `top` only — Reddit ignores it for every other sort.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subject` (required) | string | — | ≤400 chars |
| `sort` | enum | `hot` | `hot`, `newest`, `top`, `rising` |
| `postedWithin` | enum | `7d` | `1h`, `1d`, `7d`, `30d`, `1y`, `any` |
| `limit` | integer | `10` | 1-50 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/reddit \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "subreddit",
    "subject": "example"
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/reddit", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "subreddit",
      "subject": "example"
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/reddit",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "subreddit",
        "subject": "example"
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## comments

from 3 credits for 25 · fresh for 1 day

Top comments on up to ten POSTS, by permalink or bare post id. Commenters are free text — not corpus members.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subjects` (required) | list of string | — | 1-10 items |
| `limit` | integer | `25` | 1-100 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/reddit \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "comments",
    "subjects": [
      "example"
    ]
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/reddit", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "comments",
      "subjects": [
        "example"
      ]
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/reddit",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "comments",
        "subjects": [
          "example"
        ]
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## search

from 25 credits for 10

Posts across all of Reddit matching a keyword — what Reddit is saying about something. `postedWithin` applies to `top` only.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `query` (required) | string | — | ≤300 chars |
| `sort` | enum | `relevance` | `relevance`, `hot`, `top`, `newest`, `most_commented` |
| `postedWithin` | enum | `any` | `1h`, `1d`, `7d`, `30d`, `1y`, `any` |
| `limit` | integer | `10` | 1-50 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/reddit \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "search",
    "query": "example"
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/reddit", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "search",
      "query": "example"
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/reddit",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "search",
        "query": "example"
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## history

free · reads what is held

The stored score / comment-count series of up to ten posts — free, reads only what captures already wrote.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subjects` (required) | list of string | — | 1-10 items |
| `metric` | enum | `score` | `score`, `comments_count` |
| `days` | integer | `90` | 1-730 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/reddit \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "history",
    "subjects": [
      "example"
    ]
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/reddit", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "history",
      "subjects": [
        "example"
      ]
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/reddit",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "history",
        "subjects": [
          "example"
        ]
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

---

Source: https://zomler.com/docs/api/platforms/reddit
