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

# REST API: V2 pool price history (candlesticks)

> Query historical candlestick conversion rates for a SaucerSwap V2 pool between two unix-second timestamps, with optional inversion of the pair.



## OpenAPI

````yaml GET /v2/pools/conversionRates/{poolId}
openapi: 3.0.4
info:
  title: SaucerSwap REST API
  version: 1.0.0
servers:
  - url: https://api.saucerswap.finance
    description: Mainnet
  - url: https://test-api.saucerswap.finance
    description: Testnet
security:
  - ApiKeyAuth: []
paths:
  /v2/pools/conversionRates/{poolId}:
    get:
      tags:
        - SaucerSwap V2
      summary: Get historical candlestick data for V2 pool by id
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - name: poolId
          description: Saucerswap pool id
          in: path
          required: true
          schema:
            type: integer
            example: 1
        - name: from
          in: query
          required: true
          schema:
            type: integer
            example: 1697600000
            description: From unix seconds
        - name: to
          in: query
          required: true
          schema:
            type: integer
            example: 1697610000
            description: To unix seconds
        - name: interval
          in: query
          description: Data interval
          required: true
          schema:
            type: string
            example: HOUR
            enum:
              - FIVEMIN
              - HOUR
              - DAY
              - WEEK
        - name: inverted
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CandlestickData'
components:
  parameters:
    ApiKeyParam:
      name: x-api-key
      in: header
      required: true
      schema:
        type: string
        example: YOUR_API_KEY
      description: >-
        API key for authentication. Request a key from
        support@saucerswap.finance.
  schemas:
    CandlestickData:
      type: object
      properties:
        poolId:
          type: integer
          example: 1
          description: Saucerswap pool id
        open:
          type: number
          example: 0.0482115316666979
          description: >-
            The open price of the token in tinybars (i.e. first minutely
            observation over the INTERVAL)
        high:
          type: number
          example: 0.0482115316666979
          description: The high price of the token over the INTERVAL, in tinybars
        low:
          type: number
          example: 0.04819650172584323
          description: The low price of the token over the INTERVAL, in tinybars
        close:
          type: number
          example: 0.04819650172584323
          description: The close price of the token over the INTERVAL, in tinybars
        avg:
          type: number
          example: 118.56339424557434
          description: The (minutely) avg price of the token over the INTERVAL, in tinybars
        volume:
          type: string
          example: '0'
          description: >-
            The sum of total volume traded of the token over the INTERVAL, in
            tinybars
        liquidity:
          type: string
          example: '9668737245792'
          description: >-
            The point in time liquidity of the token, as of timestampSeconds
            (the end timestamp of the INTERVAL), in tinybars
        volumeUsd:
          type: string
          example: '0'
          description: >-
            The sum of total volume traded of the token over the INTERVAL, in
            USD
        liquidityUsd:
          type: string
          example: '4653.53'
          description: >-
            The point in time liquidity of the token, as of timestampSeconds
            (the end timestamp of the INTERVAL), in USD
        timestampSeconds:
          type: integer
          example: 1697618460
          description: The end unix timestamp of the INTERVAL, in seconds
        startTimestampSeconds:
          type: integer
          example: 1697616000
          description: The start unix timestamp of the INTERVAL, in seconds
      required:
        - poolId
        - open
        - high
        - low
        - close
        - avg
        - volume
        - liquidity
        - volumeUsd
        - liquidityUsd
        - timestampSeconds
        - startTimestampSeconds
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key provisioned by the SaucerSwap team. Request one from
        support@saucerswap.finance and send it in the x-api-key header with
        every request.

````