内容详情Reddit社区帖子 · 列表
Reddit 社区帖子
按社区与排序读取一页当前公开帖子。
POST
/v1/reddit/subreddits/posts英文名称: Reddit community posts · Subreddit Post · List Read one current public page of posts for a subreddit and explicit sort.reddit.subreddits.posts@v1
在线试用
这个接口即将上线
我们正在做上线前的检查。上线后可以在这里直接试用,并按上方价格计费;在此之前不会产生任何费用。你可以先阅读参数和返回示例。
登录后用真实参数调用一次,结果和扣费会显示在这里。
安全验证
正在加载安全验证…
正在确认实时执行状态…
执行结果
// Result
请求参数
subredditstring必填pattern: "^(?:r\\/)?[a-z0-9_]{2,21}$"
示例:
"OpenAI"sortstring可选enum: "BEST" | "HOT" | "NEW" | "TOP" | "CONTROVERSIAL" | "RISING"
示例:
"HOT"cursorstring可选minLength: 1
请求 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"subreddit": {
"type": "string",
"pattern": "^(?:r\\/)?[a-z0-9_]{2,21}$"
},
"sort": {
"type": "string",
"enum": [
"BEST",
"HOT",
"NEW",
"TOP",
"CONTROVERSIAL",
"RISING"
]
},
"cursor": {
"type": "string",
"minLength": 1
}
},
"required": [
"subreddit"
],
"additionalProperties": false
}代码示例
安装 SDK:npm i @dataxapi/sdk 或 pip install dataxapi;把 API Key 放进环境变量 DATAXAPI_API_KEY。
curl -X POST https://api.dataxapi.com/v1/reddit/subreddits/posts \
-H "Authorization: Bearer $DATAXAPI_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"subreddit":"OpenAI","sort":"HOT"}'import { ExactApiClient } from "@dataxapi/sdk";
const client = new ExactApiClient({
baseUrl: "https://api.dataxapi.com",
apiKey: process.env.DATAXAPI_API_KEY,
});
const result = await client.call("reddit_subreddits_posts_v1", {
"subreddit": "OpenAI",
"sort": "HOT"
});
console.log(result.data);import os
from dataxapi import ExactApiClient
client = ExactApiClient("https://api.dataxapi.com", os.environ["DATAXAPI_API_KEY"])
result = client.call("reddit_subreddits_posts_v1", {
"subreddit": "OpenAI",
"sort": "HOT",
})
print(result["data"])[mcp_servers.dataxapi]
url = "https://api.dataxapi.com/mcp"
bearer_token_env_var = "DATAXAPI_API_KEY"返回示例
200 · application/json
{
"code": 200,
"request_id": "req_example_reddit_public_expansion",
"message": "success",
"data": {
"items": [
{
"id": "t3_fixturepost1",
"title": "Public Reddit fixture title",
"body": "Public Reddit fixture body",
"created_at": "2026-08-01T12:00:00Z",
"author": {
"id": "t2_fixtureuser",
"name": "fixture_user"
},
"subreddit": {
"id": "t5_openai",
"name": "OpenAI",
"title": "OpenAI"
},
"metrics": {
"score": 42,
"comment_count": 7,
"upvote_ratio": 0.95,
"share_count": 2
},
"flair": null,
"post_hint": "self",
"domain": "self.OpenAI",
"url": "https://www.reddit.com/r/OpenAI/comments/fixturepost1/example/",
"permalink": "/r/OpenAI/comments/fixturepost1/example/",
"reddit_url": "https://www.reddit.com/r/OpenAI/comments/fixturepost1/example/",
"is_nsfw": false,
"is_removed": false,
"is_score_hidden": false
}
]
},
"page": {
"next_cursor": "cursor_example"
},
"warnings": [],
"meta": {
"listing_id": "reddit.subreddits.posts",
"version": "v1",
"catalog_release_id": "catalog-production-2026-09-19.b069be57",
"price_book_version": "pricebook-production-2026-09-19.4487e352",
"result_status": "complete",
"charged_amount": "0.02",
"balance_after": "49.70",
"currency": "CNY"
}
}返回字段说明
codenumber- const: 200
request_idstringmessagestring- const: "success"
dataobjectpageobjectwarningsarraymetaobject
返回 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"code": {
"type": "number",
"const": 200
},
"request_id": {
"type": "string"
},
"message": {
"type": "string",
"const": "success"
},
"data": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"body": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"author": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"name"
],
"additionalProperties": false
},
"subreddit": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"name",
"title"
],
"additionalProperties": false
},
"metrics": {
"type": "object",
"properties": {
"score": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"comment_count": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"upvote_ratio": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 1
},
{
"type": "null"
}
]
},
"share_count": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"score",
"comment_count",
"upvote_ratio",
"share_count"
],
"additionalProperties": false
},
"flair": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"post_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"domain": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"permalink": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"reddit_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"is_nsfw": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"is_removed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"is_score_hidden": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"title",
"body",
"created_at",
"author",
"subreddit",
"metrics",
"flair",
"post_hint",
"domain",
"url",
"permalink",
"reddit_url",
"is_nsfw",
"is_removed",
"is_score_hidden"
],
"additionalProperties": false
}
}
},
"required": [
"items"
],
"additionalProperties": false
},
"page": {
"type": "object",
"properties": {
"next_cursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"next_cursor"
],
"additionalProperties": false
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"meta": {
"type": "object",
"properties": {
"listing_id": {
"type": "string",
"const": "reddit.subreddits.posts"
},
"version": {
"type": "string",
"const": "v1"
},
"catalog_release_id": {
"type": "string",
"minLength": 1
},
"price_book_version": {
"type": "string",
"minLength": 1
},
"result_status": {
"type": "string",
"enum": [
"complete",
"empty",
"partial"
]
},
"charged_amount": {
"type": "string"
},
"balance_after": {
"type": "string"
},
"currency": {
"type": "string",
"const": "CNY"
}
},
"required": [
"listing_id",
"version",
"catalog_release_id",
"price_book_version",
"result_status",
"charged_amount",
"balance_after",
"currency"
],
"additionalProperties": false
}
},
"required": [
"code",
"request_id",
"message",
"data",
"page",
"warnings",
"meta"
],
"additionalProperties": false
}使用说明
适合
- 需要按 HOT、NEW、TOP 等明确排序浏览一个社区的公开帖子。
不适合
- 不用于用户个性化 Feed、全量历史归档或把一页结果当成社区总体观点。
已知限制
- 排序语义由 Reddit 当前公开表面决定,不承诺穷尽或稳定排名。
- 推广内容会被剔除并返回 warning,不混入自然帖子结果。
- 只有 DataXAPI 返回的签名 Cursor 可以继续同一社区与排序。
计费规则
¥0.02 / 次。完整或确认空结果收费;部分结果和失败不收费。
查看全部价格 →