{"openapi":"3.1.0","info":{"title":"Castles API","version":"1.0.0","description":"Castles around the world as an API — 17,000+ castles from Wikidata with their country, geographic coordinates and the year they were built. Search and filter castles by name, country and build-year range, or find every castle near any coordinate by great-circle distance (perfect for \"castles near me\" features). Spanning Germany, Italy, France, Spain, the UK and 100+ countries, it is ideal for travel, tourism, maps, history, education and trivia apps. Open data from Wikidata.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/castles-api","description":"oanor gateway"}],"tags":[{"name":"Castles"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/nearby":{"get":{"operationId":"get_v1_nearby","tags":["Castles"],"summary":"Castles near a coordinate","description":"","parameters":[{"name":"lat","in":"query","required":false,"description":"Latitude (-90..90)","schema":{"type":"string"},"example":"50.11"},{"name":"lon","in":"query","required":false,"description":"Longitude (-180..180)","schema":{"type":"string"},"example":"8.68"},{"name":"radius_km","in":"query","required":false,"description":"Search radius in km (0.5-1000, default 25)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max results (1-100, default 20)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":20,"total":33,"center":{"lat":50.11,"lon":8.68},"results":[{"name":"Stalburger Oede","country":"Germany","latitude":50.1266,"longitude":8.68358,"distance_km":1.86},{"name":"Bornburg","country":"Germany","latitude":50.13013,"longitude":8.70499,"distance_km":2.86},{"name":"Fleschenburg","country":"Germany","latitude":50.1018,"longitude":8.73089,"distance_km":3.74},{"name":"Burg Rödelheim","country":"Germany","latitude":50.1219,"longitude":8.61238,"distance_km":5},{"name":"Burg Bachberg","country":"Germany","latitude":50.1574,"longitude":8.68788,"distance_km":5.3},{"name":"Burg Philippseck","country":"Germany","latitude":50.1545,"longitude":8.64416,"built_year":1584,"distance_km":5.57},{"name":"Wasserburg Goldstein","country":"Germany","latitude":50.0834,"longitude":8.61021,"distance_km":5.79},{"name":"Klettenburg","country":"Germany","latitude":50.1532,"longitude":8.62484,"distance_km":6.21},{"name":"Turmburg Eschborn","country":"Germany","latitude":50.146,"longitude":8.56785,"distance_km":8.94},{"name":"Vilbel Castle","country":"Germany","latitude":50.185,"longitude":8.7448,"distance_km":9.53},{"name":"Kelsterbach Sconce","country":"Germany","latitude":50.0677,"longitude":8.54113,"distance_km":10.97},{"name":"Burg Schwalbach am Taunus","country":"Germany","latitude":50.1488,"longitude":8.53743,"distance_km":11.04},{"name":"Burg Dreieichenhain","country":"Germany","latitude":50.0014,"longitude":8.71639,"distance_km":12.35},{"name":"Burg Dorfelden","country":"Germany","latitude":50.19679,"longitude":8.80236,"distance_km":13.01},{"name":"Kronberg Castle","country":"Germany","latitude":50.181,"longitude":8.5066,"built_year":1200,"distance_km":14.66},{"name":"Burg Wachenbuchen","country":"Germany","latitude":50.1632,"longitude":8.86849,"distance_km":14.68},{"name":"Wasserburg Hainhausen","country":"Germany","latitude":50.0432,"longitude":8.88082,"distance_km":16.14},{"name":"Hofheim Castle","country":"Germany","latitude":50.08622,"longitude":8.44669,"distance_km":16.85},{"name":"Burg Nürings","country":"Germany","latitude":50.18957,"longitude":8.47602,"distance_km":17.02},{"name":"Altenburg","country":"Germany","latitude":50.1644,"longitude":8.90365,"distance_km":17.05}],"radius_km":25},"meta":{"timestamp":"2026-05-31T09:27:19.507Z","request_id":"8c79bb35-1fe5-4464-967b-79b89361316c"},"status":"ok","message":"Nearby castles retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/search":{"get":{"operationId":"get_v1_search","tags":["Castles"],"summary":"Search & filter castles","description":"","parameters":[{"name":"q","in":"query","required":false,"description":"Search by castle name","schema":{"type":"string"}},{"name":"country","in":"query","required":false,"description":"Country, e.g. Germany, France","schema":{"type":"string"},"example":"Germany"},{"name":"year_from","in":"query","required":false,"description":"Built in or after this year","schema":{"type":"string"}},{"name":"year_to","in":"query","required":false,"description":"Built in or before this year","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Results per page (1-100, default 20)","schema":{"type":"string"},"example":"20"},{"name":"offset","in":"query","required":false,"description":"Pagination offset","schema":{"type":"string"},"example":"0"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":20,"limit":20,"total":3557,"offset":0,"filters":{"country":"Germany"},"results":[{"name":"\"Felsenkeller, Bierkeller Burg Cadolzburg\"","country":"Germany","latitude":49.45895,"longitude":10.85175},{"name":"Abenberg Castle","country":"Germany","latitude":49.24333,"longitude":10.96324},{"name":"Abschnittsbefestigung Kirchberg","country":"Germany","latitude":48.98983,"longitude":11.30814},{"name":"Abschnittsbefestigung Mallburg","country":"Germany","latitude":48.9734,"longitude":11.30602},{"name":"Abschnittsbefestigung Puch","country":"Germany","latitude":48.1808,"longitude":11.2172},{"name":"Abschnittsbefestigung Schanze","country":"Germany","latitude":47.90681,"longitude":8.66515},{"name":"Abschnittsbefestigung Schorn","country":"Germany","latitude":48.6047,"longitude":11.0769},{"name":"Abschnittsbefestigung Spitalwald","country":"Germany","latitude":48.3033,"longitude":10.7671},{"name":"Abschnittsbefestigung Straßberg","country":"Germany"},{"name":"Abschnittsbefestigung in Burgholz (Türkenfeld)","country":"Germany","latitude":48.0916,"longitude":11.0976},{"name":"Ackeburg","country":"Germany","latitude":51.6861,"longitude":11.2535,"built_year":1216},{"name":"Adelegg","country":"Germany","latitude":47.82498,"longitude":9.53511},{"name":"Adelssitz Kirchberg","country":"Germany","latitude":48.1322,"longitude":10.0806,"built_year":1244},{"name":"Adenau Castle","country":"Germany","latitude":50.38125,"longitude":6.94481},{"name":"Adenbach Castle","country":"Germany","latitude":50.5435,"longitude":7.09532},{"name":"Ahlberg","country":"Germany","latitude":51.452,"longitude":9.50892},{"name":"Ahrburg","country":"Germany","latitude":50.8392,"longitude":6.58497},{"name":"Ahrensburg Castle","country":"Germany","latitude":53.68013,"longitude":10.24034},{"name":"Aignhof Castle","country":"Germany","latitude":49.2254,"longitude":12.8937},{"name":"Albershof Castle","country":"Germany","latitude":49.54742,"longitude":11.73067}]},"meta":{"timestamp":"2026-05-31T09:27:19.578Z","request_id":"8a626ebf-fad5-4b5d-9e98-8b6f274fb115"},"status":"ok","message":"Castles searched","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Totals & top countries","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Castles worldwide with country, coordinates and year built. Search by name, country and build-year range; /v1/nearby finds castles near a coordinate by great-circle distance.","total":17727,"fields":["name","country","latitude","longitude","built_year"],"source":"Wikidata (castles)","countries":102,"with_year":2921,"top_countries":[{"count":3557,"country":"Germany"},{"count":2815,"country":"Italy"},{"count":2640,"country":"France"},{"count":2329,"country":"Spain"},{"count":1801,"country":"United Kingdom"},{"count":497,"country":"Turkey"},{"count":423,"country":"Poland"},{"count":421,"country":"Iran"},{"count":375,"country":"Ireland"},{"count":372,"country":"Switzerland"},{"count":349,"country":"Czech Republic"},{"count":289,"country":"Austria"}],"with_coordinates":16411},"meta":{"timestamp":"2026-05-31T09:27:19.635Z","request_id":"7b91c407-af3d-4e87-a738-1505aff54e4f"},"status":"ok","message":"Meta retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":3850,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":460,"monthly_call_quota":51000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1300,"monthly_call_quota":247000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":3480,"monthly_call_quota":1215000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/castles-api"}