获取最新新闻列表#
获取加密货币最新新闻列表。接口内部固定 sortBy=latest;importance 无默认值——省略该参数则不过滤重要程度。
请求路径#
GET
https://web3.okx.com/api/v6/dex/market/social/news/latest请求参数#
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| tokenSymbols | string | 否 | 代币符号列表,如 BTC,ETH,SOL。不区分大小写。省略则返回所有代币的数据。支持传入多个,多个使用逗号分隔,最多支持 20 个。 |
| begin | string | 否 | 查询起始时间戳(毫秒)。默认为当前时间 - 72 小时;最大可回溯 180 天。 |
| end | string | 否 | 查询结束时间戳(毫秒)。默认为当前时间(now)。 |
| 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。建议列表场景用 1,详情场景用 2 以减少流量。 |
| language | string | 否 | 响应语言,BCP-47 格式,如 en_US、zh_CN。默认 en_US。具体支持范围由上游 Orbit 决定。 |
返回参数#
| 字段 | 类型 | 描述 |
|---|---|---|
| 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.okx.com/api/v6/dex/market/social/news/latest?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": "eyJsYXN0SWQiOiIxNzM4MDAwMDAwMDAxIn0",
"articles": [
{
"id": "NEWS_20241018_001",
"title": "比特币突破 7 万美元,机构需求强劲",
"summary": "比特币本月首次突破 7 万美元大关,受到强劲机构买入和 ETF 净流入的推动。",
"content": "",
"sourceUrl": "https://coindesk.com/markets/2024/10/18/bitcoin-surges-past-70000",
"source": "coindesk.com",
"timestamp": "1697630501000",
"tokenSymbols": ["BTC"],
"importance": "high",
"tokenSymbolSentiments": [
{
"tokenSymbol": "BTC",
"sentiment": "bullish"
}
]
},
{
"id": "NEWS_20241018_002",
"title": "以太坊开发者确定下一次升级时间表",
"summary": "以太坊核心开发者就下一次主要网络升级时间表达成一致,重点关注可扩展性改进。",
"content": "",
"sourceUrl": "https://cointelegraph.com/news/ethereum-upgrade-timeline",
"source": "cointelegraph.com",
"timestamp": "1697627000000",
"tokenSymbols": ["ETH"],
"importance": "medium",
"tokenSymbolSentiments": [
{
"tokenSymbol": "ETH",
"sentiment": "bullish"
}
]
}
]
}
}