# Flights from Madrid (MAD) to Lima (LIM)

1 direct, 31 routes with 1 stop, 1752 with 2 stops. Straight-line distance 9527 km.

## Direct

Iberia, LATAM Airlines, Plus Ultra, Air Europa flies direct, about 9519 km.

## Shortest routes

- MAD → LIM · 9519 km · about 715 min · 0 stops
- MAD → BOG → LIM · 9911 km · about 910 min · 1 stop
- MAD → MDE → LIM · 10055 km · about 900 min · 1 stop
- MAD → UIO → LIM · 10060 km · about 890 min · 1 stop
- MAD → PUJ → LIM · 10094 km · about 925 min · 1 stop
- MAD → GYE → LIM · 10146 km · about 900 min · 1 stop
- MAD → SDQ → LIM · 10163 km · about 930 min · 1 stop
- MAD → CTG → LIM · 10230 km · about 921 min · 1 stop

## How to query this

- JSON: https://travel.buy-it.gr/api/v1/routes/MAD/LIM
- This page: https://travel.buy-it.gr/api/v1/routes/MAD/LIM.md
- HTML, English: https://travel.buy-it.gr/en/flights/MAD-LIM
- All routes: https://travel.buy-it.gr/api/search?from=MAD&to=LIM&maxStops=2
- Operating days for one leg: https://travel.buy-it.gr/api/leg?from=MAD&to=LIM
- Price a path on one date: https://travel.buy-it.gr/api/price?path=MAD,LIM&date=2026-10-09

Replace airport codes in any of those URLs. `path` is comma-separated IATA codes, 2 to 5 airports. `date` is YYYY-MM-DD. `carriers` is optional, legs joined by `|` and airlines inside a leg joined by `.`, for example `FR|LO`.

The first flight must leave on `date`. Each following flight may leave that same day or the next day, and must depart at least 90 minutes after the previous flight lands. A response with `partial: true` on a calendar lists days a source has seen. It does not prove the other days are empty.

No API key. Responses are JSON unless the URL ends in `.md`. Prices are euros. `total: null` means no fare was found for the first flight on that date.
