# Get subreddit feed

Fetches a subreddit feed.

```http
GET https://api.pozy.ai/v1/reddit/feed
```

- Area: Inbox / Reddit Search
- Auth: Authorization: Bearer pz_live_...

## Query parameters

- `accountId` (string, required)
- `subreddit` (string)
- `sort` (string): one of hot, new, top, rising
- `limit` (integer)
- `after` (string)
- `t` (string): one of hour, day, week, month, year, all

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/reddit/feed?accountId=696e0b682d0a31188e7a2ba9&limit=25" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/reddit/feed?accountId=696e0b682d0a31188e7a2ba9&limit=25", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/reddit/feed",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "limit": 25,
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `items`, array of object
  - `id`, string
  - `fullname`, string
  - `title`, string
  - `author`, string
  - `subreddit`, string
  - `url`, string
  - `permalink`, string
  - `selftext`, string
  - `createdUtc`, number
  - `score`, integer
  - `numComments`, integer
  - `over18`, boolean
  - `stickied`, boolean
  - `flairText`, string: Can be null
  - `isGallery`, boolean
  - `galleryImages`, array of string (URL)
- `after`, string: Can be null
- `before`, string: Can be null

```json
{
  "items": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "fullname": "Acme",
      "title": "Launch day",
      "author": "string",
      "subreddit": "string",
      "url": "https://pozy.ai/media/example-1.jpg",
      "permalink": "string",
      "selftext": "Hello from Pozy",
      "createdUtc": 12.5,
      "score": 1,
      "numComments": 1,
      "over18": true,
      "stickied": true,
      "flairText": "Hello from Pozy",
      "isGallery": true,
      "galleryImages": [
        "https://pozy.ai/media/example-1.jpg"
      ]
    }
  ],
  "after": "string",
  "before": "string"
}
```
