> For the complete documentation index, see [llms.txt](https://xchainjs.gitbook.io/xchainjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xchainjs.gitbook.io/xchainjs/protocols/thorchain/xchain-midgard-query.md).

# xchain-midgard-query

This section for the XChain Midgard Query library elucidates the operational workflow and underlying mechanisms utilized to interact with the Midgard API and retrieve blockchain data.

The Midgard-query module utilizes the Midgard API to query the THORChain network. Midgard is a layer 2 REST API that offers front-end consumers semi real-time aggregated data and analytics. It serves as a buffer to handle most network requests, relieving the blockchain from processing large quantities of queries and allowing it to focus on transaction processing.&#x20;

Essentially, Midgard acts as a "read-only slave" to the chain, optimizing network resources.

For more information about the API of the package, please click [here](https://docs.xchainjs.org/xchain-docs/xchain-midgard-query/docs/index.html)
