Wikipedia hub

Wikipedia Nearby Pages API

Pages near a coordinate or a named page, with distance and coordinates.

GET /v1/wikipedia/geosearch

1 credit Failed requests are free

About this endpoint

GET /v1/wikipedia/geosearch?lat=51.5074&lon=-0.1278&radius=2000&lang=en returns data.results, one row per page near the point. Each row has pageId, ns, title, lat, lon, dist, primary, type, name, dim, country, region and globe. dist is the distance from the query point in metres.

Give either both lat and lon, or a title whose coordinates to search around. Giving both forms, or only one of the pair, is a 400. radius is in metres from 10 to 10,000 and defaults to 10,000. The response echoes lat, lon, title and radius; the page block is always closed.

A point with nothing nearby is found with empty: true. A title that does not exist is not_found; a page that has no coordinates is a 400. limit accepts 1 to 500. The list is the nearest results up to limit; there is no cursor and no continuation, so use a smaller radius when you need more of what is close by.

Wikipedia Nearby Pages API FAQ

Can I search around a page instead of coordinates?

Yes. Pass title instead of lat and lon. The response then reports the page title and the coordinates it used in lat and lon. Do not pass both forms in one call.

What is the radius limit?

radius is in metres, from 10 to 10,000, and defaults to 10,000. A larger radius is a 400. A small radius around a quiet place can legitimately return no pages.

What does dist tell me?

dist is the distance in metres from the point you searched around to the page's coordinate. dist and the row's lat and lon are all in the same answer, so you can sort or draw the result without another lookup.

How is nearby search billed?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth.