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

# Health and limits

> How fresh the archive is, and the limits that apply to your requests. Start here. Read the limits from `access`.



## OpenAPI

````yaml /openapi/data-api.json get /v0/health
openapi: 3.1.0
info:
  title: Rekt data API
  version: '0'
  summary: Read-only HTTP API for settled trades and ended positions.
  description: >-
    `https://data.rekt.trading` serves settled trades and ended positions. It is
    read-only and it needs no account. It sets no cookies and accepts no
    credentials. Responses carry `Access-Control-Allow-Origin: *`. Start at `GET
    /v0/health`.


    The program is the ground of truth. This API is a lagging mirror of it. Read
    live state from the chain through the SDK.


    Rules:


    - Every route answers `GET`, `HEAD` and `OPTIONS`. Any other method gets
    `405`.

    - A request URL is at most 2,048 characters. A longer one gets `414`.

    - Requests are rate-limited for each client address. `GET /v0/health` states
    the limit under `access`. A request over it gets `429` and a `Retry-After`
    header. Wait that long, then retry.

    - This API ignores a parameter that it does not know. A filter that this API
    refuses gets `400`.

    - Money amounts are decimal strings of base units of USDC (6 decimals).
    Addresses are 64 hex characters unless a field says base58. Transaction
    signatures are base58.

    - A response can hold fields that this description does not list. Ignore a
    field that you do not know.
servers:
  - url: https://data.rekt.trading
    description: The data API.
security: []
tags:
  - name: Health
    description: Freshness and limits.
  - name: Aggregates
    description: All-time totals and day series.
  - name: Trades
    description: Settled trades of the last 48 hours.
  - name: Positions
    description: Ended positions of the last 48 hours.
  - name: Minute
    description: Minute rounds of the last 48 hours.
paths:
  /v0/health:
    get:
      tags:
        - Health
      summary: Health and limits
      description: >-
        How fresh the archive is, and the limits that apply to your requests.
        Start here. Read the limits from `access`.
      operationId: getHealth
      responses:
        '200':
          description: The health of the archive and the limits of the caller.
          headers:
            Cache-Control:
              description: '`public, max-age=10`.'
              schema:
                type: string
            Warning:
              description: >-
                Present only when `asOf.stale` is true. It states that the
                archive is stale.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthResponse'
        '414':
          $ref: '#/components/responses/UriTooLong'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    HealthResponse:
      type: object
      description: How fresh the archive is, and the limits that apply to the caller.
      properties:
        ok:
          type: boolean
          description: True when the server answers.
        program:
          type: string
          description: The program id that this API mirrors, in base58.
        groundOfTruth:
          type: string
          description: >-
            A statement, in words: the program is the ground of truth, and this
            API is a lagging mirror of it.
        asOf:
          $ref: '#/components/schemas/AsOf'
        era:
          $ref: '#/components/schemas/Era'
        access:
          type: object
          description: The limits that apply to the caller. Read the limits from here.
          properties:
            tier:
              type: string
              description: >-
                The access tier of the caller. It is `public` for a caller
                without a key.
              enum:
                - public
            perTransactionWindowHours:
              type:
                - integer
                - 'null'
              description: 'The window of the per-transaction routes. Unit: hours.'
            pageMax:
              type: object
              description: The largest page size.
              properties:
                trades:
                  type: integer
                  description: >-
                    The largest page of `/v0/trades` and `/v0/positions`. Unit:
                    rows.
                minuteRounds:
                  type: integer
                  description: 'The largest page of `/v0/minute/rounds`. Unit: rounds.'
            requestsPerMinute:
              type:
                - integer
                - 'null'
              description: >-
                The number of requests that one client address can send each
                minute. Unit: requests per minute.
            burst:
              type:
                - integer
                - 'null'
              description: >-
                The number of requests that one client address can send at one
                time. Unit: requests.
            aggregates:
              type: array
              items:
                type: string
              description: The routes that keep the whole history.
        routes:
          type: array
          items:
            type: string
          description: The routes that this API serves to the caller.
      required:
        - ok
        - program
        - groundOfTruth
        - asOf
        - era
        - access
        - routes
    AsOf:
      type: object
      description: How fresh the archive is at the time of this response.
      properties:
        generatedAt:
          type: string
          description: The time the server made this response, in UTC (ISO 8601).
          format: date-time
        archiveTailSlot:
          type:
            - integer
            - 'null'
          description: >-
            The slot of the newest transaction in the archive. Unit: slots. Null
            when the archive is empty.
        archiveTailAt:
          type:
            - string
            - 'null'
          description: >-
            The block time of the newest transaction in the archive, in UTC (ISO
            8601). Null when the archive is empty.
          format: date-time
        stale:
          type: boolean
          description: >-
            True when the archive has not moved for longer than its freshness
            limit. The server still sends a stale response, with a `Warning`
            header.
        staleReason:
          type:
            - string
            - 'null'
          description: Why the archive is stale, in words. Null when `stale` is false.
        entryFeeBasis:
          type: string
          description: >-
            How the entry fees in the rows were found. `observed` means each fee
            is the fee that the trade paid. Only the routes whose rows carry an
            entry fee send this field.
          enum:
            - observed
      required:
        - generatedAt
        - archiveTailSlot
        - archiveTailAt
        - stale
        - staleReason
    Era:
      type: object
      description: The first slot that this API counts.
      properties:
        firstSlot:
          type: integer
          description: >-
            Settlements before this slot belong to a different program id. No
            route counts them. Unit: slots.
      required:
        - firstSlot
    Error:
      type: object
      description: A refused request.
      properties:
        error:
          type: string
          description: What is wrong, in words.
        retryAfterSeconds:
          type: integer
          description: 'On `429` only: wait this long, then retry. Unit: seconds.'
        routes:
          type: array
          items:
            type: string
          description: 'On `404` for an unknown route only: the routes that this API serves.'
      required:
        - error
  responses:
    UriTooLong:
      description: The request URL is longer than 2,048 characters. Shorten it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: >-
        Too many requests. Wait `Retry-After` seconds, then retry. `GET
        /v0/health` states the limit under `access`.
      headers:
        Retry-After:
          description: 'Wait this long before you retry. Unit: seconds.'
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: The server could not answer. Retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

````

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