# Reddit / Reddit Keyword Search

Search public Reddit posts by keyword.

```
GET /api/v1/reddit/search
```

Auth: `Authorization: Bearer <SOCIFY_KEY>`  
Credits: 2 credits per request

## Parameters

| Name | Required | Description | Example |
|------|----------|-------------|---------|
| `name` | yes | Keyword to search. | `bitcoin` |
| `sort` | no | relevance \| hot \| new \| top \| comments. Defaults to relevance. | `relevance` |
| `period` | no | hour \| day \| week \| month \| year \| all. Defaults to week. | `week` |
| `cursor` | no | Pagination cursor from a previous nextCursor. |  |

## Example

```bash
curl -s 'https://trysocify.com/api/v1/reddit/search?name=bitcoin&sort=relevance&period=week' \
  -H "Authorization: Bearer $SOCIFY_KEY"
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `posts[].data.title` | string | Post title. |
| `posts[].data.subreddit` | string | Subreddit name. |
| `posts[].data.author` | string | Author username. |
| `posts[].data.score` | number | Score. |
| `posts[].data.permalink` | string | Permalink (use with Comments). |
| `nextCursor` | string | Pass as cursor for the next page. |
## Sample response

Successful lookups wrap the payload in `{ ok, platform, resource, params, data, meta }`. `data` is shown below.

```json
{
  "ok": true,
  "platform": "reddit",
  "resource": "search",
  "params": {
    "name": "bitcoin",
    "sort": "relevance",
    "period": "week"
  },
  "data": {
    "nextCursor": "t3_abc123",
    "posts": [
      {
        "data": {
          "author": "example_user",
          "permalink": "/r/wallstreetbets/comments/abc123/example/",
          "score": 1200,
          "subreddit": "wallstreetbets",
          "title": "Example bitcoin discussion"
        },
        "kind": "t3"
      }
    ]
  },
  "meta": {
    "credits_charged": 2,
    "latency_ms": 420,
    "platform": "reddit",
    "resource": "search",
    "path": "/api/v1/reddit/search"
  }
}
```

## Links

- HTML docs: https://trysocify.com/docs/api/reddit/search
- SEO page: https://trysocify.com/reddit/search
- OpenAPI: https://trysocify.com/openapi.json
- Catalog: https://trysocify.com/catalog.json
