按代币符号获取新闻#
获取按一个或多个代币符号过滤的新闻列表。
请求路径#
GET
https://web3.okx200.com/api/v6/dex/market/social/news/by-symbol请求参数#
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| tokenSymbols | string | 是 | 代币符号列表,如 BTC,ETH,SOL。不区分大小写。支持传入多个,多个使用逗号分隔,最多支持 20 个。 |
| sortBy | string | 否 | 排序方式:1=latest(发布时间倒序)、2=hot(热度降序)。默认 1。 |
| sentiment | string | 否 | SocialSentimentEnum 枚举码,按情绪倾向筛选:1=bullish(看多)、2=bearish(看空)、3=neutral(中性)。省略则返回所有情绪。 |
| importance | string | 否 | SocialImportanceEnum 枚举码,按文章重要程度筛选:1=high(高重要性)、2=medium(中等)、3=low(低重要性)。省略则返回所有重要级别。 |
| platform | string | 否 | 新闻来源域名,如 coindesk.com。可通过 GET /social/news/platforms 获取全量列表。省略则返回所有来源的数据。 |
| limit | string | 否 | 每页返回条数,范围 [1, 50],默认 10。 |
| cursor | string | 否 | 翻页游标。首次请求不传;后续请求传入上一次响应中的 cursor 以获取下一页。cursor 为 null 时表示已无更多数据。 |
| detailLevel | string | 否 | 响应详情级别:1=summary(仅返回标题 + 摘要,content 字段为空);2=full(同时返回完整正文 content 字段)。默认 1。 |
| begin | string | 否 | 查询起始时间戳(毫秒)。默认为当前时间 - 72 小时;最大可回溯 180 天。 |
| end | string | 否 | 查询结束时间戳(毫秒)。默认为当前时间(now)。 |
| language | string | 否 | 响应语言,BCP-47 格式,如 en_US、zh_CN。默认 en_US。 |
返回参数#
| 字段 | 类型 | 描述 |
|---|---|---|
| cursor | string | 下一页游标;为 null 时表示已无更多数据 |
| articles | array | 新闻文章列表 |
| > id | string | 文章唯一 ID,可作为 GET /social/news/detail 接口的 articleId 参数查询完整正文 |
| > title | string | 文章标题 |
| > summary | string | 文章摘要 |
| > content | string | 文章完整正文,仅在 detailLevel=2 时返回 |
| > sourceUrl | string | 文章原文链接 |
| > source | string | 新闻来源的第一个平台域名,如 coindesk.com |
| > timestamp | string | 文章发布时间,Unix 毫秒时间戳 |
| > tokenSymbols | array | 文章中提及的代币符号列表 |
| > importance | string | 文章重要程度:high(高)、medium(中)、low(低) |
| > tokenSymbolSentiments | array | 本文中各代币的情绪分析列表 |
| >> sentiment | string | 情绪标签:bullish(看多)/ bearish(看空)/ neutral(中性) |
| >> tokenSymbol | string | 代币符号 |
请求示例#
shell
curl --location --request GET 'https://web3.okx200.com/api/v6/dex/market/social/news/by-symbol?tokenSymbols=BTC,ETH&sortBy=1&limit=10&detailLevel=1&language=zh_CN' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
返回示例#
json
{
"code": "0",
"msg": "",
"data": {
"cursor": "eyJsYXN0SWQiOiIxNzM4MDAwMDAwMDAyIn0",
"articles": [
{
"id": "NEWS_20241018_010",
"title": "比特币 ETF 单日净流入创纪录达 8 亿美元",
"summary": "现货比特币 ETF 自上市以来录得最高单日净流入,显示机构投资兴趣重燃。",
"content": "",
"sourceUrl": "https://coindesk.com/markets/2024/10/18/bitcoin-etf-record-inflows",
"source": "coindesk.com",
"timestamp": "1697630800000",
"tokenSymbols": ["BTC"],
"importance": "high",
"tokenSymbolSentiments": [
{
"tokenSymbol": "BTC",
"sentiment": "bullish"
}
]
},
{
"id": "NEWS_20241018_011",
"title": "以太坊 Layer 2 交易量创历史新高",
"summary": "以太坊 Layer 2 网络合并交易量突破历史纪录,凸显扩容解决方案的持续增长。",
"content": "",
"sourceUrl": "https://theblock.co/post/ethereum-l2-record",
"source": "theblock.co",
"timestamp": "1697625000000",
"tokenSymbols": ["ETH"],
"importance": "medium",
"tokenSymbolSentiments": [
{
"tokenSymbol": "ETH",
"sentiment": "bullish"
}
]
}
]
}
}