按代币符号获取新闻#

获取按一个或多个代币符号过滤的新闻列表。

请求路径#

GET
https://web3.okx200.com/api/v6/dex/market/social/news/by-symbol

请求参数#

参数名类型是否必填描述
tokenSymbolsstring代币符号列表,如 BTC,ETH,SOL。不区分大小写。支持传入多个,多个使用逗号分隔,最多支持 20 个。
sortBystring排序方式:1=latest(发布时间倒序)、2=hot(热度降序)。默认 1。
sentimentstringSocialSentimentEnum 枚举码,按情绪倾向筛选:1=bullish(看多)、2=bearish(看空)、3=neutral(中性)。省略则返回所有情绪。
importancestringSocialImportanceEnum 枚举码,按文章重要程度筛选:1=high(高重要性)、2=medium(中等)、3=low(低重要性)。省略则返回所有重要级别。
platformstring新闻来源域名,如 coindesk.com。可通过 GET /social/news/platforms 获取全量列表。省略则返回所有来源的数据。
limitstring每页返回条数,范围 [1, 50],默认 10。
cursorstring翻页游标。首次请求不传;后续请求传入上一次响应中的 cursor 以获取下一页。cursor 为 null 时表示已无更多数据。
detailLevelstring响应详情级别:1=summary(仅返回标题 + 摘要,content 字段为空);2=full(同时返回完整正文 content 字段)。默认 1。
beginstring查询起始时间戳(毫秒)。默认为当前时间 - 72 小时;最大可回溯 180 天。
endstring查询结束时间戳(毫秒)。默认为当前时间(now)。
languagestring响应语言,BCP-47 格式,如 en_US、zh_CN。默认 en_US。

返回参数#

字段类型描述
cursorstring下一页游标;为 null 时表示已无更多数据
articlesarray新闻文章列表
> idstring文章唯一 ID,可作为 GET /social/news/detail 接口的 articleId 参数查询完整正文
> titlestring文章标题
> summarystring文章摘要
> contentstring文章完整正文,仅在 detailLevel=2 时返回
> sourceUrlstring文章原文链接
> sourcestring新闻来源的第一个平台域名,如 coindesk.com
> timestampstring文章发布时间,Unix 毫秒时间戳
> tokenSymbolsarray文章中提及的代币符号列表
> importancestring文章重要程度:high(高)、medium(中)、low(低)
> tokenSymbolSentimentsarray本文中各代币的情绪分析列表
>> sentimentstring情绪标签:bullish(看多)/ bearish(看空)/ neutral(中性)
>> tokenSymbolstring代币符号

请求示例#

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"
                    }
                ]
            }
        ]
    }
}