Get Sentiment Ranking#
Retrieve the top tokens ranked by sentiment activity (mention volume) within a specified time period.
Request Path#
GET
https://web3.okx.com/api/v6/dex/market/social/sentiment/rankingRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| timeFrame | string | No | Statistical period: 1=1h (last 1 hour), 2=4h (last 4 hours), 3=24h (last 24 hours). Default 1. |
| sortBy | string | No | Sort order: currently only supports 1=hot (descending by total mention count). Default 1. |
| limit | string | No | Number of results to return, range [1, 50], default 10. |
Response Parameters#
| Field | Type | Description |
|---|---|---|
| period | string | Echo of the resolved period, e.g. "1h", "4h", "24h" |
| ts | string | Server-side timestamp (milliseconds) |
| details | array | Token list sorted by mention count in descending order, up to limit records |
| > tokenSymbol | string | Token symbol |
| > mentionCount | string | Total mention count within the statistical period, including X/Twitter and news sources |
| > xMentionCount | string | Mention count on X/Twitter platform |
| > newsMentionCount | string | Mention count from news sources |
| > sentiment | object | Sentiment breakdown for this token |
| >> bullishCnt | string | Number of bullish-sentiment mentions |
| >> bearishCnt | string | Number of bearish-sentiment mentions |
| >> neutralCnt | string | Number of neutral-sentiment mentions |
| >> bullishRatio | string | Bullish ratio, range 0.0–1.0 |
| >> bearishRatio | string | Bearish ratio, range 0.0–1.0 |
| >> label | string | Overall sentiment label: bullish / bearish / neutral / mixed |
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/dex/market/social/sentiment/ranking?timeFrame=1&sortBy=1&limit=10' \
--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'
Response Example#
json
{
"code": "0",
"msg": "",
"data": {
"period": "1h",
"ts": "1697630501000",
"details": [
{
"tokenSymbol": "BTC",
"mentionCount": "12540",
"xMentionCount": "10200",
"newsMentionCount": "2340",
"sentiment": {
"bullishCnt": "7890",
"bearishCnt": "1230",
"neutralCnt": "3420",
"bullishRatio": "0.629",
"bearishRatio": "0.098",
"label": "bullish"
}
},
{
"tokenSymbol": "ETH",
"mentionCount": "8320",
"xMentionCount": "6890",
"newsMentionCount": "1430",
"sentiment": {
"bullishCnt": "4980",
"bearishCnt": "890",
"neutralCnt": "2450",
"bullishRatio": "0.598",
"bearishRatio": "0.107",
"label": "bullish"
}
},
{
"tokenSymbol": "SOL",
"mentionCount": "5670",
"xMentionCount": "4920",
"newsMentionCount": "750",
"sentiment": {
"bullishCnt": "3120",
"bearishCnt": "680",
"neutralCnt": "1870",
"bullishRatio": "0.550",
"bearishRatio": "0.120",
"label": "bullish"
}
}
]
}
}