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

# Price at-or-before a timestamp

> Returns the single most-recent 1m candle at or before `timestamp` (Unix ms) for the token's top-volume pair. Lookback window is 60 seconds — older queries return 404.

Resolution is fixed at `1m` (the highest-precision MV).



## OpenAPI

````yaml /api-reference/openapi.json get /price/history/timestamp
openapi: 3.1.0
info:
  title: Dexploit API
  version: 1.0.0
  description: Real-time and historical Solana DEX swap and OHLCV data.
servers:
  - url: https://api.dexploit.dev
    description: Production
security:
  - ApiKeyHeader: []
  - BearerAuth: []
  - ApiKeyQuery: []
paths:
  /price/history/timestamp:
    get:
      tags:
        - Price
      summary: Price at-or-before a timestamp
      description: >-
        Returns the single most-recent 1m candle at or before `timestamp` (Unix
        ms) for the token's top-volume pair. Lookback window is 60 seconds —
        older queries return 404.


        Resolution is fixed at `1m` (the highest-precision MV).
      operationId: getPriceHistoryTimestamp
      parameters:
        - name: token
          in: query
          required: true
          schema:
            type: string
          description: Token mint (base58).
        - name: timestamp
          in: query
          required: true
          schema:
            type: integer
            format: int64
          description: Unix epoch milliseconds.
      responses:
        '200':
          description: Single candle at-or-before timestamp
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceHistoryPoint'
        '400':
          description: Invalid token mint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: No pair found for token, or no candle within the 60s lookback window
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    PriceHistoryPoint:
      type: object
      description: Single OHLCV row. `volume_sol` is **lamports** (divide by 1e9 for SOL).
      properties:
        ts_ms:
          type: integer
          format: int64
          description: Bar start, Unix epoch milliseconds.
        open:
          type: number
        high:
          type: number
        low:
          type: number
        close:
          type: number
        volume_sol:
          type: integer
          format: int64
          description: '**Lamports**, despite the name. Divide by 1e9 for SOL.'
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: INVALID_PARAM
            message:
              type: string
              example: >-
                use pair_address; see /api/v1/pairs?token_address=X to discover
                pools
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Preferred for swaps-api endpoints (`/swaps/*`, `/stats/*`, `/trending`,
        `/pool-events`).
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Required by the OHLCV endpoints (`/api/v1/*`) and accepted by every
        other endpoint. Send `Authorization: Bearer ohlcv_live_sk_<your_key>`.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: >-
        Browser-friendly alternative to the Bearer header — accepted by every
        endpoint and required for WebSocket from the browser.

````