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

# Onchain Pair Data



## OpenAPI

````yaml open-apis/node.json get /node/v1/onchain/{base}/{quote}
openapi: 3.1.0
info:
  title: pragma-node
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://{environment}.pragma.build
    variables:
      environment:
        default: api.devnet
security: []
tags:
  - name: pragma-node
    description: Pragma Node API
paths:
  /node/v1/onchain/{base}/{quote}:
    get:
      tags:
        - crate::handlers::onchain::get_entry
      operationId: get_onchain_entry
      parameters:
        - name: base
          in: path
          description: Base Asset
          required: true
          schema:
            type: string
        - name: quote
          in: path
          description: Quote Asset
          required: true
          schema:
            type: string
        - name: network
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/StarknetNetwork'
        - name: aggregation
          in: query
          required: false
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/AggregationMode'
        - name: routing
          in: query
          required: false
          schema:
            type:
              - boolean
              - 'null'
        - name: timestamp
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int64
        - name: components
          in: query
          required: false
          schema:
            type:
              - boolean
              - 'null'
        - name: variations
          in: query
          required: false
          schema:
            type:
              - boolean
              - 'null'
      responses:
        '200':
          description: Get the onchain entry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOnchainEntryResponse'
components:
  schemas:
    StarknetNetwork:
      type: string
      enum:
        - starknet-mainnet
        - starknet-sepolia
    AggregationMode:
      type: string
      enum:
        - median
        - twap
    GetOnchainEntryResponse:
      type: object
      required:
        - pair_id
        - last_updated_timestamp
        - price
        - decimals
        - nb_sources_aggregated
        - asset_type
      properties:
        asset_type:
          type: string
        components:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/OnchainEntry'
        decimals:
          type: integer
          format: int32
          minimum: 0
        last_updated_timestamp:
          type: integer
          format: int64
          minimum: 0
        nb_sources_aggregated:
          type: integer
          format: int32
          minimum: 0
        pair_id:
          type: string
        price:
          type: string
        variations:
          type:
            - object
            - 'null'
          additionalProperties:
            type: number
            format: float
          propertyNames:
            type: string
            enum:
              - 100ms
              - 1s
              - 5s
              - 10s
              - 1min
              - 5min
              - 15min
              - 1h
              - 2h
              - 1d
              - 1w
    OnchainEntry:
      type: object
      required:
        - publisher
        - source
        - price
        - tx_hash
        - timestamp
      properties:
        price:
          type: string
        publisher:
          type: string
        source:
          type: string
        timestamp:
          type: integer
          format: int64
          minimum: 0
        tx_hash:
          type: string

````