> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sim.dune.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Supported Chains

> Explore chains supported by Sim's EVM API endpoints.

export const SupportedChainsAccordion = () => {
  const dataState = useState(null);
  const data = dataState[0];
  const setData = dataState[1];
  const countsState = useState({});
  const counts = countsState[0];
  const setCounts = countsState[1];
  const loadingState = useState(true);
  const isLoading = loadingState[0];
  const setIsLoading = loadingState[1];
  useEffect(function () {
    fetch("https://sim-proxy.dune-d2f.workers.dev/v1/evm/supported-chains", {
      method: "GET"
    }).then(function (response) {
      return response.json();
    }).then(function (responseData) {
      setData(responseData);
      var balancesCount = 0;
      var activityCount = 0;
      var collectiblesCount = 0;
      var transactionsCount = 0;
      var tokenInfoCount = 0;
      var tokenHoldersCount = 0;
      var defiPositionsCount = 0;
      for (var i = 0; i < responseData.chains.length; i++) {
        var chain = responseData.chains[i];
        if (chain.balances && chain.balances.supported) balancesCount++;
        if (chain.activity && chain.activity.supported) activityCount++;
        if (chain.collectibles && chain.collectibles.supported) collectiblesCount++;
        if (chain.transactions && chain.transactions.supported) transactionsCount++;
        if (chain.token_info && chain.token_info.supported) tokenInfoCount++;
        if (chain.token_holders && chain.token_holders.supported) tokenHoldersCount++;
        if (chain.defi_positions && chain.defi_positions.supported) defiPositionsCount++;
      }
      setCounts({
        balances: balancesCount,
        activity: activityCount,
        collectibles: collectiblesCount,
        transactions: transactionsCount,
        token_info: tokenInfoCount,
        token_holders: tokenHoldersCount,
        defi_positions: defiPositionsCount
      });
      setIsLoading(false);
    });
  }, []);
  function renderChainsTable(endpoint) {
    if (!data || !data.chains) {
      return <p>No data available</p>;
    }
    var supportedChains = [];
    for (var i = 0; i < data.chains.length; i++) {
      var chain = data.chains[i];
      if (chain[endpoint] && chain[endpoint].supported) {
        supportedChains.push(chain);
      }
    }
    return <table>
        <thead>
          <tr>
            <th>name</th>
            <th>chain_id</th>
            <th>tags</th>
          </tr>
        </thead>
        <tbody>
          {supportedChains.map(function (chain) {
      return <tr key={chain.name}>
                <td><code>{chain.name}</code></td>
                <td><code>{chain.chain_id}</code></td>
                <td><code>{chain.tags ? chain.tags.join(", ") : ""}</code></td>
              </tr>;
    })}
        </tbody>
      </table>;
  }
  if (isLoading) {
    return <div>Loading chain information...</div>;
  }
  if (!data) {
    return <div>No data available</div>;
  }
  return <AccordionGroup>
      <Accordion title={"Balances API (" + (counts.balances || 0) + ")"}>
        <p>The <a href="/evm/balances">Balances API</a> supports {counts.balances || 0} chains.</p>
        {renderChainsTable("balances")}
      </Accordion>
      <Accordion title={"Activity API (" + (counts.activity || 0) + ")"}>
        <p>The <a href="/evm/activity">Activity API</a> supports {counts.activity || 0} chains.</p>
        {renderChainsTable("activity")}
      </Accordion>
      <Accordion title={"Collectibles API (" + (counts.collectibles || 0) + ")"}>
        <p>The <a href="/evm/collectibles">Collectibles API</a> supports {counts.collectibles || 0} chains.</p>
        {renderChainsTable("collectibles")}
      </Accordion>
      <Accordion title={"Transactions API (" + (counts.transactions || 0) + ")"}>
        <p>The <a href="/evm/transactions">Transactions API</a> supports {counts.transactions || 0} chains.</p>
        {renderChainsTable("transactions")}
      </Accordion>
      <Accordion title={"Token Info API (" + (counts.token_info || 0) + ")"}>
        <p>The <a href="/evm/token-info">Token Info API</a> supports {counts.token_info || 0} chains.</p>
        {renderChainsTable("token_info")}
      </Accordion>
      <Accordion title={"Token Holders API (" + (counts.token_holders || 0) + ")"}>
        <p>The <a href="/evm/token-holders">Token Holders API</a> supports {counts.token_holders || 0} chains.</p>
        {renderChainsTable("token_holders")}
      </Accordion>
      <Accordion title={"DeFi Positions API (" + (counts.defi_positions || 0) + ")"}>
        <p>The <a href="/evm/defi-positions">DeFi Positions API</a> supports {counts.defi_positions || 0} chains.</p>
        {renderChainsTable("defi_positions")}
      </Accordion>
    </AccordionGroup>;
};

export const DefaultChainCount = ({endpoint}) => {
  const dataState = useState(null);
  const data = dataState[0];
  const setData = dataState[1];
  useEffect(function () {
    fetch("https://api.sim.dune.com/v1/evm/supported-chains", {
      method: "GET"
    }).then(function (response) {
      return response.json();
    }).then(function (responseData) {
      setData(responseData);
    });
  }, []);
  if (data === null) {
    return <>N</>;
  }
  if (!data.chains || !Array.isArray(data.chains)) {
    return <>N</>;
  }
  var uniqueDefaultChains = new Set();
  for (var i = 0; i < data.chains.length; i++) {
    var chain = data.chains[i];
    var hasDefaultTag = Array.isArray(chain.tags) && chain.tags.indexOf("default") !== -1;
    if (!hasDefaultTag) {
      continue;
    }
    if (endpoint !== undefined) {
      if (chain[endpoint] && chain[endpoint].supported === true) {
        uniqueDefaultChains.add(chain.name);
      }
    } else {
      uniqueDefaultChains.add(chain.name);
    }
  }
  var count = uniqueDefaultChains.size;
  return <>{count}</>;
};

<img src="https://mintcdn.com/sim-dune/ZJaWY5isqbzG1C45/images/evm/Chains.svg?fit=max&auto=format&n=ZJaWY5isqbzG1C45&q=85&s=6b67184d693343b6a0e1e1c4f0d34c88" alt="Sim APIs Supported Chains" className="w-full mx-auto" width="560" height="257" data-path="images/evm/Chains.svg" />

The Supported Chains endpoint provides realtime information about which blockchains are supported by Sim's EVM API endpoints.
Chain support varies by API endpoint. Use the dropdown below to check which chains are available for each API:

<SupportedChainsAccordion />

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.sim.dune.com/v1/evm/supported-chains \
    --header 'X-Sim-Api-Key: YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.sim.dune.com/v1/evm/supported-chains', {
    method: 'GET',
    headers: {
      'X-Sim-Api-Key': 'YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.sim.dune.com/v1/evm/supported-chains"
  headers = {"X-Sim-Api-Key": "YOUR_API_KEY"}

  response = requests.get(url, headers=headers)
  data = response.json()
  print(data)
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "chains": [
      {
        "name": "ethereum",
        "chain_id": 1,
        "tags": ["default", "mainnet"],
        "balances": {"supported": true},
        "transactions": {"supported": true},
        "activity": {"supported": true},
        "token_info": {"supported": true},
        "token_holders": {"supported": true},
        "collectibles": {"supported": true}
      },
      {
        "name": "polygon",
        "chain_id": 137,
        "tags": ["default", "mainnet"],
        "balances": {"supported": true},
        "transactions": {"supported": true},
        "activity": {"supported": true},
        "token_info": {"supported": true},
        "token_holders": {"supported": true},
        "collectibles": {"supported": true}
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Bad Request"
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Unauthorized"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Not Found"
  }
  ```

  ```json 429 theme={null}
  {
    "error": "Too many requests"
  }
  ```

  ```json 500 theme={null}
  {
    "error": "Internal Server Error"
  }
  ```
</ResponseExample>

## Tags

The `tags` property groups chains by category, such as `mainnet`, `testnet`, or `default`.
You can use these tags to filter or select chains in API requests.
Any endpoint that supports the `chain_ids` query parameter accepts a tag in place of explicit IDs, letting you fetch data for an entire group of chains in a single request.

When using `chain_ids`, you can request chains in several ways:

* **By tags**: `?chain_ids=mainnet` returns all chains tagged with `mainnet`. Using `?chain_ids=mainnet,testnet` returns all chains that are tagged with `mainnet` *or* `testnet`.
* **Specific chain IDs**: `?chain_ids=1,137,42161` (Ethereum, Polygon, Arbitrum).
* **Mix tags and numeric IDs**: `?chain_ids=1,8543,testnet`
* **Default behavior**: Omitting `chain_ids` returns only chains tagged `default`.

Some supported chains have **no tag assigned**.
A chain may be untagged due to higher latency, restrictive rate limits, RPC cost, or a temporary incident.
Untagged chains stay out of default requests to keep them fast, but you can still query them with `chain_ids` by passing their numerical chain id (e.g. `chain_ids=21000000` for corn).

Open the accordion above and scan the table to see which chains carry tags and which are untagged.

## Compute Units

Chain selection directly determines CU cost for chain-dependent endpoints (like Balances and Collectibles). CU equals the number of distinct chains included after expanding any tags you pass in `chain_ids`.

If you omit `chain_ids`, the endpoint uses its `default` chain set. That is currently {<DefaultChainCount endpoint="balances" />} chains for Balances and {<DefaultChainCount endpoint="collectibles" />} chains for Collectibles (these values can change over time).

See [Compute Units](/compute-units) for the full rate card and guidance.

## Using the API Endpoint

You can programmatically retrieve the list of supported chains to adapt to newly supported networks.

The response includes an array of supported chains.
Each item in the array includes the chain's `name`, `chain_id`, an array of `tags`, and support for each endpoint.
Each endpoint (balances, transactions, activity, etc.) has a `supported` boolean value

## Examples

Here are two practical examples of how you might use the API endpoint:

### 1. Building a Dynamic Chain Selector

This example shows how to fetch supported chains and create a user-friendly dropdown menu that filters chains based on their capabilities.
It can be useful for wallet UIs or dApp chain selection.

```javascript [expandable] theme={null}
// Fetch supported chains and build a dropdown for users
async function buildChainSelector() {
  const response = await fetch('https://api.sim.dune.com/v1/evm/supported-chains', {
    headers: { 'X-Sim-Api-Key': 'YOUR_API_KEY' }
  });
  
  const data = await response.json();
  
  // Filter chains that support balances
  const supportedChains = data.chains.filter(chain => chain.balances.supported);
  
  // Build dropdown options
  const chainOptions = supportedChains.map(chain => ({
    value: chain.chain_id,
    label: `${chain.name} (${chain.chain_id})`,
    isMainnet: chain.tags.includes('mainnet')
  }));
  
  return chainOptions;
}
```

### 2. Validating Chain Support

This example demonstrates how to validate whether a specific chain supports a particular endpoint before making API calls.
This helps prevent errors and improves user experience by showing appropriate messages.

```javascript [expandable] theme={null}
async function validateChainSupport(chainId, endpointName) {
  // Check if a chain supports a specific endpoint before making requests
  try {
    const response = await fetch('https://api.sim.dune.com/v1/evm/supported-chains', {
      headers: { 'X-Sim-Api-Key': 'YOUR_API_KEY' }
    });
    
    const data = await response.json();
    
    // Find the chain
    const chain = data.chains.find(c => c.chain_id === chainId);
    
    if (!chain) {
      return { supported: false, message: `Chain ${chainId} not found` };
    }
    
    // Check if the endpoint is supported
    if (!chain[endpointName] || !chain[endpointName].supported) {
      return { 
        supported: false, 
        message: `Endpoint '${endpointName}' not supported on ${chain.name}` 
      };
    }
    
    return { 
      supported: true, 
      message: `Chain ${chain.name} supports ${endpointName}` 
    };
    
  } catch (error) {
    return { supported: false, message: `Error validating chain: ${error.message}` };
  }
}

// Usage
const result = await validateChainSupport(1, 'balances');
console.log(result.message); // "Chain ethereum supports balances"
```


## OpenAPI

````yaml /openapi.json GET /v1/evm/supported-chains
openapi: 3.0.3
info:
  title: Sim API
  description: >-
    The Sim API by Dune provides real-time blockchain data across EVM and SVM
    chains. Access token balances, transaction history, on-chain activity, DeFi
    positions, NFT collectibles, token information, and webhook subscriptions
    through a unified REST API.
  version: 1.0.0
  license:
    name: ''
  contact:
    name: Dune Support
    url: https://docs.sim.dune.com
    email: support@dune.com
servers:
  - url: https://api.sim.dune.com
security:
  - ApiKeyAuth: []
tags:
  - name: evm
    description: EVM-compatible blockchain endpoints.
  - name: svm
    description: Solana/SVM blockchain endpoints.
  - name: activity
    description: On-chain activity feed.
  - name: balances
    description: Token balances (EVM and SVM).
  - name: transactions
    description: Transaction history (EVM and SVM).
  - name: collectibles
    description: NFT and ERC721/ERC1155 holdings.
  - name: defi
    description: DeFi protocol positions.
  - name: supported-chains
    description: Supported blockchain networks.
  - name: token-info
    description: Token metadata and pricing.
  - name: token-holders
    description: Token holder distribution.
  - name: subscriptions
    description: >-
      Webhook subscription management for real-time on-chain event
      notifications.
paths:
  /v1/evm/supported-chains:
    get:
      tags:
        - evm
        - supported-chains
      summary: Get a list of supported chains for EVM endpoints
      description: >-
        This endpoint returns a list of chains that are supported by the EVM
        endpoints. This is a unified endpoint that replaces the individual
        chains endpoints for each service.
      operationId: getEvmSupportedChains
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChainsResponse'
              example:
                chains:
                  - id: 42161
                    name: arbitrum
                    supported_assets:
                      - native
                      - erc20
                    tags:
                      - default
                      - mainnet
                  - id: 1
                    name: ethereum
                    supported_assets:
                      - native
                      - erc20
                    tags:
                      - default
                      - mainnet
        '400':
          description: >-
            Bad Request - The request could not be understood by the server due
            to malformed data
        '404':
          description: Not Found
        '429':
          description: Rate Limit Exceeded - Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
              examples:
                rateLimitExceeded:
                  value:
                    error: >-
                      Too many requests. Please contact sales@dune.com to
                      increase your limit.
        '500':
          description: Internal Server Error - A generic error occurred on the server
components:
  schemas:
    ChainsResponse:
      type: object
      required:
        - chains
      properties:
        chains:
          type: array
          items:
            $ref: '#/components/schemas/ChainEntry'
          description: Array of supported chains
    GatewayErrorResponse:
      type: object
      description: >-
        Error response from the API gateway. Returned for authentication,
        permissions, rate-limiting, and quota errors.
      properties:
        error:
          type: string
          description: Error message.
      required:
        - error
    ChainEntry:
      type: object
      required:
        - name
        - id
        - tags
      properties:
        id:
          type: integer
          format: int64
          description: The chain ID
        name:
          type: string
          description: The name of the chain
        supported_assets:
          type: array
          items:
            type: string
          description: >-
            Types of assets supported on this chain (e.g., 'native', 'erc20',
            'erc721')
        tags:
          type: array
          items:
            type: string
          description: >-
            Tags associated with this chain (e.g., 'default', 'mainnet',
            'testnet')
        rpc_url:
          type: string
          description: The RPC URL for this chain
        explorer_url:
          type: string
          description: The block explorer URL for this chain
        logo:
          type: string
          description: URL to the chain's logo
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Sim-Api-Key
      description: >-
        API key for authentication. Obtain your key from the Dune dashboard at
        sim.dune.com.

````