Skip to main content

Overview

When building crypto applications, you often need to identify which blockchain a token contract belongs to. Traditional approaches require expensive RPC calls to multiple chains, which is slow and resource-intensive. Mobula’s Universal Search (/api/2/fast-search) automatically detects the chain for any contract address in under 30ms - no RPC calls, no chain guessing.

Quick Start

Simply pass the contract address to the search endpoint:
The response includes the chainId field that tells you exactly which chain the token is on:

How It Works

When you provide a contract address to the search endpoint:
  1. Cross-chain lookup: Mobula searches across all supported blockchains simultaneously
  2. Instant matching: Uses indexed data instead of live RPC calls
  3. Returns chain info: The response includes chainId identifying the exact blockchain
This is significantly faster than the traditional approach of making sequential RPC calls to each chain.

Code Examples

TypeScript / JavaScript

Python

Get Full Token Data

Once you have the chain ID, you can fetch complete token details:
The search endpoint already returns comprehensive token data including price, volume, liquidity, and trading metrics. In most cases, you won’t need to make a second API call.

Multi-Chain Tokens

Some tokens exist on multiple chains (like USDT or USDC). The search returns all instances sorted by trading activity:

Chain ID Format

Mobula uses standardized chain identifiers:
See the Blockchains endpoint for the complete list of supported chains and their identifiers.

Performance Comparison

Best Practices

1. Handle Multiple Results

When a token exists on multiple chains, the API returns all matches. Always check if your expected chain is in the results:

2. Cache Results

Chain IDs for contracts don’t change. Cache the results to avoid repeated lookups:

3. Filter by Specific Chains

If you only support certain chains, filter the results:

Response Fields

Each token in the response includes:
The full response includes 100+ fields. See the Universal Search API Reference for complete documentation.

Use Cases

  • Trading bots: Quickly identify token chains for cross-chain arbitrage
  • Portfolio trackers: Auto-detect chains for user-provided addresses
  • Token analytics: Build chain-agnostic token dashboards
  • Wallet integrations: Display correct chain info without RPC overhead

Next Steps

Support

Need help? Join our community: