Skip to content
Mexican Peso · MXN

Mexican peso (MXN) exchange rate API

Mexican peso rates for cross-border commerce, payroll and reporting – live, end-of-day since 1999 and averaged. Keep USD as base for the USD/MXN quote, or set base_currency=MXN for rates per 1 peso.

CodeMXN
Symbol$
Decimals2
HistorySince 1999
GET /v1/latest · base MXN
curl -G "https://api.fxapi.com/v1/latest" \
  -d base_currency=MXN \
  -d currencies=USD,EUR,CAD,BRL \
  -H "apikey: $FXAPI_KEY"
# MXN on a past date
curl -G "https://api.fxapi.com/v1/historical" \
  -d date=2016-11-09 -d base_currency=MXN \
  -d currencies=USD \
  -H "apikey: $FXAPI_KEY"
ISO 4217 codeMXN
Symbol$
Minor unit2 decimals
IssuerBanco de México

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, written MX$ or MXN where 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:

PairLatest rate request
MXN/USD/v1/latest?base_currency=MXN&currencies=USD
MXN/EUR/v1/latest?base_currency=MXN&currencies=EUR
MXN/CAD/v1/latest?base_currency=MXN&currencies=CAD
MXN/BRL/v1/latest?base_currency=MXN&currencies=BRL
MXN/CNY/v1/latest?base_currency=MXN&currencies=CNY
MXN/GBP/v1/latest?base_currency=MXN&currencies=GBP
MXN/JPY/v1/latest?base_currency=MXN&currencies=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?
Request /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?
No. fxapi returns market mid rates. Banco de México publishes the FIX rate, which is used to settle US-dollar obligations in Mexico; use FIX where a contract or regulation requires it.
Does fxapi have peso rates before 1999?
No. Daily data starts on 1999-01-01. The code MXN has been in use since the 1993 redenomination, so it covers the whole range.
How do I avoid confusing MXN and USD prices?
Both use $. Show MX$ or the ISO code, and format with the es-MX locale for Mexican users.
Free plan · no credit card

Get your free exchange rate API key

300 requests a month, latest and historical rates, fluctuation and averages – free forever. Upgrade when you need faster updates or more requests.