> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit 검색, 게시물, 댓글 API (REDDIT)

> Reddit 게시물을 검색하거나, 게시물 하나를 댓글 첫 페이지와 함께 읽거나, 서브레딧이나 사용자의 최신 게시물을 나열합니다.

`REDDIT`은 공개된 Reddit을 읽습니다. payload에 따라 네 가지 모드가 있습니다: 검색(`query`), 게시물과 댓글(`url`), 서브레딧 피드(`action: "feed"`), 사용자 게시물(`action: "user_posts"`).

| | |
| - | - |
| `taskType` | `REDDIT` |
| 입력 | `query`, `url`, `action`(`feed`, `user_posts`) 중 하나와 `subreddit`, `username`, `commentSort`, `commentMaxDepth`, `limit`, `country` |
| 크레딧 | 태스크당 1 |
| 국가 | 기본값 `US`. |
| 위치 | 지원하지 않습니다(`422 LOCATION_UNSUPPORTED`). |

## 게시물 검색

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "REDDIT", "payload": { "query": "running shoes for flat feet", "subreddit": "RunningShoeGeeks" } }'
```

| 필드 | 필수 | 설명 |
| - | - | - |
| `query` | 예 | 검색어. `query`가 없으면 `prompt`를 받습니다. |
| `subreddit` | 아니요 | 한 서브레딧만 검색합니다. `r/` 없는 이름으로, 영문자, 숫자, 밑줄 2\~21자입니다. |

검색은 게시물을 최대 25개 반환합니다. 예:

```json theme={"theme":"css-variables"}
{
  "results": [
    { "postId": "1uzk9m4", "title": "...", "url": "https://www.reddit.com/r/RunningShoeGeeks/comments/1uzk9m4/...", "subreddit": "RunningShoeGeeks", "preview": "..." }
  ]
}
```

`preview`는 게시물에 텍스트가 있을 때 그 앞부분으로, 최대 2,000자입니다. 완료된 태스크의 `results`가 비어 있으면 Reddit에서 찾은 것이 없다는 뜻입니다.

## 게시물과 댓글 읽기

`query` 대신 게시물 `url`을 보내세요.

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "REDDIT", "payload": { "url": "https://www.reddit.com/r/RunningShoeGeeks/comments/1uer62n/", "commentSort": "top", "commentMaxDepth": 1 } }'
```

| 필드 | 필수 | 설명 |
| - | - | - |
| `url` | 예 | reddit.com 게시물 주소: `https://www.reddit.com/r/{subreddit}/comments/{postId}/...`. 다른 주소는 `422 VALIDATION_ERROR`를 반환합니다. |
| `commentSort` | 아니요 | `top`, `new`, `controversial`, `old`, `qa` 중 하나. 없으면 Reddit의 기본 정렬을 따릅니다. |
| `commentMaxDepth` | 아니요 | 이보다 깊은 답글을 뺍니다. 0\~100의 정수이며, `0`이면 최상위 댓글만 남깁니다. |

태스크는 게시물과 댓글 첫 페이지(약 20\~25개)를 읽습니다. 예:

```json theme={"theme":"css-variables"}
{
  "post": {
    "postId": "1uer62n", "title": "...", "body": "...", "author": "...", "subreddit": "RunningShoeGeeks",
    "score": 12, "upvoteRatio": 0.9, "commentCount": 48, "createdAt": "2026-06-24T21:51:21.586000+0000",
    "archived": false, "url": "https://www.reddit.com/r/RunningShoeGeeks/comments/1uer62n/..."
  },
  "comments": {
    "availableCount": 24,
    "returnedCount": 24,
    "items": [
      { "commentId": "otlz8m5", "author": "...", "body": "...", "score": 5, "depth": 0, "isSubmitter": false, "createdAt": "...", "url": "https://www.reddit.com/r/..." }
    ]
  }
}
```

| 필드 | 설명 |
| - | - |
| `post.commentCount` | Reddit이 알려 주는 게시물의 댓글 수. Reddit이 빠뜨리면 실제로 읽은 페이지의 댓글 수입니다. `comments`에는 그 페이지만 담깁니다. |
| `post.archived` | 게시물 나이로 추정합니다. Reddit은 약 180일 뒤 댓글을 잠급니다. |
| `post.author`, `post.body` | Reddit이 보여주지 않으면(삭제된 작성자, 링크 게시물) `null`입니다. |
| `comments.items[].depth` | 답글 깊이. `0`은 최상위 댓글입니다. 답글에는 `parentId`가 붙습니다. |
| `comments.items[].isSubmitter` | 게시물 작성자가 쓴 댓글이면 `true`. |

> [!NOTE]
>
> 댓글은 첫 페이지만 받을 수 있습니다. 댓글을 더 펼치는 `commentLimit`은 셀프서브 요금제에서 `422 VALIDATION_ERROR`를 반환합니다.

## 최신 게시물 나열

| Payload | 반환 |
| - | - |
| `{ "action": "feed", "subreddit": "RunningShoeGeeks" }` | 서브레딧의 최신 게시물. `subreddit`이 없으면 r/popular. |
| `{ "action": "user_posts", "username": "example_user" }` | 그 사용자가 올린 게시물. `username`은 영문자, 숫자, 밑줄, 하이픈 3\~20자입니다. |

둘 다 검색과 같은 형태의 `results`를 `limit`(기본 25)개까지 반환합니다.

## 제한과 오류

* `REDDIT`은 `markdown`, `rawResponse`, `searchQueries`를 무시합니다. `html`과 `analysis`는 `422`로, `citationAnalysis`는 `400`으로 거절합니다. [지원하지 않는 플래그](/ko/engines/response-options.md#지원하지-않는-플래그)를 참고하세요.
* 잘못된 `subreddit`, `username`, `url`, `commentSort`는 `422 VALIDATION_ERROR`를 반환합니다.
* 그 밖의 요청 오류는 [오류](/ko/concepts/errors.md)에 정리되어 있습니다.

## 관련 문서

* Reddit 밖의 페이지를 읽는 [웹 스크레이프](/ko/engines/web-scrape.md)
* [비동기 태스크](/ko/concepts/async-tasks.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.