# Developer Endpoints

Stay updated with health checks and notifications through our [Discord](https://discord.com/).

Detailed documentation is available in the [THORChain Dev Docs](https://docs.thorchain.org/).

***

### THORChain Public Endpoints

#### Mainnet

* **RPC**:
  * <https://gateway.liquify.com/chain/thorchain_rpc>
  * <https://rpc-thorchain.rorcual.xyz>
  * <https://thorchain.ibs.team/rpc/>
* **gRPC**:
  * <https://grpc-thorchain.rorcual.xyz>
  * [https://thorchain.ibs.team:443](https://thorchain.ibs.team)
* **RPC REST API**:
  * <https://gateway.liquify.com/chain/thorchain_api>
  * [https://api-thorchain.rorcual.xyz](https://api-thorchain.rorcual.xyz/)
  * <https://thorchain.ibs.team/api/>
* **Midgard REST API**: <https://gateway.liquify.com/chain/thorchain_midgard>

#### Stagenet (discontinued)

* **RPC**: [stagenet-rpc.ninerealms.com](https://stagenet-rpc.ninerealms.com/)
* **gRPC:** [stagenet-grpc.ninerealms.com:443](https://stagenet-grpc.ninerealms.com)
* **Midgard REST API**: [stagenet-midgard.ninerealms.com](https://stagenet-midgard.ninerealms.com/)

***

### Rujira Ecosystem APIs

#### GraphQL API

High-performance API for extensive data across the Rujira ecosystem:

* **Mainnet**: [api.rujira.network/api/graphiql](https://api.rujira.network/api/graphiql)
* **Stagenet**: <https://api-preview.rujira.network/api/graphiql>
* **Docs:** Embedded inside the above links.
* **API key:** Email <api@rujira.network> to request an API key.

For GraphQL subscriptions and real-time data streaming, use a **Phoenix Socket-based connection** instead of HTTP. This ensures low-latency, bidirectional communication with Rujira’s endpoints. A working example is available [here](https://gitlab.com/thorchain/rujira-ui/-/blob/dev/packages/main/src/services/relay.tsx), which:

* Initializes a Phoenix Socket instance (`PhoenixSocket` from `phoenix`).
* Wraps it with `@absinthe/socket` for Relay-compatible GraphQL subscriptions.
* Includes fallback compatibility fixes for outdated libraries.

#### REST API

For RUJI Trade DEX and RUJI token supply integrations:

* **Mainnet**: [Trade](https://api.rujira.network/api/trade/), [RUJI](https://api.rujira.network/api/ruji/)
* **Stagenet**: [Trade](https://preview-api.rujira.network/api/trade/), [RUJI](https://preview-api.rujira.network/api/ruji/)
* **Docs:** [Rujira's REST API](https://docs.rujira.network/developers/developer-endpoints/rujira-rest-api)

For a more comprehensive solution, use our [GraphQL API](#graphql-api).

***

### Endpoint Testing

**RPC/API Endpoints:**

```bash
curl -X GET https://<endpoint>/status
```

**gRPC Endpoints:**

```bash
grpcurl <grpc-endpoint> list
```


---

# 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.rujira.network/developers/developer-endpoints.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.
