原始 Webhooks
原始 Webhooks 是标准(丰富型)webhook 的一种轻量、快速投递的替代方案。它们在文章发布的那一刻就投递核心文章数据,完全跳过 AI 增强处理管道。
与丰富型 Webhooks 的主要区别:
- 投递更快 —— 文章在被采集后立即推送,无需等待情绪分析、实体解析或公司匹配。
- 简化的过滤器 —— 仅支持
query、sources、excludeSources、language和includeUpdates。不支持tickers、countries、categories、includeContent、includeEntities和excludeEmptyContent。 - 无 AI 增强 —— 负载中不包含
sentiment、confidence或companies数据。 - 查询字段级过滤 ——
query参数仅对source、title和summary支持字段级语法。 - 类型不可变 —— 投递类型(
raw或enriched)在创建时设定,之后无法更改。
文章模型
原始 Webhooks 投递一个简化的文章负载。不包含任何公司实体、情绪分数或 AI 生成的增强信息。
- Name
link- Type
- string
- Description
指向完整文章的 URL。
- Name
source- Type
- string
- Description
来源网站。例如
www.reuters.com
- Name
title- Type
- string
- Description
文章标题。
- Name
summary- Type
- string
- Description
文章摘要(如果有)。可为空。
- Name
publishDate- Type
- Date
- Description
发布日期,采用 ISO 8601 日期字符串格式。
- Name
createdAt- Type
- Date
- Description
文章在 finlight 系统中的内部创建日期,采用 ISO 8601 日期字符串格式。
- Name
revisedDate- Type
- Date | null
- Description
文章在首次发布后最后一次修订的日期。当文章从未修订时为
null。当启用includeUpdates且文章已被修订时存在。
- Name
isUpdate- Type
- boolean
- Description
当本次投递由发布后更新触发时为
true。仅在启用includeUpdates时存在。
- Name
language- Type
- string
- Description
ISO 639-1 语言代码。例如
en|de|fr
- Name
images- Type
- string[]
- Description
文章中的图片 URL 数组。
- Name
countries- Type
- string[]
- Description
ISO 3166-1 alpha-2 格式的国家/地区代码数组。例如
["US", "GB"]。可为空。
- Name
categories- Type
- string[]
- Description
文章类别数组。可能的值:
markets|economy|business|politics|geopolitics|regulation|technology|energy|commodities|crypto|health|climate|security。可为空。
创建原始 Webhook
在 finlight 控制台中创建 webhook 时,在设置向导的第一步选择 Raw 作为投递类型。随后的条件步骤将仅显示四个受支持的过滤参数。
原始 Webhooks 仅投递符合您条件的新发布文章。每次投递都是作为 HTTP POST 请求发送到您端点的单篇文章负载。
- Name
query- Type
- string
- Description
用于查找相关文章的搜索查询。对
source、title和summary字段支持字段级过滤。参见下方的查询字段级过滤。
- Name
sources- Type
- string[]
- Description
将投递限制为来自特定来源的文章。例如
["www.reuters.com", "www.cnbc.com"]。有效值请参见 sources 端点。
- Name
excludeSources- Type
- string[]
- Description
排除来自特定来源的文章。例如
["www.example.com"]。
- Name
includeUpdates- Type
- boolean
- Description
当文章在首次发布后被更新时重新投递。更新后的负载包含
isUpdate=true和revisedDate时间戳。
Response
{
"link": "https://www.example.com/article1",
"source": "www.example.com",
"title": "Stock Market Hits New Highs",
"summary": "A brief summary of the article...",
"publishDate": "2023-10-01T12:34:56Z",
"createdAt": "2023-10-01T12:35:10Z",
"language": "en",
"images": [
"https://www.example.com/image1.jpg",
"https://www.example.com/image2.jpg"
],
"countries": ["US"],
"categories": ["markets"]
}
Response (includeUpdates: true)
{
"link": "https://www.example.com/article1",
"source": "www.example.com",
"title": "Stock Market Hits New Highs — Updated",
"summary": "An updated summary of the article...",
"publishDate": "2023-10-01T12:34:56Z",
"createdAt": "2023-10-01T12:35:10Z",
"revisedDate": "2023-10-02T08:00:00Z",
"isUpdate": true,
"language": "en",
"images": [
"https://www.example.com/image1.jpg"
],
"countries": ["US"],
"categories": ["markets"]
}
查询字段级过滤
原始 Webhooks 的 query 参数支持仅限于以下字段的字段级过滤:
source—— 按文章来源域名过滤title—— 按文章标题中的内容过滤summary—— 按文章摘要中的内容过滤
示例:
query=title:Nvidia
投递标题中包含 “Nvidia” 的文章。
query=summary:earnings +title:Tesla
投递摘要中提到 “earnings” 且标题中包含 “Tesla” 的文章。
query=source:www.reuters.com -crypto
投递来自 Reuters 的文章,排除提到 “crypto” 的文章。
完整的查询语法参考请参见高级查询构建指南。
何时使用原始 Webhooks
在以下情况选择 Raw:
- 需要尽可能低的投递延迟
- 正在构建不需要增强数据的高吞吐量管道
- 仅需按关键字、来源或语言过滤
- 希望使用更精简的负载以减少您端的处理开销
在以下情况选择 Enriched:
- 需要公司/股票代码级别的过滤(
tickers、countries、categories) - 希望负载中包含情绪分数、置信度值或实体解析
- 需要通过
includeContent/includeEntities包含完整文章内容或提取的实体 - 正在构建股票监控、财报跟踪或特定行业的新闻源
有关丰富型 webhook 过滤选项的完整详情,请参见过滤条件指南。