960 roadside inns, city khans and ribats from Wikidata and OpenStreetMap, each drawn in ink and washed in the colour of the dynasty that built it.
For more than a thousand years, merchants crossing Anatolia, Iran and Central Asia slept behind walls. A caravanserai was a fortified inn: a square courtyard with rooms and stables round it, a well in the middle and one tall gate that was shut at night. They were built along the roads at intervals, so that a caravan could leave one at dawn and reach the next by dusk. I wanted to see how many of them open data can still put on a map, how far apart they really stand, and who built them.
Every drawing on the map is one record: 960 in all, merged from 864 Wikidata items and 281 OpenStreetMap features, 185 of which turned out to be the same building in both. The courtyard of each is washed in the colour of the dynasty that built it, where the data says so; a plain courtyard means undated. The dashed lines join each stop to its neighbours. They are my inference, not mapped roads, and the camel trains that walk along them are there for the pleasure of it.
Caravanserais from Wikidata (CC0) and OpenStreetMap contributors (ODbL 1.0). Base map: The Inked World, drawn from OpenStreetMap via OpenFreeMap, AWS Terrain Tiles, RESOLVE Ecoregions and Natural Earth. Tap any caravanserai for its details; the square button at the top right fills the screen, and the Layers button filters by era.
The map is lopsided. Turkey has 401 caravanserais and Iran 352: together 78% of everything mapped. The rest are spread thinly from the Balkans to India, across 33 countries and territories in all. That is partly history (the Seljuks of Anatolia and the Safavids of Iran built on a grand scale) and partly bookkeeping: Turkish Wikidata editors have entered hundreds of Seljuk and Ottoman hans, and 213 of Iran's are on its national heritage list, which brought them into Wikidata with their coordinates. Central Asia, home of the great Silk Road cities, has only 52, and China none at all under these headings.
| Region | All | Roadside | In towns | Dated | Listed |
|---|---|---|---|---|---|
| Anatolia | 403 | 268 | 135 | 66 | 1 |
| Iran | 352 | 305 | 47 | 189 | 234 |
| Caucasus | 41 | 22 | 19 | 18 | 29 |
| Central Asia and Afghanistan | 52 | 43 | 9 | 3 | 11 |
| Levant and Iraq | 51 | 25 | 26 | 19 | 8 |
| Egypt and Arabia | 18 | 5 | 13 | 4 | 3 |
| Balkans and Crimea | 17 | 13 | 4 | 8 | 11 |
| South Asia | 17 | 17 | 0 | 4 | 12 |
| Maghreb and Europe | 9 | 0 | 2 | 0 | 2 |
Regions group modern countries. All includes the seven ribats (forts and lodges) of the Maghreb and Iberia; the other columns count inns only.
To see the routes, I joined each stop to its nearest neighbours with the shortest network that links them all, and kept only links of 80 km or less (about two days on the road). 90% of all stops then fall into chains of three or more. The longest runs for 273 stops across Anatolia, from the Aegean coast at Çeşme to the Tigris near Cizre, 1,398 km as the crow flies; the next, 259 stops, crosses Iran from the Caspian shore of Gilan to the Gulf coast, 1,203 km. On the map these chains look like roads, and many follow real ones, but they are inferred from the inns alone.

Iran, with the inferred links. Turquoise courtyards are Safavid, rose are Afsharid, Zand and Qajar, plain ones undated.
Writers on caravanserais usually say they were built a day's march apart, a stage that is often put at 30 to 40 km for a laden caravan of camels or mules. The mapped caravanserais sit much closer than that. The median distance from a stop to the nearest other stop is 21 km; only 12% of gaps fall between 30 and 40 km, and 48% are under 20 km.
The reason is time. A road used for eight centuries collects inns from many builders: a Seljuk han, an Ottoman one a few kilometres on, a Safavid caravanserai beside a Qajar one, a small stop between two big ones. Put all of them on one map and the gaps shrink. Take one dynasty at a time and the old rhythm comes back. The 90 Safavid caravanserais of Iran in the data stand a median 34 km from the nearest other Safavid one; half of the gaps lie between 26 and 50 km, and 58% between 20 and 50 km. That is a day's march.
Taken one dynasty at a time, the Safavid caravanserais of Iran stand a day's march apart.

Distance to the nearest other stop, in 5 km bars. Shaded: a day's march of 30 to 40 km.
The Qajar caravanserais, built in the eighteenth and nineteenth centuries when many Safavid ones still stood, are further apart from each other (median 46 km): they filled gaps more than they made a new chain. The Seljuk hans of Anatolia are too few in the data to say much.
Only 311 of the 953 inns (33%) can be given a dynasty, and nearly all of those come from their architectural style in Wikidata, not from a date: only 61 have a year of building. Safavid is the commonest (97), then Afsharid, Zand and Qajar (78), Ottoman (70) and Seljuk (29). The great thirteenth century hans of the Seljuk sultans, such as Sultan Han on the road from Konya to Aksaray, are on the map, but most carry no style or date in Wikidata, so the Seljuk total is far too low.

Inns by the dynasty that built them, coloured by region. Dynasty from the architectural style in Wikidata or, failing that, from the year of building.
Filter the map by era (the Layers button) and the dynasties separate cleanly: turquoise Safavid courtyards along the roads radiating from Isfahan, madder Seljuk ones across central Anatolia, olive Ottoman khans in the cities of Anatolia, the Levant and the Balkans, and Mamluk wikalas in Cairo and the khans of Palestine and Lebanon.
311 inns (33%) carry a heritage listing in Wikidata: 213 are Iranian National Heritage, and 47 are part of UNESCO's World Heritage Site of the Persian Caravanserai, inscribed in 2023. In Iran 66% of mapped caravanserais are listed; in Turkey only 1, which says more about what Wikidata records than about what Turkey protects. OpenStreetMap marks 36 as ruins and 17 as reused as hotels, guest houses, museums or restaurants, which is how many restored caravanserais now pay their way: travellers still sleep in them.

Central Anatolia: the Seljuk road from Konya through Aksaray to Kayseri.
Wikidata. Every item that is a caravanserai, a khan or a ribat (or a subclass of one) and has coordinates: 866 items, 2 of them without a usable point, with their country, year of building, architectural style and heritage listing.
OpenStreetMap. Every feature tagged as a caravanserai (historic, building, heritage type or amenity): 285 features, 281 after merging a node and a way drawn for the same building. 116 link to a Wikidata item through their wikidata tag and 69 more lie within 150 m of one; the other 96, many of them unnamed ruins in Afghanistan and Iran, are new. A wider search of OpenStreetMap by name (khan, han, ribat and their equivalents) was planned but its results were not available for this version, so only features explicitly tagged as caravanserais are used.
Kinds. Seven ribats in Tunisia, Portugal and Spain are frontier forts or Sufi lodges, not inns: they are drawn as forts and left out of every count of inns. In Iran and Central Asia a robat is a caravanserai and stays in. An inn counts as urban if it sits within 2 km of the centre of a town of 50,000 people or more (3 km for 200,000, 5 km for a million, from Natural Earth), or among other inns: two more within 1 km, or a group of four or more linked within 3 km. That gives 698 roadside inns and 255 khans in towns and cities.
Stops and spacing. Inns within 3 km of each other are one stop, so a town with five khans is one place on the road: 727 stops in all. For each stop I measured the great-circle distance to the nearest other stop; for each dynasty, the distance from each inn to the nearest inn of the same dynasty more than 3 km away. Links are the minimum spanning tree of the stops, using each stop's ten nearest neighbours, cut at 80 km.
Dynasties. From the architectural style in Wikidata (Seljuk, Ilkhanid, Timurid, Safavid, Zand, Qajar, Ottoman, Mamluk, Mughal and others), or, without one, from the year of building and the region, using the usual dates of each dynasty. A year given only to the century is taken as its middle. Three dates were not building dates (a typing slip, a Roman site and a museum opening) and are not used.
This is a map of records, not of history. It shows the caravanserais that someone has entered in Wikidata or drawn in OpenStreetMap, which is why Turkey and Iran dominate and why Central Asia, Arabia, the Grand Trunk Road (17 sarais) and China look empty. Many caravanserais known to scholars are missing, and some of the 96 OpenStreetMap features without a name may be other ruined buildings. Most inns are undated, a style is not a date (a Qajar style can mean a Qajar restoration), and the urban rule is a rule of thumb. The links and camel trains show what the spacing suggests, not where the roads ran. Distances are straight lines; a road is always longer.