# API Overview

HermesTrade exposes three distinct APIs. Each serves a different layer of the platform.

{% hint style="info" %}
**Live API documentation (Swagger UI):**

* CLOB API: <https://clob-api.hermestrade.xyz/docs>
* Gamma API: <https://gamma-api.hermestrade.xyz/docs>
* Relayer API: <https://relayer.hermestrade.xyz/docs>
  {% endhint %}

***

## The Three APIs

| API         | Base URL                            | Purpose                                                      | Auth required                                               |
| ----------- | ----------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------- |
| CLOB API    | `https://clob-api.hermestrade.xyz`  | Order book, trading, price data, account balances            | Public endpoints: No; Trading and account: Yes (L2 API key) |
| Gamma API   | `https://gamma-api.hermestrade.xyz` | Markets, events, profiles, sports games, auth                | Public endpoints: No; Profile and auth: Yes (Bearer JWT)    |
| Relayer API | `https://relayer.hermestrade.xyz`   | Safe smart wallet deployment, gasless transaction submission | Yes (RelayerAPIKey or Bearer JWT)                           |

For authentication details see:

{% content-ref url="/pages/UBsuaFuFt4H4PUjPnKg2" %}
[Authentication](/reference/authentication.md)
{% endcontent-ref %}

***

## Which API to use for common tasks

| Task                         | API         | Endpoint                                                         |
| ---------------------------- | ----------- | ---------------------------------------------------------------- |
| Browse markets and events    | Gamma API   | `GET /events`, `GET /markets/{id}`                               |
| Get order book snapshot      | CLOB API    | `GET /book`                                                      |
| Get current prices           | CLOB API    | `GET /price`, `GET /prices`                                      |
| Place or cancel orders       | CLOB API    | `POST /order`, `DELETE /order`, `POST /orders`, `DELETE /orders` |
| Get your trade history       | CLOB API    | `GET /trades`                                                    |
| Get your account balance     | CLOB API    | `GET /balance-allowance`                                         |
| Get or update your profile   | Gamma API   | `POST /profiles`, `GET /profiles/user_address/{user_address}`    |
| Submit a gasless transaction | Relayer API | `POST /submit`                                                   |
| Get sports game data         | Gamma API   | `GET /games`, `GET /games/{id}`                                  |

***

## Public historical data

HermesTrade does not have a dedicated analytics API. Public historical data is available via three CLOB API endpoints that require no authentication and support cursor-based pagination:

| Endpoint                | Data                               |
| ----------------------- | ---------------------------------- |
| `GET /all-orders`       | Full paginated order history       |
| `GET /all-trades`       | Full paginated trade history       |
| `GET /all-transactions` | Full paginated transaction history |

Use the `next_cursor` query parameter to page through results.

***

## Real-time data

WebSocket streams are not confirmed in any of the three OpenAPI specifications. For real-time data, poll the CLOB API at your desired frequency (e.g., `GET /book`, `GET /last-trade-price`). Contact the HermesTrade team to ask about WebSocket availability.

***

## SDK availability

No official HermesTrade SDK has been identified. API integration currently requires manual EIP-712 signing and HMAC header construction. Contact the HermesTrade team for updates.


---

# 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.hermestrade.xyz/reference/api-overview.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.
