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

# Hexagraph GraphQL API: Endpoint, Playground & Rate Limits

> Introduction to the Hexagraph GraphQL gateway. Access the interactive playground, send programmatic queries, and learn when to choose GraphQL over REST.

Hexagraph provides a code-first GraphQL API at `https://api.hexagraph.in/graphql`. The same URL serves an interactive Apollo playground for exploring the schema and running queries directly in your browser — no setup or authentication required.

## Interactive Playground

Visit **[https://api.hexagraph.in/graphql](https://api.hexagraph.in/graphql)** in your browser to open the Apollo Sandbox playground. From there you can:

* Write and execute GraphQL queries against live data
* Browse every available type, field, and argument via the **Docs** panel on the right
* Inspect full response payloads alongside your queries
* Copy queries directly into your application code once you've validated them

No API key or login is needed — just open the URL and start querying.

## Endpoint

All GraphQL requests are sent as HTTP `POST` to a single endpoint:

| Property         | Value                              |
| ---------------- | ---------------------------------- |
| **URL**          | `https://api.hexagraph.in/graphql` |
| **Method**       | `POST`                             |
| **Content-Type** | `application/json`                 |

Queries are delivered in the request body as a JSON object with a `query` key:

```json theme={null}
{
  "query": "{ output(id: \"HX_W2107277218\") { id title year } }"
}
```

## Sending Queries

Use any HTTP client to send queries programmatically. Here's a minimal `curl` example that fetches a work by its HX\_W identifier:

```bash theme={null}
curl -X POST https://api.hexagraph.in/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "{ output(id: \"HX_W2107277218\") { id title year } }"}'
```

For multi-line or complex queries, consider using a dedicated GraphQL client library (e.g. `graphql-request` for Node.js, `gql` + `httpx` for Python) which handles escaping and query formatting automatically.

## Available Query Types

Hexagraph exposes three top-level queries:

| Query            | Description                                                                     |
| ---------------- | ------------------------------------------------------------------------------- |
| `output(id)`     | Fetch a single scholarly work by its `HX_W` identifier                          |
| `outputs(query)` | Search and filter scholarly works using full-text search and filter expressions |
| `author(id)`     | Fetch a researcher profile by its `HX_A` identifier                             |

Full argument and field documentation for each query is available on the [Queries](/api-reference/graphql/queries) reference page.

## When to Use GraphQL vs REST

**Choose GraphQL when:**

* You need data from multiple entity types (e.g. a work and its authors) in a single network round-trip
* You want to select only the fields your application needs, reducing payload size and over-fetching
* You're building a new integration and want to explore the schema interactively before writing code

**Choose REST when:**

* You need simple, easily cacheable `GET` requests at the HTTP layer
* You're running high-volume queries against a single, well-known endpoint and don't need field selection

## Rate Limits

The same rate limits apply to all GraphQL requests:

| Limit          | Value          |
| -------------- | -------------- |
| **Per minute** | 30 requests    |
| **Per day**    | 1,000 requests |

A single GraphQL query that fetches multiple entities — for example, one `output` and one `author` in the same request body — counts as **one request** against both limits.

<Tip>
  Batching multiple lookups into a single GraphQL query is the most efficient way to stay within rate limits. Instead of sending separate requests for each entity, combine them into one query and fetch everything you need in a single round-trip. See [Batching Multiple Queries](/api-reference/graphql/queries#batching-multiple-queries) for an example.
</Tip>
