跳到主要内容
Reddit

reddit.posts.search@v1

Reddit Post 搜索

帖子搜索

按关键词、排序和时间范围分页搜索当前公开 Reddit 帖子。

POST/v1/reddit/posts/search

英文名称: Reddit post search · Post · Search
Search one cursor-paginated page of currently public Reddit posts by query, sort, and time range.

术语: Post帖子

适合什么任务

  • 需要把一页关键词搜索结果接入 AI 或固定工作流。

不适合什么任务

  • 不用于评论、社区、媒体或用户搜索,也不代表全站规模。

请求参数

字段query类型string约束与默认值minLength: 1 · maxLength: 512必填性必填
字段sort类型string约束与默认值enum: "RELEVANCE" | "HOT" | "TOP" | "NEW" | "COMMENTS"必填性选填
字段time_range类型string约束与默认值enum: "all" | "year" | "month" | "week" | "day" | "hour"必填性选填
字段cursor类型string约束与默认值minLength: 1必填性选填
完整请求 JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "sort": {
      "type": "string",
      "enum": [
        "RELEVANCE",
        "HOT",
        "TOP",
        "NEW",
        "COMMENTS"
      ]
    },
    "time_range": {
      "type": "string",
      "enum": [
        "all",
        "year",
        "month",
        "week",
        "day",
        "hour"
      ]
    },
    "cursor": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}

静态响应样例

application/json
{
  "code": 200,
  "request_id": "req_example_reddit_search",
  "message": "success",
  "data": {
    "items": [
      {
        "id": "t3_search_fixture",
        "title": "Public search fixture",
        "body": "Fixture body",
        "created_at": "2026-08-26T00:00:00Z",
        "author": {
          "id": "t2_fixture",
          "name": "fixture"
        },
        "subreddit": {
          "id": "t5_fixture",
          "name": "OpenAI",
          "title": "OpenAI"
        },
        "metrics": {
          "score": 10,
          "comment_count": 2,
          "upvote_ratio": 0.9
        },
        "permalink": "/r/OpenAI/comments/search_fixture/example/",
        "reddit_url": "https://www.reddit.com/r/OpenAI/comments/search_fixture/example/",
        "is_nsfw": false
      }
    ]
  },
  "page": {
    "next_cursor": "opaque_cursor_example"
  },
  "warnings": [],
  "meta": {
    "result_status": "complete",
    "balance_after": "0.98",
    "listing_id": "reddit.posts.search",
    "version": "v1",
    "catalog_release_id": "catalog-production-2026-09-17.1",
    "price_book_version": "pricebook-production-2026-09-17.1",
    "charged_amount": "0.02",
    "currency": "CNY"
  }
}

实时运行

完整结果和空结果按 ¥0.02 收费,部分结果和失败不收费。

安全验证

正在加载安全验证…

正在确认实时执行状态…

执行结果

// Result

响应 Contract

字段摘要用于快速浏览;完整 JSON Schema 是稳定输出 Contract。

字段code类型number约束与默认值const: 200必填性必填
字段request_id类型string约束与默认值无额外约束必填性必填
字段message类型string约束与默认值const: "success"必填性必填
字段data类型object约束与默认值无额外约束必填性必填
字段page类型object约束与默认值无额外约束必填性必填
字段warnings类型array约束与默认值无额外约束必填性必填
字段meta类型object约束与默认值无额外约束必填性必填
完整响应 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"
                      }
                    ]
                  }
                },
                "required": [
                  "score",
                  "comment_count",
                  "upvote_ratio"
                ],
                "additionalProperties": false
              },
              "permalink": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reddit_url": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_nsfw": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "title",
              "body",
              "created_at",
              "author",
              "subreddit",
              "metrics",
              "permalink",
              "reddit_url",
              "is_nsfw"
            ],
            "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.posts.search"
        },
        "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
}

已知限制

  • 结果是当前检索页,不代表 Reddit 全站讨论量或代表性样本。
  • 单页返回量和排序由 Reddit 当前搜索结果决定;最近两页实测各返回 7 条。
  • Reddit 在后一页重复返回的帖子会被省略并附带 duplicate_results_omitted 警告,不会重复收费。

接入示例

REST(cURL)

curl -X POST https://api.dataxapi.com/v1/reddit/posts/search \
  -H "Authorization: Bearer $DATAXAPI_API_KEY" \
  -H "Idempotency-Key: your-stable-intent-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"OpenAI","sort":"RELEVANCE","time_range":"month"}'

Exact MCP Preview(Codex 配置)

[mcp_servers.dataxapi]
url = "https://api.dataxapi.com/mcp"
bearer_token_env_var = "DATAXAPI_API_KEY"

同一个 API Key 只会暴露其 Scope 内的精确 Tool。请把 Key 放在环境变量中,不要写入配置文件。需要安全重试时,请显式复用 idempotency_key。

查看客户端兼容状态 →

目录发布物: catalog-production-2026-09-17.1 · PriceBook: pricebook-production-2026-09-17.1