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/ranking

Request Parameters#

ParameterTypeRequiredDescription
timeFramestringNoStatistical period: 1=1h (last 1 hour), 2=4h (last 4 hours), 3=24h (last 24 hours). Default 1.
sortBystringNoSort order: currently only supports 1=hot (descending by total mention count). Default 1.
limitstringNoNumber of results to return, range [1, 50], default 10.

Response Parameters#

FieldTypeDescription
periodstringEcho of the resolved period, e.g. "1h", "4h", "24h"
tsstringServer-side timestamp (milliseconds)
detailsarrayToken list sorted by mention count in descending order, up to limit records
> tokenSymbolstringToken symbol
> mentionCountstringTotal mention count within the statistical period, including X/Twitter and news sources
> xMentionCountstringMention count on X/Twitter platform
> newsMentionCountstringMention count from news sources
> sentimentobjectSentiment breakdown for this token
>> bullishCntstringNumber of bullish-sentiment mentions
>> bearishCntstringNumber of bearish-sentiment mentions
>> neutralCntstringNumber of neutral-sentiment mentions
>> bullishRatiostringBullish ratio, range 0.0–1.0
>> bearishRatiostringBearish ratio, range 0.0–1.0
>> labelstringOverall 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"
                }
            }
        ]
    }
}