Mental model
Mobula is a REST API with two versions living side by side (/api/1/... and /api/2/...), where the network is a query parameter that changes name between versions (blockchain/blockchains in V1, chainId/chainIds in V2), and most resources have separate endpoints for single vs. batch, token vs. pair, and current vs. historical. Codex is a single GraphQL Supergraph: one endpoint (https://graph.codex.io/graphql), one auth header, one query language, and the network is just a numeric networkId parameter on each field.
What that means in practice:
- You stop maintaining two API surfaces. The
/api/1/...vs./api/2/...decision goes away, along with theblockchain=ethereumvs.chainId=evm:1naming split. - Network selection lives next to the data, so the same query covers Solana, Ethereum, Base, BNB, and 80+ networks. No more mapping CAIP-style
solana:solanaidentifiers per call. - Multi-token requests stop needing separate
multi-*endpoints. GraphQL aliases and array inputs handle batching natively, and you only pay for the fields you request. - Real-time data has two delivery options instead of two websocket families. Mobula splits curated streams (
wss://api.mobula.io) from raw indexing streams (wss://stream-evm-prod.mobula.io, etc.); Codex gives you WebSocket subscriptions and webhooks, and you can mix them in the same app.
Authentication
Mobula uses anAuthorization header set to your raw API key (no Bearer prefix) from the Mobula dashboard, against https://api.mobula.io/api/ (or the rate-limited https://demo-api.mobula.io/api/). Codex also uses an Authorization header with your API key from the dashboard, so the header itself barely changes. The difference is network moves from a query parameter to a field argument, and the request body becomes GraphQL.
Mobula
Codex
createApiTokens and pass it as Bearer <token>. See Authentication for the full pattern.
Endpoint mapping
The tables cover the Mobula endpoints customers ask about most often, grouped by surface area. Where Mobula splits a concept across V1 and V2, or across single and batch endpoints, the Codex equivalent on the right replaces all of them. Codex network IDs used below:ethereum → 1, solana → 1399811149, base → 8453, bsc → 56, polygon → 137, arbitrum → 42161, optimism → 10, avalanche → 43114.
Prices and market data
Token metadata and search
Dedicated token safety is coming soon. Today, Codex surfaces safety flags on
token (isScam, mintable, freezable, creatorAddress, top10HoldersPercent) and distribution-based risk signals through filterTokens (insider/sniper/bundler/dev held %, potentialScam). A dedicated token contract scanner for deeper scam and honeypot detection, closer to Mobula’s /2/token/security, is in active development. If contract-level security is core to your product, flag those call sites during migration and reach out so we can share timelines.Pairs and markets
Charts and OHLCV
Trades
Holders and traders
Wallets
Discovery, screening, and launchpads
Most of Mobula’s discovery and screening surface (/1/market/query, /1/search, /2/fast-search, /2/pulse, /1/all, category and trending lookups) collapses into a single Codex query: filterTokens. It is the most flexible endpoint in the API and worth understanding well before you migrate, because it replaces a dozen Mobula call patterns at once.
filterTokens takes a set of filters (range or boolean conditions on token attributes), optional rankings (sort by any attribute, ascending or descending), an optional phrase for search, and a network scope. In one request you can filter and rank across 100+ attributes, including:
- Price and valuation:
priceUSD,marketCap,circulatingMarketCap,fdv, and all-time highs/lows (athPrice,atlPrice,athFdv,atlFdv,athCircMc,atlCircMc). - Windowed trading stats (5m / 1h / 4h / 12h / 24h):
volume*,buyVolume*,sellVolume*,txnCount*,uniqueBuys*,uniqueSells*,change*,high*,low*. - Liquidity:
liquidity,totalLiquidityUsd. - Holders and age:
holders,top10HoldersPercent,age,createdAt,lastTransaction. - Safety and distribution signals:
potentialScam,mintable,freezable,isVerified,insiderHeldPercentage,sniperHeldPercentage,bundlerHeldPercentage,devHeldPercentage,bluechipRatings. - Launchpad state:
launchpadName,launchpadProtocol,launchpadGraduationPercent,launchpadCompleted,launchpadMigrated. - Categories:
categories,hasCategory.
change* or volume; for a new-listings feed, rank by createdAt; for a memecoin screener, filter on launchpad and distribution fields. The same query shape covers all of them. See the Discover Tokens recipe for worked examples.
Utility
Side-by-side examples
The four patterns below are the ones Mobula customers most commonly migrate first. Token addresses are real and queries are runnable.1. Multi-token price
onPricesUpdated.
2. OHLCV chart
7D). Sub-minute resolutions (1S-30S) are only populated for the last 24 hours. For live chart updates, layer in the onBarsUpdated subscription. See the Charts recipe for a full Lightweight Charts integration.
3. Token details (metadata + stats + safety)
Mobula splits this across/2/token/details, /2/market/details, and /2/token/security. Codex returns the same picture in a single request.
4. Wallet portfolio
tokenIds into getTokenPrices. For wallet-level PnL and volume, see detailedWalletStats and the Wallets recipe.
Real-time data
Mobula splits real-time data across two websocket families: curated data streams atwss://api.mobula.io (message type of market, trade, ohlcv, holders, balance, pulse-v2, etc.) and raw per-chain indexing streams at wss://stream-evm-prod.mobula.io, wss://stream-sol-prod.mobula.io, and similar. In both, the API key travels in the JSON payload as authorization. Codex gives you the same curated data with two delivery options, and you can use both at once:
- WebSocket subscriptions: persistent connection, updates pushed inline, API key in the connection auth. Best for dashboards, trading UIs, anything user-facing.
- Webhooks: Codex calls an HTTP endpoint you control when an event fires. Best for background jobs, alerts, and queue-driven systems.
Gaps
Things Mobula does that Codex doesn’t, and what to do about them:- Perpetuals data and execution (
/2/perp/*,/2/wallet/positions/perp/*,/1/market/cefi/funding-rate, perp streams). Codex is a spot-trading data API. If your product depends on perp positions, funding rates, or perp execution, keep Mobula for that surface or pair Codex with a perps-native provider. - Swap and bridge execution (
/2/swap/quoting,/2/swap/send,/2/bridge/*). Codex is read-only market data and does not quote, route, or submit transactions. Keep an execution provider for these. - Prediction-market trading (Mobula’s
/2/pm/*CLOB order/auth/redeem flow). Codex exposes Polymarket and Kalshi data viafilterPredictionEventsand related queries, but not order placement. Keep Mobula (or the venue directly) for trading. - Raw transfers and raw transactions (
/1/wallet/raw-transactions,/1/wallet/token-transfers,/1/wallet/nft-transfers, rawtransferstreams). Codex returns swap and token-lifecycle events, not arbitrary transfers. Combine Codex with an RPC provider or an Etherscan-family API if transfer history is core to your product. - Wallet intelligence (
/2/wallet/fundingfunding-source tracing,/2/wallet/deployer,/2/wallet/labelsand/labels/searchentity labels). Codex discovers wallets by onchain behavior and performance (filterWallets), not curated identity/entity labels. - DeFi protocol positions (
/2/wallet/defi-positions). Codex tracks token balances and swap activity, not staking, lending, or LP positions inside DeFi protocols. Pair with a DeFi-positions provider (Zapper, Zerion, DeBank) if this is core to your product. - NFT data (
/1/market/nft,/1/wallet/nfts,/1/metadata/nfts). Codex does not expose NFT collection or holdings data. - CeFi / CEX data (CeFi funding rates, CEX-inclusive market details). Codex is onchain-only.
- Global market aggregates (
/1/market/total,/1/market/token-vs-market, editorial/1/metadata/news). No first-class equivalent; Codex is per-token/per-pair onchain data. - Single-call all-chain portfolio aggregation (
fetchAllChains,/1/wallet/multi-portfoliorollups). Codex’sbalancestakes an array ofnetworks, so you can span chains in one query, but very large multi-chain rollups may need pagination per network. - Native-token balances on chains without traces.
balancesreturns ERC-20/SPL holdings on every supported network, but native-token amounts on EVM chains require traces support. Flag any integration that relies on native-token portfolio values on a chain without traces.
What you pick up
Things Codex offers that Mobula’s data API doesn’t:- One query, many shapes. GraphQL lets you combine token metadata, price, holders, recent trades, and chart data into a single request and only pull the fields you render. A typical Mobula-powered token page hits three or four endpoints across V1 and V2; the Codex equivalent is one.
- One API surface, not two. No
/api/1/...vs./api/2/...split and noblockchainvs.chainIdnaming drift. Network is a single numericnetworkIdeverywhere. - One endpoint for almost any discovery need.
filterTokensfilters and ranks across 100+ attributes (price, market cap, FDV, ATH/ATL, windowed volume and trade counts, liquidity, holders, age, launchpad state, and scam/distribution signals) in a single query, and does phrase search. It collapses Mobula’s/1/market/query,/1/search,/2/fast-search,/2/pulse,/1/all, and category/trending endpoints into one field. Its subscription twinonFilterTokensUpdatedstreams the same re-ranked list live. - Multi-timeframe stats in a single call.
getDetailedTokenStatsandgetDetailedPairStatsreturn volume, buys, sells, price change, and unique-maker counts across every window from 5-minute to daily and weekly at once, each with its own change value. No per-timeframe endpoint fan-out. - Sub-second chart resolution.
getTokenBarsandgetBarsgo from 1-second candles up to weekly (7D), so high-frequency trading UIs and low-latency charts work off the same API as daily views. - Prediction markets across venues. Codex covers both Polymarket and Kalshi (Mobula’s data is Polymarket-only), including event, market, trade, and trader-level analytics like leaderboards, PnL, and holdings via the
filterPredictionEventsandfilterPredictionTradersfamilies. See Prediction Markets. - Launchpad lifecycle data. First-class support for pump.fun, LetsBonk, Believe, and other launchpads, including bonding-curve state, graduation, and migration events. Mobula surfaces new/bonding pools through Pulse, but Codex models the full lifecycle as queryable and streamable events. See Launchpads.
- Wallet discovery by performance.
filterWalletslets you query for wallets matching specific PnL, win-rate, or trading-volume criteria across all networks, not just for a single token. This is the smart-money surface Mobula’s label lookups don’t cover. - Liquidity locks.
liquidityLockssurfaces locked-LP context across major EVM chains and Solana, so you can tell a genuinely locked pool from an exit-liquidity trap. - Webhooks alongside subscriptions. Push real-time data to your servers without holding open a WebSocket, and mix both in one app. Configure via
createWebhooks. - Built for AI agents. A docs MCP server, prebuilt Codex Skills for Claude/Cursor/Codex CLI, and pay-per-query access via MPP.
AI migration prompt
Most Mobula integrations span dozens of call sites: a price service here, a chart loader there, a portfolio screen, a websocket handler. Hand the prompt below to an IDE agent (Claude Code, Cursor, Codex CLI, or similar), run it from the repo root, and it will discover every Mobula touchpoint, propose a plan, and execute the migration with your approval.Getting help
- Browse the API Reference for the full schema.
- Skim the Recipes for end-to-end examples that solve specific product problems.
- Ask in our community if you hit a wall during migration.