# Data API

Chamber runs a hosted GraphQL API that exposes vault-level and protocol-wide data. It's separate from the [subgraph](/build/subgraph.md), which runs per-chain Graph Protocol indexes.

Use this API when you want a single cross-chain endpoint for vault lists, token prices, and aggregate analytics without running your own indexer.

The endpoint is live, in production use (app backend, internal analytics), and introspection is enabled — so the full schema is self-describing. This page covers the common queries; use introspection (below) for the exhaustive list.

## Endpoint

```
POST https://api-v2.dhedge.org/graphql
```

* GraphQL over HTTPS, POST only
* `Content-Type: application/json`
* No authentication required — the endpoint is public. Rate limits may apply.

## Known queries

Use [introspection](#schema-introspection) for the full list and field-level types.

### Example: list vaults on a chain

**`allFundsByBlockchainCode(blockchainCode: String!)`** returns vaults on a given chain.

Response fields include: `address`, `managerLogicAddress`, `name`, `managerName`, `totalValue` (wei-scale integer string, 18-decimal USD).

```bash
curl -X POST https://api-v2.dhedge.org/graphql \
  -H "Content-Type: application/json" \
  -d '{"query":"{ allFundsByBlockchainCode(blockchainCode: \"POLYGON\") { address name managerName totalValue } }"}'
```

`blockchainCode` is an untyped string; confirmed working values include `POLYGON`, `OPTIMISM`, `ARBITRUM`, `BASE`, `MAINNET` (Ethereum), and `HYPEREVM`. The value is case-insensitive. Unrecognised codes may silently fall back to a default response rather than erroring, so validate the response before assuming a chain is wired in.

## Schema introspection

To get the full list of available queries, run schema introspection:

```bash
curl -X POST https://api-v2.dhedge.org/graphql \
  -H "Content-Type: application/json" \
  -d '{"query":"{__schema{queryType{fields{name description}}}}"}'
```

Introspection is enabled in production — this is the same API powering the Chamber app. For targeted schema exploration, a GraphQL client (GraphiQL, Insomnia, Apollo Sandbox) pointed at the endpoint gives you autocomplete and type info.

## When to use which

| Need                                                          | Use                                           |
| ------------------------------------------------------------- | --------------------------------------------- |
| List vaults across chains, single endpoint                    | Data API                                      |
| Deep per-chain indexed history (events, transfers, fee mints) | [Subgraph](/build/subgraph.md)                |
| Live vault state (current composition, NAV)                   | [SDK](/build/sdk.md) or direct contract calls |
| Prepare a deposit/withdraw tx                                 | [SDK](/build/sdk.md) or direct contract calls |

The Data API is the lightest read surface and covers the most chains (including HyperEVM). Reach for the subgraph when you need event-level history or custom GraphQL joins beyond what's exposed here, and the SDK / direct contracts when you need authoritative onchain reads (e.g. per-block NAV).

## See also

* [Subgraph](/build/subgraph.md) — per-chain indexes via The Graph
* [SDK](/build/sdk.md) — live onchain reads


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chamberfi.com/build/data-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
