> ## Documentation Index
> Fetch the complete documentation index at: https://pond.dflow.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Multiple Markets in One Call

> Use POST /api/v1/markets/batch to fetch up to 100 markets by ticker and/or mint

<Info>
  During development, you can use the [developer endpoints](/get-started/endpoints) without an API key. For production use, [request an API key](/get-started/api-key) for higher rate limits.
</Info>

Use this instead of looping `GET /market/{ticker}`.

## Mixed ticker + mint lookup

Unknown IDs are dropped silently; the response only contains markets that resolved.

<AccordionGroup>
  <Accordion title="Batch lookup">
    ```typescript theme={null}
    import "dotenv/config";

    const DFLOW_METADATA_API_URL = process.env.DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net";
    const DFLOW_API_KEY = process.env.DFLOW_API_KEY; // optional; not needed for dev endpoints

    const headers: HeadersInit = { "Content-Type": "application/json" };
    if (DFLOW_API_KEY) headers["x-api-key"] = DFLOW_API_KEY;

    const res = await fetch(`${DFLOW_METADATA_API_URL}/api/v1/markets/batch`, {
      method: "POST",
      headers,
      body: JSON.stringify({
        tickers: ["MARKET_TICKER_1_HERE", "MARKET_TICKER_2_HERE"],
        mints: ["OUTCOME_OR_LEDGER_MINT_1_HERE", "OUTCOME_OR_LEDGER_MINT_2_HERE"],
      }),
    });

    const { markets, cursor } = await res.json();

    console.log(`Resolved ${markets.length} of the requested IDs`);
    for (const m of markets) {
      console.log(`  ${m.ticker}  status=${m.status}  yesBid=${m.yesBid ?? "n/a"}`);
    }
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  Combined cap is 100. Chunk client-side for larger lists.
</Tip>

## Build a positions dashboard

Feed `filter_outcome_mints` results straight into `markets/batch`:

<AccordionGroup>
  <Accordion title="filter_outcome_mints → markets/batch">
    ```typescript theme={null}
    // `tokenMints` is the list of SPL token mint addresses found in a wallet
    // (the `mint` field on each entry from connection.getParsedTokenAccountsByOwner).
    // These are NOT wallet addresses; they're token mint addresses.
    // See the Track Positions recipe for how to fetch them from a wallet.
    const tokenMints: string[] = [
      "SPL_TOKEN_MINT_1_HERE",
      "SPL_TOKEN_MINT_2_HERE",
    ];

    // Step 1: filter down to just the outcome token mints
    const filterRes = await fetch(`${DFLOW_METADATA_API_URL}/api/v1/filter_outcome_mints`, {
      method: "POST",
      headers,
      body: JSON.stringify({ addresses: tokenMints }),
    }).then((r) => r.json());

    const outcomeMints: string[] = filterRes.outcomeMints ?? [];

    if (outcomeMints.length > 0) {
      // Step 2: fetch the full market object for each in one call
      const batchRes = await fetch(`${DFLOW_METADATA_API_URL}/api/v1/markets/batch`, {
        method: "POST",
        headers,
        body: JSON.stringify({ mints: outcomeMints.slice(0, 100) }),
      }).then((r) => r.json());

      for (const market of batchRes.markets) {
        console.log(market.ticker, market.title, market.status);
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Related Resources

<CardGroup cols={2}>
  <Card title="Find Markets" href="/prediction-markets/recipes/find-markets" icon="search">
    Discover markets by category, tag, status, or series.
  </Card>

  <Card title="Identify a Market From a Mint" href="/prediction-markets/recipes/identify-market-by-mint" icon="bullseye">
    Reverse-lookup a market and side from any ledger or outcome mint.
  </Card>

  <Card title="Track User Positions" href="/prediction-markets/recipes/track-positions" icon="wallet">
    Full portfolio view with balances and market metadata.
  </Card>
</CardGroup>

## API Routes

* [`POST /api/v1/markets/batch`](/resources/metadata-api/markets/markets-batch)
* [`POST /api/v1/filter_outcome_mints`](/resources/metadata-api/markets/filter-outcome-mints)
