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

# Hyperliquid SQL tables and columns

> GET /v1/query/schema lists the hl.* tables you can query with SQL, their columns, how far back each goes, example queries and your tier's limits.



## OpenAPI

````yaml GET /v1/query/schema
openapi: 3.1.0
info:
  title: Ironflow API
  version: 1.0.0
  description: >
    Hyperliquid market data from Ironflow's own nodes: tick-level fills and

    trades, candles, funding rates, liquidations, mark prices, open interest,

    markets and wallet analytics over REST, live Server-Sent Events streams and

    read-only SQL. One schema across native HL perps, HIP-3 builder markets,

    HIP-4 outcome contracts and HL spot.


    The same data is a hosted MCP server for AI agents at

    `https://mcp.ironflow.sh/mcp`, and agents with a USDC wallet on Base can pay

    per call with x402, no key: the data GET endpoints are also served at

    `/x402/v1/...` (discovery: `https://api.ironflow.sh/openapi.json` and

    `https://api.ironflow.sh/.well-known/x402`).


    **Base URL:** `https://api.ironflow.sh`


    **Authentication:** Read endpoints work without a key (keyless access) or

    with a Bearer token in the `Authorization` header. Writes always need a key.

    ```

    Authorization: Bearer if_your_api_key

    ```

    Get a free key at https://ironflow.sh/key.


    **Access levels:**


    | Access | Requests per minute | History | Max range per request |

    |---|---|---|---|

    | No key | 30 per IP (2,000 a day) | 24 hours | 1 hour |

    | Free key | 60 | 30 days | 6 hours |

    | Explorer | 100 | 90 days | 24 hours |

    | Builder | 1,000 | 1 year | 7 days |

    | Enterprise | 10,000 | full | unlimited |


    Without a market filter, high-volume endpoints allow at most 4 hours per
    request.

    `/v1/trades` filtered to one perp or spot market allows 24 hours per request

    without a key and on a free key.

    A header that is present but malformed returns 401; keyless access applies
    only

    when no `Authorization` header is sent.


    **Data availability:** fills and trades start on 25 May 2025; other

    datasets start later (funding 2025-09-27, open interest and mark prices

    2026-04-29). Bulk history is free to download from

    https://huggingface.co/ironflow.


    **Timestamps:** All timestamps are Unix milliseconds (int64).


    **Pagination:** Paginated endpoints return a `cursor` in
    `pagination.next_cursor`.

    Pass it as the `cursor` query parameter to fetch the next page.

    When `pagination.has_more` is `false`, you have reached the last page.


    **Notices:** a successful JSON object may start with `notice`, the

    `X-Ironflow-Notice` header in the body: what was served when it differs from

    what was asked (a keyless sample, a shortened history, a guessed path) and

    how to get the rest.


    **Guessed paths:** a few paths callers guess are answered by the endpoint

    they mean, with a `notice` and the `X-Ironflow-Canonical` header naming it:

    `/v1/liquidations/aggregate`, `/v1/summary/liquidations` and similar by

    `/v1/liquidations/summary`, `/v1/liquidations/buckets` and `heatmap` by

    `/v1/analytics/liquidation-levels`, and `/v1/liquidations/map/BTC-PERP` by

    `/v1/liquidations/map?market=BTC-PERP`. A path with trailing `.`, `,`, `;`
    or

    `)` (`/v1/query.`, copied from a sentence) is answered by the endpoint
    without

    them, with the same method, query and body. OpenAI-style paths
    (`/v1/models`,

    `/v1/chat/completions`) answer 404: this is not an LLM API, and agents use
    the

    MCP server above.
  contact:
    name: Ironflow Support
    url: https://ironflow.sh
servers:
  - url: https://api.ironflow.sh
    description: Production
security:
  - bearerAuth: []
  - {}
tags:
  - name: Market Data
    description: Historical tick-level market data stored in ClickHouse.
  - name: Analytics
    description: >-
      Aggregated analytics. Net flows, funding stats and the liquidation map
      markets work without a key; liquidation levels, the liquidation map and
      the vault leaderboard return a sample without one; order flow needs a key
      (a free key works).
  - name: Cohorts
    description: Predefined and custom address groups for filtering market data.
  - name: Alerts
    description: >-
      Liquidation alerts that Ironflow posts to your webhook, Discord channel,
      Slack channel or Telegram chat.
  - name: Ironbox
    description: >-
      Secure, sandboxed environments in Tokyo, next to Hyperliquid, where a
      trading agent runs with Ironflow's data, analytics, alerts and execution.
      Any API key, free included.
  - name: Query
    description: >-
      Read-only ClickHouse SQL over curated Hyperliquid tables (hl.*), limited
      by tier.
  - name: Billing
    description: >-
      Paid plans, paid in USDC on Hyperliquid or with x402 on Base. No card, no
      account page.
  - name: System
    description: Health checks and metadata endpoints.
  - name: TradingApp
    description: >-
      The trading terminal's own endpoints (terminal.ironflow.sh),
      wallet-session auth. Not part of the public data API; left out of the docs
      copy.
paths:
  /v1/query/schema:
    get:
      tags:
        - Query
      summary: Describe the queryable tables
      description: >
        Returns the `hl.*` tables with column names, types and descriptions, how
        far back

        each table goes, query tips, worked example queries, the caller's own
        limits and

        every tier's limits. Read this before writing SQL for `POST /v1/query`.
      operationId: getQuerySchema
      responses:
        '200':
          description: The catalog.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryCatalog'
              example:
                dialect: >-
                  ClickHouse SQL (read-only). Tables live in the hl database:
                  write hl.fills, hl.funding, and so on.
                tables:
                  - name: hl.funding
                    description: Hourly funding rate per perp market, native and HIP-3.
                    time_column: ts
                    data_from: '2025-09-27'
                    columns:
                      - name: ts
                        type: DateTime64 UTC
                        description: Event time
                      - name: rate
                        type: Float64
                        description: Funding rate for that hour as a fraction.
                tips:
                  - Always filter hl.fills on ts, and on market when you can.
                examples:
                  - question: >-
                      Which perps pay the most extreme funding right now,
                      annualized?
                    sql: >-
                      SELECT market, argMax(rate, ts) AS last_rate FROM
                      hl.funding WHERE ts > now() - INTERVAL 2 HOUR GROUP BY
                      market ORDER BY abs(last_rate) DESC LIMIT 10
                limits:
                  history_days: 1
                  max_execution_seconds: 5
                  max_rows: 1000
                  budget_seconds_per_hour: 60
                tiers:
                  - tier: anon
                    history_days: 1
                    max_execution_seconds: 5
                    max_rows: 1000
                    budget_seconds_per_hour: 60
      security:
        - {}
        - bearerAuth: []
components:
  schemas:
    QueryCatalog:
      type: object
      required:
        - dialect
        - tables
        - tips
        - examples
        - limits
        - tiers
      properties:
        dialect:
          type: string
        tables:
          type: array
          items:
            type: object
            required:
              - name
              - description
              - time_column
              - data_from
              - columns
            properties:
              name:
                type: string
              description:
                type: string
              time_column:
                type: string
              data_from:
                type: string
                description: Earliest data kept
                or a rolling window.: null
              columns:
                type: array
                items:
                  type: object
                  required:
                    - name
                    - type
                    - description
                  properties:
                    name:
                      type: string
                    type:
                      type: string
                    description:
                      type: string
        tips:
          type: array
          items:
            type: string
        examples:
          type: array
          items:
            type: object
            required:
              - question
              - sql
            properties:
              question:
                type: string
              sql:
                type: string
        limits:
          $ref: '#/components/schemas/QueryLimits'
        tiers:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/QueryLimits'
              - type: object
                required:
                  - tier
                properties:
                  tier:
                    type: string
    QueryLimits:
      type: object
      required:
        - history_days
        - max_execution_seconds
        - max_rows
        - budget_seconds_per_hour
      properties:
        history_days:
          type: integer
          description: How far back every hl.* view reaches.
        max_execution_seconds:
          type: integer
          description: Time limit for one query.
        max_rows:
          type: integer
          description: Most rows one response returns.
        budget_seconds_per_hour:
          type: integer
          description: Query time one caller may use per clock hour.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Ironflow API key, format `if_xxxx`. Free keys at
        https://ironflow.sh/key. Optional on read endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.