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

# Get Exchange Rate

> Returns the stored exchange rate for the given `source_currency` and `dest_currency` from the `exchange_rates` table. Requires the `read` permission on the API key. Both parameters must be valid currency codes in Wallbit. If both codes are identical, the response returns a rate of `1.0` with `updated_at` null (no database row required). If the pair does not exist in the table, the API responds with 404.



## OpenAPI

````yaml GET /api/public/v1/rates
openapi: 3.0.3
info:
  title: Wallbit Public API
  description: >-
    Wallbit Public API allows developers to integrate Wallbit functionality into
    their applications. Access account balances, view transaction history, and
    execute trades programmatically using API Keys.
  version: 1.0.0
  contact:
    name: Wallbit API Support
    email: dev@wallbit.io
servers:
  - url: https://api.wallbit.io
    description: Production server
  - url: http://localhost
    description: Local development server
security:
  - apiKey: []
tags:
  - name: Balance
    description: Endpoints to retrieve account balances
  - name: Transactions
    description: Endpoints to retrieve transaction history
  - name: Trades
    description: Endpoints to execute trading operations
  - name: Fees
    description: >-
      Endpoints to retrieve fee configuration for the authenticated user (e.g.
      stock trading fees by subscription tier)
  - name: Account Details
    description: Endpoints to obtain bank account details
  - name: Wallets
    description: Endpoints to obtain wallet addresses
  - name: Rates
    description: Endpoints to retrieve fiat exchange rates from Wallbit
  - name: Assets
    description: Endpoints to query information about assets (stocks) and categories
  - name: Operations
    description: Endpoints for deposit and withdrawal investment operations
  - name: Cards
    description: Endpoints to block and unblock cards
  - name: API Key
    description: Endpoints to revoke the API key used for authentication
paths:
  /api/public/v1/rates:
    get:
      tags:
        - Rates
      summary: Get exchange rate for a currency pair
      description: >-
        Returns the stored exchange rate for the given `source_currency` and
        `dest_currency` from the `exchange_rates` table. Requires the `read`
        permission on the API key. Both parameters must be valid currency codes
        in Wallbit. If both codes are identical, the response returns a rate of
        `1.0` with `updated_at` null (no database row required). If the pair
        does not exist in the table, the API responds with 404.
      operationId: getPublicExchangeRate
      parameters:
        - name: source_currency
          in: query
          required: true
          description: Source currency code (must exist in Wallbit currencies)
          schema:
            type: string
            example: ARS
        - name: dest_currency
          in: query
          required: true
          description: Destination currency code (must exist in Wallbit currencies)
          schema:
            type: string
            example: USD
      responses:
        '200':
          description: Exchange rate found, or identity pair (rate 1.0)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PublicExchangeRate'
              examples:
                from-table:
                  summary: Rate from exchange_rates
                  value:
                    data:
                      source_currency: ARS
                      dest_currency: USD
                      pair: ARSUSD
                      rate: 1481.02
                      updated_at: '2026-02-25T01:50:04+00:00'
                identity:
                  summary: Same source and destination
                  value:
                    data:
                      source_currency: USD
                      dest_currency: USD
                      pair: USDUSD
                      rate: 1
                      updated_at: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: No exchange rate row for this pair
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Exchange rate not found for this currency pair.
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - apiKey: []
components:
  schemas:
    PublicExchangeRate:
      type: object
      description: Exchange rate row exposed by the public API
      properties:
        source_currency:
          type: string
          description: Source currency code
          example: ARS
        dest_currency:
          type: string
          description: Destination currency code
          example: USD
        pair:
          type: string
          description: Concatenated pair key (source + destination)
          example: ARSUSD
        rate:
          type: number
          format: float
          description: >-
            Conversion rate from source to destination. When both currencies are
            equal, always 1.0.
          example: 1481.02
        updated_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Last update time of the rate in the database (ISO 8601). Null for
            identity pairs (no row).
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
        error:
          type: string
          description: Error description
    ValidationError:
      type: object
      properties:
        message:
          type: string
          description: Error message
        errors:
          type: object
          description: Field-specific validation errors
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthorized:
      description: Missing or invalid API Key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: Missing API Key
              value:
                message: API Key required. Please provide X-API-Key header.
            invalid:
              summary: Invalid API Key
              value:
                message: Invalid or expired API Key.
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              your_permissions:
                type: array
                items:
                  type: string
          example:
            message: 'Insufficient permissions. Required permission: read'
            your_permissions:
              - trade
    ValidationError:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
          example:
            message: The given data was invalid.
            errors:
              symbol:
                - The symbol field is required.
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              retry_after:
                type: integer
                description: Seconds until rate limit resets
          example:
            message: Too many requests. Please try again later.
            retry_after: 42
      headers:
        X-RateLimit-Limit:
          description: Total requests allowed per minute
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests remaining in current window
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix timestamp when rate limit resets
          schema:
            type: integer
        Retry-After:
          description: Seconds to wait before retry
          schema:
            type: integer
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-API-Key
      in: header
      description: >-
        API Key authentication. Obtain your API key from the Wallbit dashboard
        under Settings → API Keys.

````