Get Token Sentiment Metrics#
Retrieve sentiment metrics for one or more tokens, including mention counts, sentiment ratios, and optional trend data.
Request Path#
GET
https://web3.okx.com/api/v6/dex/market/social/sentiment/symbolRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| tokenSymbols | string | Yes | Comma-separated list of token symbols, e.g. BTC,ETH. Case-insensitive. Maximum 20 symbols. Returns 400 error if blank. |
| timeFrame | string | No | Statistical period: 1=1h (last 1 hour), 2=4h (last 4 hours), 3=24h (last 24 hours). Default 1. |
| trendPoints | string | No | Number of trend data points. If > 0, the response will include a trend array with trendPoints equally-spaced historical time buckets. Set to 0 or omit to skip trend data. |
Response Parameters#
| Field | Type | Description |
|---|---|---|
| period | string | Actual statistical period corresponding to the timeFrame parameter, e.g. "1h", "4h", "24h" |
| ts | string | Server-side timestamp (milliseconds) |
| details | array | One record per requested token |
| > tokenSymbol | string | Token symbol |
| > mentionCount | string | Total mention count for this token 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 |
| > trend | array | Only returned when trendPoints > 0 |
| >> ts | string | Time bucket timestamp (milliseconds) |
| >> mentionCount | string | Total mention count within this time bucket |
| >> bullishRatio | string | Bullish ratio within this time bucket |
| >> bearishRatio | string | Bearish ratio within this time bucket |
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/dex/market/social/sentiment/symbol?tokenSymbols=BTC&timeFrame=1&trendPoints=24' \
--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"
},
"trend": [
{
"ts": "1697626901000",
"mentionCount": "520",
"bullishRatio": "0.645",
"bearishRatio": "0.092"
},
{
"ts": "1697627051000",
"mentionCount": "498",
"bullishRatio": "0.631",
"bearishRatio": "0.101"
}
]
}
]
}
}