Currency Conversion API

USD/MXN Currency Conversion API

The USD/MXN currency pair represents the exchange rate between the United States Dollar and the Mexican Peso. Mexico is the largest US trading partner, making this pair particularly significant for cross-border commerce. The USD to MXN rate is influenced by Banxico monetary policy, oil prices, remittance flows, US-Mexico trade relations, and nearshoring trends.

The USD/MXN Currency Conversion API allows you to:

  • Convert USD (United States Dollar) to MXN (Mexican Peso) at current market rates
  • Convert MXN (Mexican Peso) to USD (United States Dollar) at current market rates
  • Get accurate conversions for any amount
  • Access real-time exchange rate data
(4.4)

From 5,079 users

2,800+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
199ms239ms273ms399ms1134ms

Didn't find what you were looking for? Suggest an improvement


/v1/convertcurrency GET

https://api.api-ninjas.com/v1/convertcurrency


Parameters

  • have  required

    Currency you currently hold. For example, USD or MXN.

  • want  required

    Currency you want to convert to. For example, MXN or USD.

  • amount  required

    Amount of currency to convert.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • old_amount

    The original amount provided in the request.

  • old_currency

    The original currency code (e.g. USD).

  • new_currency

    The target currency code (e.g. MXN).

  • new_amount

    The converted amount in the target currency.

  • timestamp

    Unix timestamp (in seconds) indicating the time at which the exchange rate used for the conversion was applied.

Sample Request Live Demo!

have
want
amount

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/convertcurrency?have=USD&want=MXN&amount=1000

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/convertcurrency?have=USD&want=MXN&amount=1000" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed above, you can still make API calls by using any HTTP request library and following the documentation above.