OKX News & Sentiment
Crypto news aggregation, coin sentiment analysis, and macro-economic calendar for OKX. All commands are read-only and require API credentials (OAuth2.1).
Capabilities
Prerequisites
- Install
okxCLI: - Configure credentials in
~/.okx/config.toml - Verify setup:
OKX News does not support demo mode. Always use --profile live silently — don't mention it unless there's an error.
On "not available in demo" errors: the user's current profile is configured with demo/simulated credentials. Tell the user: "News module does not support demo mode. Please switch to a live profile." Guide them to either:
- Use
--profile liveif a live profile exists:okx --profile live news latest - Or create one:
okx config add-profile AK=<key> SK=<secret> PP=<passphrase> name=live
All commands support --json for raw JSON output.
Quickstart
Intent → Command Mapping
Browse News
latest, by-coin, and search default --importance low, which returns all news (both high and low importance). Pass --importance high only when the user explicitly asks for major / breaking / important news. The dedicated okx news important command is a shortcut for that case.
Search News
Coin Sentiment Analysis
Economic Calendar
CRITICAL — always use BOTH
--beforeAND--afterto form a time window. Using--beforealone returns events all the way to 2028 in reverse order —--limitthen clips the FARTHEST events, not the nearest. Always pair them.Semantics (counterintuitive):
--before <ts>= events NEWER than ts (lower bound),--after <ts>= events OLDER than ts (upper bound, default=now).
How to choose before / after:
Notes:
- ⚠️ ALWAYS use both
--beforeAND--afterfor future-event queries.--beforealone returns to 2028 and limit clips the wrong end. The only exception is past-event queries where default after=now is correct. - Rate limit: 1 request per 5 seconds (IP-based). Do NOT call repeatedly.
- No keyword/event filter — scan response
eventfield client-side. Use a single API call with--limit 100and broad window, then filter results locally (do NOT loop calls trying different keywords). - When user asks for a specific importance level (e.g. "重要的", "high importance"), pass
--importance 3AND only include importance=3 events in output. Do NOT pad the response with lower-importance events. - When searching for a specific event (NFP, CPI, ECB decision), always add
--importance 3to reduce noise — these are all high-importance events. Use--limit 100and a wide window to ensure the target event is captured. actual=""= not yet released; non-empty = released.- Historical data >3 months requires VIP1+.
- Demo mode not supported — use
--profile livesilently. --regionvalues are snake_case (e.g.united_states,euro_area). Invalid values silently return empty results (no error). If you get empty results and suspect a region typo, runokx news list-regionsto get the full list of 210 valid values, then fuzzy-match the user's input and retry. If unsure of the exact value, omit--regionand filter results client-side by theregionfield in the response.
BTC Macro Impact (cross-skill)
These queries require parallel execution of economic-calendar + BTC sentiment/news + market data. Do NOT run them sequentially.
Sentiment Anomaly Detection (multi-coin)
These queries require a broad-then-deep approach: first scan all coins for anomalies, then deep-dive with news correlation. Follow the multi-phase workflow in references/workflows.md — do NOT just pick a few coins to analyze.
Source-Filtered News
Use --platform to filter by news source directly. Always resolve the exact value from okx news platforms — do not guess platform identifiers from the user's wording.
Important: When filtering by source, use a larger --limit (10–20) to maximize results, since individual sources typically have fewer articles than the aggregated feed. --importance low (the default) is the right setting here; do not narrow to --importance high.
Posting cadence is uneven across platforms. The API defaults --begin to 72 hours ago, which is too narrow for bursty sources and will often return 0 results. If a --platform-filtered query returns fewer than ~5 items (or 0), retry with --begin set to 7 days back, then 30 days back before concluding the source has no data. Resolve candidate platform IDs from okx news platforms; do not hardcode assumptions about which platforms are active.
Cross-Skill Workflows
See references/workflows.md [blocked] for multi-step scenarios (market overview, daily briefing, etc.) and full MCP tool → CLI mapping.
Command Reference
okx news latest
Get the latest crypto news sorted by time.
--importance default is low (returns all news, both high and low). Pass --importance high to narrow to breaking / major news only — or use okx news important.
okx news important
Get high-impact breaking news (reported by multiple sources).
okx news by-coin
Get news for specific coins.
--importance default is low (returns all news). Pass --importance high only for breaking / major news.
okx news search
Full-text keyword search with optional filters.
--importance default is low (returns all news). Pass --importance high only for breaking / major news.
okx news detail
Get full article content by ID.
okx news by-sentiment
Browse news filtered by sentiment (no keyword needed).
--importance default is low (returns all news). Pass --importance high only for breaking / major news.
okx news platforms
List available news platforms. Use the returned values with --platform on latest, by-coin, or search commands to filter by source.
okx news coin-sentiment
Get current sentiment snapshot for specific coins.
Returns: symbol, label (bullish/bearish/neutral/mixed), bullishRatio, bearishRatio, mentionCount.
okx news coin-trend
Get time-series sentiment trend for a coin. Note: uses positional arg (not --coins).
trendPoints guide: 1h period → use 24 (last 24h), 4h → use 6, 24h → use 7.
okx news sentiment-rank
Get coin ranking by social hotness or sentiment direction.
okx news economic-calendar
Get macro-economic calendar data. Historical data beyond 3 months requires VIP1+.
Rate limit: 1 request per 5 seconds (IP). Much stricter than other news commands.
before/after are inverted: --before <ts> = newer than ts (future), --after <ts> = older than ts (past). See Economic Calendar intent mapping for examples.
Common regions: united_states, china, euro_area, united_kingdom, japan, germany, canada, australia
Importance: 1=low, 2=medium, 3=high
okx news list-regions
List all valid --region values for economic-calendar. Use when a region query returns empty to verify the value.
MCP Tool Reference
Coin Symbol Normalization
The API only accepts standard uppercase ticker symbols (e.g. BTC, ETH, SOL). Users may refer to coins by full names, abbreviations, slang, or local-language nicknames. Always resolve these to the correct ticker before passing to any command. If the intended coin is ambiguous, ask the user to confirm before querying.
Empty Results & Web Search Fallback
OKX news data may be sparse for niche coins or highly specific keyword searches. The API default --begin window is only 72 hours, which alone accounts for many empty results. When a command returns empty or insufficient results, apply these steps in order — do not skip to web search:
- If
--platformwas used — broaden--beginto 7 days back, then 30 days back, before changing anything else. Bursty sources routinely return 0 items in the default window but dozens over a wider range. - If
--importance highwas passed — drop it (default is alreadylow= all news). - Broaden
--begin/--endfor any query (not just--platform) when a narrow time window is suspected. - Drop
--coinsto get general news if the coin-specific query yielded nothing. - Use web search as a supplement — search the web for
"<topic> news site:coindesk.com OR site:cointelegraph.com OR site:theblock.co"to gather additional context, then combine with any OKX results into a unified briefing. - Be transparent — tell the user which results came from OKX API vs. web search so they can judge source credibility.
This fallback is especially valuable for:
- Coins with low coverage (e.g. newly listed tokens)
- Highly specific keyword searches with no matches
--platformqueries where the chosen source has uneven posting cadence
Known Limitations
Source Coverage
Platform posting cadence varies and changes over time. Some sources publish many articles per day; others post in bursts with quiet stretches in between. A source returning few or zero articles in the default 72-hour window is not evidence that it is inactive — it may simply not have posted recently, or its recent posts may have been deduplicated out.
Before concluding a --platform-filtered query has no data:
- Broaden
--beginto 7 days back, then 30 days back, and retry. - If still empty after a 30-day window, report to the user that no recent articles were found for that source and suggest either removing
--platform(to fall back to the aggregated feed) or web search.
Do not hardcode assumptions about which platforms are active — resolve candidates from okx news platforms and let the data speak.
Historical Search Limitations
okx news search and okx news by-coin primarily index recent articles (typically today and recent days). Searching with --begin/--end for dates more than ~7 days ago may return empty results even if articles existed at that time. This is an API indexing limitation, not a data absence.
For historical analysis, okx news coin-trend (sentiment trend data) is more reliable than article search — it retains time-series data for longer periods.
Edge Cases
- Pagination: use
--after <cursor>to get next page; cursor comes fromnextCursorin response - Time parameters:
--begin/--endare Unix epoch milliseconds - Coins format: comma-separated uppercase symbols, e.g.
BTC,ETH,SOL— never pass full names or aliases - coin-trend
--points: always pass explicitly; 1h→24, 4h→6, 24h→7 - Language: inferred from user's message —
--lang zh-CNfor Chinese,--lang en-USfor English (default) - sentiment-rank
--sort-by:hot=by mention count (default),bullish=most bullish,bearish=most bearish

