The Mexican peso is the most actively traded currency in Latin America and closely tied to the US economy through trade, manufacturing supply chains and remittances. It is also a liquid emerging-market currency, which means it often reacts quickly to global risk sentiment and to US policy news. The fxapi MXN exchange rate API returns peso rates against 190+ currencies, live and back to 1999, for pricing, payroll and reporting across the US–Mexico corridor. Typical integrations include US retailers showing peso prices, Mexican subsidiaries translating results into dollars, and payroll tools paying contractors on both sides of the border.
MXN facts for developers
- Where it’s used: Mexico.
- Symbol and formatting:
$, the same sign as the US dollar, writtenMX$orMXNwhere both could appear. Format:$1,234.56(comma thousands, period decimal). - Minor unit: 2 decimals (centavos).
- Central bank: Banco de México (Banxico), which also publishes the FIX reference rate for US-dollar obligations payable in Mexico.
- Regime: free float since December 1994. The current peso (MXN) replaced the old peso (MXP) at 1,000:1 in 1993, before fxapi’s history begins.
- Events in the historical data: the peso weakened sharply in the 2008 financial crisis and again on 9 November 2016 – the sample date on this page – after the US presidential election. It fell steeply in March 2020 and then strengthened markedly during 2023.
Get MXN rates with the fxapi API
/v1/historical works on every plan. This Python script prints USD/MXN for each day of the week of the 2016 US election, with the day-over-day change:
import os
from datetime import date, timedelta
import requests
HEADERS = {"apikey": os.environ["FXAPI_KEY"]}
def usd_mxn(day: date) -> float:
r = requests.get(
"https://api.fxapi.com/v1/historical",
params={"date": day.isoformat(), "currencies": "MXN"},
headers=HEADERS,
timeout=10,
)
r.raise_for_status()
return r.json()["data"]["MXN"]["value"]
day, previous = date(2016, 11, 7), None
while day <= date(2016, 11, 11):
rate = usd_mxn(day)
change = f"{(rate / previous - 1) * 100:+.2f}%" if previous else ""
print(day, f"{rate:.4f}", change)
previous, day = rate, day + timedelta(days=1)
For one-call period comparisons use the free fluctuation endpoint; for longer daily series, /v1/range (Professional plan and up). See also the Python guide and multi-currency pricing.
Things to watch
- Same
$as USD. Never display a bare$on pages that might show both currencies – cross-border shoppers can’t tell which one they are paying. - FIX vs market. Mexican contracts that reference the FIX rate need that rate, not a market mid.
- Fast moves on news. Election nights and policy announcements can move USD/MXN by several percent; cache with short lifetimes around such events.
Popular MXN pairs
Request any of these pairs – or any other combination of the 190+ supported currencies – with base_currency=MXN:
| Pair | Latest rate request |
|---|---|
| MXN/USD | /v1/latest?base_currency=MXN¤cies=USD |
| MXN/EUR | /v1/latest?base_currency=MXN¤cies=EUR |
| MXN/CAD | /v1/latest?base_currency=MXN¤cies=CAD |
| MXN/BRL | /v1/latest?base_currency=MXN¤cies=BRL |
| MXN/CNY | /v1/latest?base_currency=MXN¤cies=CNY |
| MXN/GBP | /v1/latest?base_currency=MXN¤cies=GBP |
| MXN/JPY | /v1/latest?base_currency=MXN¤cies=JPY |
Monthly averages and fluctuation for MXN
# Monthly average MXN rates for 2025 (IAS 21 / ASC 830)
curl -G "https://api.fxapi.com/v1/average" \
-d date_from=2025-01-01 -d date_to=2025-12-31 -d period=month \
-d base_currency=MXN -d currencies=USD,EUR,CAD \
-H "apikey: $FXAPI_KEY"
# How did MXN move over the last year?
curl -G "https://api.fxapi.com/v1/fluctuation" \
-d date_from=2025-10-01 -d date_to=2026-10-01 \
-d base_currency=MXN -d currencies=USD,EUR,CAD \
-H "apikey: $FXAPI_KEY"See the historical exchange rates API, average rates API and documentation for every parameter.
MXN is one of 190+ currencies in fxapi, the FX rates API for developers – live rates, daily history since 1999 and monthly averages with one API key.
Frequently asked questions
How do I get the USD to MXN exchange rate via API?
/v1/latest?currencies=MXN with your key in the apikey header. With USD as the default base, the value is pesos per 1 US dollar.Is fxapi's rate the same as Banxico's FIX rate?
Does fxapi have peso rates before 1999?
How do I avoid confusing MXN and USD prices?
$. Show MX$ or the ISO code, and format with the es-MX locale for Mexican users.