Pair Requests

Documentation for the Pair ExchangeRate-API endpoint.

To use our Pair endpoint simply make the substitutions explained below and then send a GET request.

• Substitute `YOUR-API-KEY` with the API key displayed in your dashboard.

• Substitute `EUR` with the code you want to use as a base currency.

• Substitute `GBP` with the code you want to use as a target currency.

We use ISO 4217 Three Letter Currency Codes - e.g. USD for US Dollars, EUR for Euro etc. Here are the codes we support.

GET https://prime.exchangerate-api.com/v5/YOUR-API-KEY/pair/EUR/GBP

This will return the exchange rate from your base code to the other currency you supplied:

{
	"result": "success",
	"documentation": "https://www.exchangerate-api.com/docs",
	"terms_of_use": "https://www.exchangerate-api.com/terms",
	"time_zone": "UTC",
	"time_last_update": 1580947200,
	"time_next_update": 1580950860,
	"base": "EUR",
	"target": "GBP",
	"conversion_rate": 0.8412
}

Alternatively, you could also supply an optional AMOUNT variable (decimal format xxxx.xxxx).

GET https://prime.exchangerate-api.com/v5/YOUR-API-KEY/pair/EUR/GBP/AMOUNT

This will return the exchange rate from your base code to the target currency you supplied, as well as a conversion of the amount you supplied:

{
	"result": "success",
	"documentation": "https://www.exchangerate-api.com/docs",
	"terms_of_use": "https://www.exchangerate-api.com/terms",
	"time_zone": "UTC",
	"time_last_update": 1580947200,
	"time_next_update": 1580950860,
	"base": "EUR",
	"target": "GBP",
	"conversion_rate": 0.8412,
	"conversion_result": 5.8884
}

Error Responses

{
	"result": "error",
	"error": "unknown-code"
}

Where "error" can be any of the following:

  • "unknown-code" if we don't support the supplied currency code (see supported currencies...)
  • "malformed-request" when some part of your request doesn't follow the structure shown above
  • "invalid-key" when your API key is not valid
  • "quota-reached" when your account has reached the the number of requests allowed by your plan
  • "not-supported-on-plan" if your plan level doesn't support this type of request

If you have any questions about the above please don't hesitate to email us!