# Get the comments of a Reddit post

Fetches the comments of a Reddit post.

```http
GET https://api.pozy.ai/v1/reddit/comments/{postId}
```

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

## Path parameters

- `postId` (string, required)

## Query parameters

- `accountId` (string, required)
- `sort` (string): one of new, top, best, controversial, old, qa
- `limit` (integer)
- `commentId` (string)

## Example request

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

```ts
const res = await fetch("https://api.pozy.ai/v1/reddit/comments/6108a2cc742cb4e991051e0c?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/comments/6108a2cc742cb4e991051e0c",
    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

- `post`, object
  - one of: Reddit Post
    - `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)
- `items`, array of object
  - `id`, string
  - `fullname`, string
  - `parentId`, string
  - `author`, string
  - `body`, string
  - `permalink`, string
  - `createdUtc`, number
  - `score`, integer
  - `numReplies`, integer
  - `depth`, integer
  - `isSubmitter`, boolean
  - `edited`, boolean
  - `stickied`, boolean
  - `distinguished`, string: Can be null
- `more`, array of string

```json
{
  "post": {
    "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"
    ]
  },
  "items": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "fullname": "Acme",
      "parentId": "6009d4193e17fdf7d162c048",
      "author": "string",
      "body": "string",
      "permalink": "string",
      "createdUtc": 12.5,
      "score": 1,
      "numReplies": 1,
      "depth": 1,
      "isSubmitter": true,
      "edited": true,
      "stickied": true,
      "distinguished": "string"
    }
  ],
  "more": [
    "string"
  ]
}
```
