Naver Cafe
Naver Cafe Posts API
按关键词检索 Naver Cafe 公开帖子,返回正文及附带评论和回复。
接口说明
Naver Cafe Posts API 按关键词检索 Naver Cafe 公开帖子,返回正文及附带评论和回复。
请求URL
请求头
| 参数名 | 参数值 | 类型 | 说明 |
|---|---|---|---|
| Content-Type | application/json | string | 数据格式 |
| Authorization | Bearer xxx | string | 认证凭证 |
采集超时230秒,客户端超时建议至少245秒。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| country | Yes | string | 站点国家码;UK归一为GB。 |
| keyword | Yes | string | 搜索关键词,1–100字符。 最少字符: 1 最多字符: 100 |
| page | No | integer | 从1开始;用响应pagination.nextPage续页。汇总仅page=1。 最小值: 1 最大值: 1020 |
| pageSize | No | integer | 各站点默认值和最大值见站点表;不传则沿用站点默认。 最小值: 1 最大值: 30 |
| includeComments | No | boolean | 默认true,返回帖子附带评论。 |
| commentPage | No | integer | 起始评论页,1–20。 最小值: 1 最大值: 20 |
| commentPageSize | No | integer | 每页20或100条,默认100。 可用值: [20, 100] |
| commentPages | No | integer | 连续采集评论页数,默认1,最多20;从commentPage起。 最小值: 1 最大值: 20 |
| includeNative | No | boolean | 默认true,保留原始平台字段。 |
| refresh | No | boolean | 默认false;true跳过新鲜缓存。 |
| allowStale | No | boolean | 默认false;true允许失败时返回旧缓存,meta会注明。 |
仅支持韩国公开社区帖子。评论起始页1–20,每页20或100条;commentPages 从 commentPage 起连续获取,最多20页。搜索已验证最多遍历34个上游页,该范围并非平台硬上限。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功。 |
| message | string | 响应信息,成功时为 ok。 |
| pointCost | number | 本次完整响应实际消耗的积点。 |
| data | object | null | 返回数据,字段见下表。 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| country | string | 采集站点国家,不代表评论作者的国家。 |
| pagination | object | 分页结果,续页时使用 nextPage。 |
| failures | any[] | 失败条目;需结合 meta.status 判断部分失败。 |
| query | object | 本次生效的检索参数。 |
| warnings | string[] | 采集范围及数据口径提示。 |
| totals | object | 平台报告总量与本次返回数量,口径可能不同。 |
| platform | string | 平台标识。 |
| sourceUrl | string | sourceUrl |
| provider | string | provider |
| meta | object | 采集状态、缓存信息等元数据。 |
| capturedAt | string | 本次数据采集时间。 |
| results | object[] | 本次返回的主体记录数组。 |
| limits | object | 已验证的搜索及评论分页范围。 |
data.pagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| stopReason | string | 停止采集或分页的原因。 |
| nextPage | integer | 下一页页码;null 表示结束。 |
| totalPages | null | 总页数;未知时为 null。 |
| pageSize | integer | 每页记录数。 |
| upstreamPagesFetched | integer | upstreamPagesFetched |
| hasNext | boolean | 是否还有下一页。 |
| page | integer | 本次页码。 |
data.totals 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| discovered | integer | discovered |
| comments | integer | 帖子附带的评论及回复。 |
| replies | integer | replies |
| query | null | 本次生效的检索参数。 |
| reported | null | reported |
| returned | integer | returned |
| selected | integer | selected |
data.meta 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| cache | string | cache |
| stale | boolean | stale |
| ageSeconds | integer | ageSeconds |
| operationId | string | operationId |
| upstreamAttempts | integer | upstreamAttempts |
| coalesced | boolean | coalesced |
| status | string | 采集完成状态。 |
data.results[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| comments | object[] | 帖子附带的评论及回复。 |
| commentPagination | object | 该帖评论分页状态。 |
| author | string | 作者名称。 |
| articleId | string | articleId |
| title | string | 评论或帖子标题,缺失时为 null。 |
| contentHtml | string | 原始 HTML 正文;展示前须清理不可信 HTML。 |
| readCount | integer | readCount |
| content | string | 正文,保留平台原文。 |
| commentCount | integer | commentCount |
| sourceUrl | string | sourceUrl |
| createdAt | string | 发布时间,保留完整时间;不可用时为 null。 |
| cafe | object | 帖子所属社区。 |
| native | object | 平台原始字段;includeNative 控制是否返回。 |
| id | string | 记录唯一标识。 |
data.results[].comments[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| createdAt | null | 发布时间,保留完整时间;不可用时为 null。 |
| deleted | boolean | deleted |
| native | object | 平台原始字段;includeNative 控制是否返回。 |
| author | string | 作者名称。 |
| id | string | 记录唯一标识。 |
| type | string | comment 为评论,reply 为回复。 |
| photos | any[] | 保留图片各尺寸的原始对象。 |
| parentId | null | 所属评论 ID;一级评论为 null。 |
| content | string | 正文,保留平台原文。 |
| updatedAt | string | 更新时间。 |
data.results[].commentPagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| stopReason | string | 停止采集或分页的原因。 |
| lastPage | integer | lastPage |
| nextPage | null | 下一页页码;null 表示结束。 |
| pagesFetched | integer | pagesFetched |
| upstreamHasNext | boolean | upstreamHasNext |
| totalPages | null | 总页数;未知时为 null。 |
| pageSize | integer | 每页记录数。 |
| hasNext | boolean | 是否还有下一页。 |
| page | integer | 本次页码。 |
| status | string | 采集完成状态。 |
data.results[].cafe 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| name | string | name |
| id | string | 记录唯一标识。 |
| slug | string | slug |
| url | string | url |
下一页使用 data.pagination.nextPage,为 null 时结束。Cafe 评论还须检查每帖 commentPagination、failures 和 meta.status;complete 仅表示本次请求完成。
失败保留统一响应外壳及 data.error;参数错误 code=1002、限流4029、暂忙5001、采集失败9200。HTTP 503 冷却响应保留 Retry-After。
请求示例
返回示例
下例截取实际响应首条列表记录,长文本和链接作了缩写;pointCost 为完整响应的实际费用。
积点消耗说明
每条帖子消耗0.8积点,附带评论及回复免费。
每次成功请求独立计费,命中缓存也按返回主体收费;失败及空列表不扣费,以 pointCost 为准。

