# Flights from Madrid (MAD) to Panama City (PTY)

1 direct, 49 routes with 1 stop, 2508 with 2 stops. Straight-line distance 8158 km.

## Direct

Iberia, Air Europa flies direct, about 8163 km.

## Shortest routes

- MAD → PTY · 8163 km · about 640 min · 0 stops
- MAD → SJU → PTY · 8165 km · about 809 min · 1 stop
- MAD → PUJ → PTY · 8165 km · about 783 min · 1 stop
- MAD → SDQ → PTY · 8172 km · about 788 min · 1 stop
- MAD → BAQ → PTY · 8188 km · about 785 min · 1 stop
- MAD → CTG → PTY · 8190 km · about 777 min · 1 stop
- MAD → STI → PTY · 8197 km · about 777 min · 1 stop
- MAD → CCS → PTY · 8379 km · about 804 min · 1 stop

## How to query this

- JSON: https://travel.buy-it.gr/api/v1/routes/MAD/PTY
- This page: https://travel.buy-it.gr/api/v1/routes/MAD/PTY.md
- HTML, English: https://travel.buy-it.gr/en/flights/MAD-PTY
- All routes: https://travel.buy-it.gr/api/search?from=MAD&to=PTY&maxStops=2
- Operating days for one leg: https://travel.buy-it.gr/api/leg?from=MAD&to=PTY
- Price a path on one date: https://travel.buy-it.gr/api/price?path=MAD,PTY&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.
