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

# Top fintech startups

> A 20-line recipe that fetches the 10 most-funded fintech startups via the Dealroom API. Token exchange + filter + sort + limit, in cURL, Node.js, and Python.

The shortest end-to-end query you can run against the Dealroom API. Authenticates with
your M2M API key, fetches the 10 most-funded companies tagged `fintech`, and prints them.

Adapt by swapping the industry, sort key, or limit — every other example in this site
builds on the same primitives.

<Note>
  The Dealroom API filters industries by **numeric tag ID**, not by name. Look up the ID
  for your target industry first:

  ```bash theme={null}
  curl "https://api-next.dealroom.co/api/reference/filters/tag_id/values?q=fintech&type=industry" \
    -H "Authorization: Bearer $ACCESS_TOKEN"
  ```

  The response includes `id` fields — use those in `tag_id[in_any]:<id>` expressions.
  The snippets below use `<FINTECH_TAG_ID>` as a placeholder.
</Note>

## Prerequisites

* A Dealroom **M2M** API key. See [Authentication](/mintlify/getting-started/authentication)
  to create one.
* `DEALROOM_CLIENT_ID` and `DEALROOM_CLIENT_SECRET` exported as environment variables.
* [`jq`](https://jqlang.github.io/jq/) for the cURL snippet (token extraction and output
  formatting). The Node.js and Python variants don't require it.

## The recipe

<CodeGroup>
  ```bash cURL theme={null}
  # 1. Exchange credentials for a Bearer token
  ACCESS_TOKEN=$(curl -s -X POST "https://accounts.dealroom.co/oauth/token" \
    -H "Content-Type: application/json" \
    -d "{
      \"client_id\": \"$DEALROOM_CLIENT_ID\",
      \"client_secret\": \"$DEALROOM_CLIENT_SECRET\",
      \"audience\": \"https://api-next.dealroom.co\",
      \"grant_type\": \"client_credentials\"
    }" | jq -r '.access_token')

  # 2. Fetch + print the top 10
  curl -s "https://api-next.dealroom.co/api/data/entities?filter=tag_id[in_any]:<FINTECH_TAG_ID>&sort=-total_funding&limit=10" \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "X-Client-Id: $DEALROOM_CLIENT_ID" \
    | jq -r '.data[] | "\(.name) — $\(.funding_summary.total_funding // 0)"'
  ```

  ```typescript Node.js theme={null}
  import { ClientCredentials } from "simple-oauth2";

  const CLIENT_ID = process.env.DEALROOM_CLIENT_ID!;
  const CLIENT_SECRET = process.env.DEALROOM_CLIENT_SECRET!;

  const oauth = new ClientCredentials({
    client: { id: CLIENT_ID, secret: CLIENT_SECRET },
    auth: { tokenHost: "https://accounts.dealroom.co", tokenPath: "/oauth/token" },
  });
  const token = await oauth.getToken({ audience: "https://api-next.dealroom.co" });

  const params = new URLSearchParams({
    filter: "tag_id[in_any]:<FINTECH_TAG_ID>",
    sort: "-total_funding",
    limit: "10",
  });

  const response = await fetch(`https://api-next.dealroom.co/api/data/entities?${params}`, {
    headers: {
      Authorization: `Bearer ${token.token.access_token}`,
      "X-Client-Id": CLIENT_ID,
    },
  });
  const { data } = await response.json();

  for (const company of data) {
    const funding = Number(company.funding_summary?.total_funding ?? 0);
    console.log(`${company.name} — $${funding.toLocaleString()}`);
  }
  ```

  ```python Python theme={null}
  import os
  from authlib.integrations.requests_client import OAuth2Session

  CLIENT_ID = os.environ["DEALROOM_CLIENT_ID"]
  CLIENT_SECRET = os.environ["DEALROOM_CLIENT_SECRET"]

  session = OAuth2Session(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)
  session.headers.update({
      "X-Client-Id": CLIENT_ID,
  })
  session.fetch_token(
      url="https://accounts.dealroom.co/oauth/token",
      grant_type="client_credentials",
      audience="https://api-next.dealroom.co",
  )

  response = session.get(
      "https://api-next.dealroom.co/api/data/entities",
      params={
          "filter": "tag_id[in_any]:<FINTECH_TAG_ID>",
          "sort": "-total_funding",
          "limit": 10,
      },
  )

  for company in response.json()["data"]:
      summary = company.get("funding_summary") or {}
      funding = float(summary.get("total_funding") or 0)
      print(f"{company['name']} — ${funding:,.0f}")
  ```
</CodeGroup>

## Expected output

```text theme={null}
Stripe — $9,123,000,000
Klarna — $4,500,000,000
Revolut — $1,700,000,000
...
```

Exact companies and amounts will vary as new funding events land in the dataset.

## What this example covers

| Concept                         | Where it shows up                                        |
| ------------------------------- | -------------------------------------------------------- |
| OAuth2 client-credentials grant | The token-exchange step                                  |
| Required headers                | `Authorization`, `X-Client-Id`                           |
| Filter expression               | `filter=tag_id[in_any]:<FINTECH_TAG_ID>`                 |
| Sort with descending direction  | `sort=-total_funding`                                    |
| Pagination                      | `limit=10` (use `offset` for subsequent pages)           |
| Optional fields                 | `funding_summary.total_funding` may be `null` — coalesce |

## Where to go from here

* Swap the tag ID for any other industry — use `/api/reference/filters/tag_id/values?type=industry` to discover tag IDs. See the [Filters reference](/mintlify/references/filters-and-sorting) for the full operator list.
* Combine filters with `and()` / `or()` — see [Filtering](/mintlify/concepts/filtering).
* Compute totals or rankings server-side instead of paging — see [Aggregates](/mintlify/concepts/aggregates).
* Build a full dashboard around this data — see the [Portfolio Dashboard](/mintlify/examples/portfolio-dashboard) example.
