api-ninjas-com Exchange Rate API

The Exchange Rate API provides exchange rates on global currencies. Choose from hundreds of different currency pairs. Available endpoints: - GET /v1/exchangerate — current exchange rate for a given currency pair. - GET /v1/exchangeratehistorical — daily historical exchange rates back to 1999-01-01 (premium).

Operations 2

GET /v1/exchangerate Get exchange rate for a given currency pair #
GET /v1/exchangeratehistorical Get daily historical exchange rates for a given currency pair #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-exchange-rate-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-exchange-rate-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Exchange Rate API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Exchange Rate
  description: 'The Exchange Rate API provides exchange rates on global currencies. Choose from hundreds of different currency pairs.


    Available endpoints:

    - GET /v1/exchangerate — current exchange rate for a given currency pair.

    - GET /v1/exchangeratehistorical — daily historical exchange rates back to 1999-01-01 (premium).'
paths:
  /v1/exchangerate:
    get:
      tags:
      - Exchange Rate
      summary: Get exchange rate for a given currency pair
      description: Returns the current exchange rate for a currency `pair` such as USD_EUR. To convert a specific amount instead use /convertcurrency.
      operationId: getExchangeRate
      parameters:
      - $ref: '#/components/parameters/ExchangeRateOpenapi_pair'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
  /v1/exchangeratehistorical:
    get:
      tags:
      - Exchange Rate
      summary: Get daily historical exchange rates for a given currency pair
      description: Returns daily historical exchange rates for a given currency pair. Data is available from 1999-01-01 onward. Provide either a single date or a start_date/end_date range (max 366 days). Premium subscription required.
      operationId: getHistoricalExchangeRate
      parameters:
      - $ref: '#/components/parameters/ExchangeRateOpenapi_pair'
      - $ref: '#/components/parameters/ExchangeRateOpenapi_date'
      - $ref: '#/components/parameters/start_date'
      - $ref: '#/components/parameters/end_date'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalExchangeRateResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
components:
  parameters:
    end_date:
      in: query
      name: end_date
      required: false
      schema:
        type: string
        format: date
      description: End date of a range query (YYYY-MM-DD). Date range cannot exceed 366 days.
    start_date:
      in: query
      name: start_date
      required: false
      schema:
        type: string
        format: date
      description: Start date of a range query (YYYY-MM-DD). Must be used with end_date.
    ExchangeRateOpenapi_date:
      in: query
      name: date
      required: false
      schema:
        type: string
        format: date
      description: Single date to query (YYYY-MM-DD). Either date or both start_date and end_date must be provided.
    ExchangeRateOpenapi_pair:
      in: query
      name: pair
      required: true
      schema:
        type: string
      description: Currency pair to query. Must be in the form of currency1_currency2 (e.g. USD_EUR)
  schemas:
    ExchangeRateOpenapi_ErrorResponse:
      type: object
      properties:
        message:
          type: string
        code:
          type: integer
    HistoricalExchangeRateResponse:
      type: array
      items:
        $ref: '#/components/schemas/HistoricalExchangeRateItem'
    HistoricalExchangeRateItem:
      type: object
      properties:
        pair:
          type: string
          example: USD_EUR
        date:
          type: string
          format: date
          example: '2020-03-15'
        rate:
          type: number
          example: 0.896585
    ExchangeRateResponse:
      type: object
      properties:
        currency_pair:
          type: string
          example: GBP_AUD
        exchange_rate:
          type: number
          description: The exchange rate for the given currency pair.
          example: 1.88194
        rate:
          type: number
          example: 1.88194
        timestamp:
          type: integer
          description: Unix timestamp (in seconds) indicating the time at which the exchange rate was applied.
          example: 1777407695
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api