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

# Getting Started

> The GraphQL API is now deprecated following the Berkeley hard fork. It may be removed at any time.

The MinaExplorer GraphQL API is an implementation of an archive service to return the full chain history via a GraphQL API. It maintains a familiar interface to the Mina node's [GraphQL API](https://minaprotocol.com/docs/developers/graphql-api) but has the advantages:

* It returns all blocks on the chain rather than `k` blocks (without relying on an archive node).
* It offers extensive querying and filtering capabilities for block, transaction and snark worker data.
* It is much more performant that an equivalent `bestChain` query to extract blocks.
* It removes the need to host an archive node, or build a custom API to extract archived data.
* Can act as a backup for other archive node implementations as can recreate original GraphQL `blocks` subscription response.

> The GraphQL API is available via **[graphql.minaexplorer.com](https://graphql.minaexplorer.com)**

## Authorization

Currently the GraphQL API is unauthorized and allows public access. Requests are throttled to prevent abuse and we reserve the right to change the authorization mechanism in the future, depending on usage. The current limit for all unauthenticated users is **10000** requests per second with a burst of **5000** requests.

For users who wish to authenticate requests to avoid any potential rate limiting please [contact us](https://docs.minaexplorer.com/minaexplorer/get-help).

## Collection

The following archived data is exposed:

* [Blocks](#) - containing the full block output including embedded user commands and snark work
* [Transactions](#) - only user commands collection which are split out for easier querying and filtering
* [Snarks](#) - only snark work which are split out for easier querying and filtering
* [Current Staking Ledger ](#)- the current staking ledger, including querying for determining delegations
* Next Staking Ledger - the next staking ledger. Only available after 290 blocks of the current epoch.

## Schema

* [Mainnet](https://storage.googleapis.com/mina-explorer-data/schema.graphql)

## Making Your First Query

The easiest way to construct a query is via the [GraphiQL interface](https://graphql.minaexplorer.com/). For a sample query, let's get the latest canonical block on the chain and see who won it. Visit the blocks documentation to learn more about querying and options available.

As you continue to explore the GraphQL API consider using [graphqurl](https://github.com/hasura/graphqurl#steps-to-install-cli) (demonstrated below) or a standalone client such as [Altair](https://altair.sirmuel.design/), as using cURL soon gets unweildy!

```json theme={null}
{
  blocks(limit: 1, sortBy: DATETIME_DESC, query:{canonical: true}) {
    stateHash
    protocolState {
      consensusState {
        blockHeight
      }
    }
    winnerAccount {
      publicKey
    }
    creatorAccount {
      publicKey
    }
    transactions {
      coinbase
    }
  }
}
```

```json theme={null}
{
  "data": {
    "blocks": [
      {
        "creatorAccount": {
          "publicKey": "B62qks6ervvF2M6KaZAQA6iTRmudeVNRBpvPKD3865ctnuVLU15RBjT"
        },
        "protocolState": {
          "consensusState": {
            "blockHeight": "4699"
          }
        },
        "stateHash": "3NKvPX8HYb8jvE6BBhFpJ2apXHFu6N1W5T1Zwhhg6jyovHJXX4e6",
        "transactions": {
          "coinbase": "400000000000"
        },
        "winnerAccount": {
          "publicKey": "B62qpCdnMgLC5YzXM3qrqybsqHB35UFHHt9muUDuAm2d1ny1ZqEDJzh"
        }
      }
    ]
  }
}__ Click to edit code
```

```bash theme={null}
gq https:__graphql.minaexplorer.com \\
     --singleLine \\
     -q 'query {
  blocks(limit: 1, sortBy: DATETIME_DESC, query:{canonical: true}) {
    stateHash
    protocolState {
      consensusState {
        blockHeight
      }
    }
    winnerAccount {
      publicKey
    }
    creatorAccount {
      publicKey
    }
    transactions {
      coinbase
    }
  }
}'
```

> This service does not aim to replicate all functionality of the Mina GraphQL API and does not return pending data or account information, which you will have to get from a node running the GraphQL API or via a [public proxy](https://minagraph.com/graphql).
