POST
/
v1
/
search
/
chunks
curl --request POST \
  --url https://api.reportify.cn/v1/search/chunks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>",
  "folder_ids": [],
  "doc_ids": [],
  "categories": [
    "filings",
    "transcripts",
    "reports",
    "news",
    "announcements",
    "social_media"
  ],
  "markets": [],
  "institutions": [],
  "symbols": [],
  "tags": {},
  "start_date": "<string>",
  "end_date": "<string>",
  "min_score": 123,
  "extended_filters": [
    {}
  ],
  "num": 10,
  "include_doc_extra_details": false,
  "refine_question": false,
  "date_range": "h"
}'
{
  "chunks": []
}

文档块搜索

URL: /v1/search/chunks
方法: POST
描述: 根据指定条件进行语义搜索文档内容块,通常用于 RAG 场景,支持按文档内容或相关字段搜索。

请求参数

参数名类型描述
querystr搜索关键词。
doc_idsarray[str]指定的文档 ID 列表,如 ["1046915273103380480", "1046522679340961792"]
folder_idsarray[str]指定的文件夹 ID 列表,如 ["2046915273103380480", "2046522679340961792"]
categoriesarray文档类别(默认不包含 files),可选值有 financialstranscriptsreportsfilingsnews, socialsfiles
institutionsarray指定机构筛选,如 Morgan StanleySeeking Alpha暂未支持
marketsarray市场区域,默认包括所有市场。可选值有 sz, sh, hk, us
symbolsarray股票代码筛选,如 SH:000001HK:00700US:AAPL
tagsdict标签数组。
  keystr标签类型(如 industry, company, person, event)。
  valuearray标签内容数组。
start_datestr开始日期,格式为 YYYY-MM-DD
end_datestr结束日期,格式为 YYYY-MM-DD
numint返回的结果数量,默认值为 10
include_doc_extra_detailboolean是否包含文档详细信息,默认值为 false(只返回文档 idtitleurl 字段)。

说明:

  • 当 categories 为 files 时,可以通过指定 tags 参数来筛选上传的文件(上传时制定了相应的 tags)。

响应参数

参数名类型描述
chunksarray内容块数组,每个块包含以下字段:
idstr内容块唯一 ID。
typestr内容类型,可能的值为 texttableimageformula
media_urlstr内容块的媒体文件链接(如果类型为 tableimageformula 时提供图片链接)。
contentstr内容原始文本(适用于 texttable 类型)。
summarystr解析内容,适用于 tableimageformula 类型。
docdict文档信息(当 include_doc_extra_detailtrue 时包含以下字段):
  idstr文档唯一 ID。
  titlestr文档标题。
  urlstr文档网页链接。
  institutionstr发布机构。
  authorstr作者。
  published_atstr发布时间,格式为 YYYY-MM-DDTHH:MM:SS.000Z
  categorystr文档类别(financials, transcripts, reports, filings, news, socials, files)。
  marketstr市场区域(cn, hk, us)。
  symbolstr股票代码。
  company_namestr公司名称。
  logostr公司 Logo 链接。
  summarystr文档摘要。
  tagsdict标签字典,包含以下字段:
    keystr标签类型(如 industrycompanypersonevent)。
    valuearray标签内容数组。
  metadatasdict元数据字典,包含以下字段:
    keystr元数据类型(如 periodsentities)。
    valuearray元数据内容数组。

请求示例

cURL

curl -X POST https://api.reportify.cn/v1/search/rag \
-H "Authorization: Bearer 447460****09c9" \
-H "Content-Type: application/json" \
-d '{
    "query": "AI in finance",
    "doc_ids": ["1046915273103380480", "1046522679340961792"],
    "categories": ["financials", "reports"],
    "markets": ["us"],
    "institutions": ["Morgan Stanley"],
    "symbols": ["AAPL"],
    "start_date": "2023-01-01",
    "end_date": "2023-12-31",
    "num": 5,
    "include_doc_extra_detail": true
}'

Python 示例

import requests

url = "https://api.reportify.cn/v1/search/rag"
headers = {
    "Authorization": "Bearer 447460****09c9",
    "Content-Type": "application/json"
}
payload = {
    "query": "AI in finance",
    "doc_ids": ["1046915273103380480", "1046522679340961792"],
    "categories": ["financials", "reports"],
    "markets": ["us"],
    "institutions": ["Morgan Stanley"],
    "symbols": ["AAPL"],
    "start_date": "2023-01-01",
    "end_date": "2023-12-31",
    "num": 5,
    "include_doc_extra_detail": True
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())

响应示例

{
  "chunks": [
    {
      "id": "448902339012",
      "type": "text",
      "media_url": "",
      "content": "AI in finance is transforming the industry...",
      "summary": "",
      "doc": {
        "id": "1046915273103380480",
        "title": "AI in Finance Report",
        "url": "https://reportify.cn/financials/1046895208953942016",
        "file_url": "https://files.reportify.cn/media/production/TSLA5a08ddfbb97bd6486fff7a3875e7fe28_20241024183012.pdf",
        "media_url": "https://files.reportify.cn/media/production/s_4728833_9e25b61b62960211e6040eb2b81b352c.mp3",
        "institution": "Morgan Stanley",
        "author": "Jane Doe",
        "published_at": "2023-12-31T00:00:00.000Z",
        "category": "reports",
        "type": "research_report_company",
        "market": "us",
        "symbol": "AAPL",
        "company_name": "Apple Inc.",
        "logo": "https://files.reportify.cn/logo/AAPL.svg",
        "summary": "This report provides an overview of AI applications in finance...",
        "tags": {
          "industry": [
            "AI",
            "EV"
          ],
          "company": [
            "Tesla"
          ]
        },
        "metadatas": {
          "periods": "Q4 2023",
          "entities": [
            "Tesla Inc.",
            "TSLA"
          ]
        }
      }
    },
    {
      "id": "448902339013",
      "type": "table",
      "media_url": "https://files.reportify.cn/media/production/447460783945158/520072899438150/605401659404358/element/4.jpg",
      "content": "",
      "summary": "Financial data for AI companies in 2023",
      "doc": {
        "id": "1046915273103380480",
        "title": "AI in Finance Report",
        "url": "https://reportify.cn/financials/1046895208953942016",
        "file_url": "https://files.reportify.cn/media/production/TSLA5a08ddfbb97bd6486fff7a3875e7fe28_20241024183012.pdf",
        "media_url": "https://files.reportify.cn/media/production/s_4728833_9e25b61b62960211e6040eb2b81b352c.mp3",
        "institution": "Morgan Stanley",
        "author": "Jane Doe",
        "published_at": "2023-12-31T00:00:00.000Z",
        "category": "reports",
        "type": "research_report_company",
        "market": "us",
        "symbol": "AAPL",
        "company_name": "Apple Inc.",
        "logo": "https://files.reportify.cn/logo/AAPL.svg",
        "summary": "This report provides an overview of AI applications in finance...",
        "tags": {
          "industry": [
            "AI",
            "EV"
          ],
          "company": [
            "Tesla"
          ]
        },
        "metadatas": {
          "periods": "Q4 2023",
          "entities": [
            "Tesla Inc.",
            "TSLA"
          ]
        }
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

200
application/json

Successful Response

The response is of type object.