# Bitquery

Bitquery provides historical and real-time indexed data for over 40 blockchains through GraphQL APIs, Websockets, SQL, and cloud providers.

This is a first-class FlyMyAI MCP. Agents **discover it automatically** via tool search and call the actions below on demand - you never wire it up by hand. See the [Composio catalog](https://docs.flymy.ai/mcp/composio.md) for how discovery works.

## Connect

**Bitquery** authenticates with an API key. Generate the credential in your Bitquery account, then paste it into FlyMyAI the first time an agent uses a Bitquery action.

[Get your Bitquery credential →](https://account.bitquery.io/user/api_v2/access_tokens)

### Fields to fill in FlyMyAI

| Field | Details |
| --- | --- |
| `API Key` | The API key provided by Bitquery for authenticating API requests. _(required)_ |

## Actions

Every action this integration exposes. Agents pick the right one from the task; you do not call them by name.

| Action | What it does | Required inputs |
| --- | --- | --- |
| `BITQUERY_ALIASES_METRIC` | Tool to use graphql aliases to rename fields in the response for clarity and disambiguation. use when you need to query multiple metrics with identical field names in one call. | `query` |
| `BITQUERY_ARCHIVE_DATABASE_QUERY` | Tool to query the archive database. use when you need full historical blockchain data (delayed by tens of minutes to hours). | `query` |
| `BITQUERY_COMBINED_DATABASE_QUERY` | Tool to query the combined database, which merges archive and real-time databases. use when you need both historical and up-to-the-second blockchain data in one request. | `query` |
| `BITQUERY_CONDITIONAL_METRICS` | Tool to generate a graphql metric snippet with conditional logic. use when you need to apply filters directly on metric calculations via the 'if' attribute. | `operation`, `field`, `if` |
| `BITQUERY_COUNT_DISTINCT_METRIC` | Tool to use the count distinct metric to aggregate unique values for a field. use when you need to count the number of unique occurrences in a dataset. | `query` |
| `BITQUERY_COUNT_METRIC` | Tool to use the count metric to aggregate the number of records matching a graphql query. use when you need simple record counts. | `query` |
| `BITQUERY_DATABASE_SELECTION` | Tool to select the database (archive, realtime, combined) to query at the top level of a graphql request. use after determining whether you need live, historical, or combined blockchain data. | `dataset` |
| `BITQUERY_EARLY_ACCESS_PROGRAM_QUERY` | Tool to access streaming data across various blockchain networks for evaluation purposes. use when querying chains not available via the v2 endpoint; limited to real-time data only. | `query` |
| `BITQUERY_MEMPOOL_SUBSCRIPTION` | Tool to subscribe to real-time mempool updates for evm chains (ethereum, bnb, etc.). use after constructing your graphql subscription to stream pending transactions live. | `query` |
| `BITQUERY_NETWORK_SELECTION` | Tool to select the blockchain network for graphql queries. use before constructing dataset or metric queries to ensure the correct chain is targeted. | `network` |
| `BITQUERY_OPTIONS_QUERY` | Tool to fetch graphql dataset options via schema introspection. use when you need to discover root-level query fields and their arguments before building queries. | - |
| `BITQUERY_PRICE_ASYMMETRY_METRIC` | Tool to generate graphql priceasymmetry filter snippet. use when you need to filter trades based on price asymmetry metric. | - |
| `BITQUERY_QUANTILE_METRIC` | Tool to calculate quantiles to understand the distribution of numerical data. use when you need percentile metrics (e.g., median or quartiles) of a numerical field in a dataset. | `query` |
| `BITQUERY_REALTIME_DATABASE_QUERY` | Realtime database query | `query` |
| `BITQUERY_SELECT_BY_METRIC` | Tool to generate a graphql metric snippet filtering by its value using selectwhere. use when you need to include only metrics meeting specific value conditions (e.g., only positive sums). | `operation`, `of`, `selectWhere` |
| `BITQUERY_STATISTICS_METRIC` | Tool to compute statistical metrics (mean, median, etc.) over one variable in a dataset. use when you need precise summary statistics in your graphql query. | `query` |
| `BITQUERY_SUM_METRIC` | Tool to calculate the sum of a specified field's values across defined dimensions. use when you need to aggregate total values in a dataset. | `query` |
| `BITQUERY_UNIQ_METRIC` | Tool to estimate the count of unique values using the uniq metric. use when you need approximate or exact unique counts for analytics on blockchain datasets. | `query` |

## Links

- [Bitquery website](https://bitquery.io/)
- [Get API key / credential](https://account.bitquery.io/user/api_v2/access_tokens)
- [Browse the full Composio catalog](https://docs.flymy.ai/mcp/composio.md)
