{% extends "base.html" %} {% block title %}Geocode to Commons{% endblock %} {% block style %} {% endblock %} {% block content %}
Convert latitude/longitude to a Wikidata item and Wikimedia Commons category.
Interactive map ↗ — click any location to geocode it.
wikidata tag and resolve the Commons category."),
("Check ref:gss tag", "If no wikidata tag, try ref:gss and look up the matching Wikidata item via WDQS."),
("Match by name", "Try finding a nearby Wikidata item with the same name using WDQS."),
("Return result", "Return the most specific Wikidata QID and Commons category found.")
] %}
GET /?lat=<lat>&lon=<lon>
Returns JSON with the Wikidata item and Commons category for the given coordinates.
| Parameter | Values | Description |
|---|---|---|
| lat | decimal degrees | Latitude |
| lon | decimal degrees | Longitude |
| needs_commons |
true (default) false |
When true, only returns a result if a Wikimedia Commons category can be found. When false, returns the best matching Wikidata item even if it has no Commons category — matched by OSM relation or way ID via the Wikidata Query Service. |
{
"wikidata": "Q184618",
"commons_cat": {
"title": "County Tipperary",
"url": "https://commons.wikimedia.org/wiki/Category:County_Tipperary"
},
"admin_level": 6,
"coords": { "lat": 52.41037, "lon": -7.84651 }
}
| Place | Coordinates | Links | |
|---|---|---|---|
| {{ name }} | {{ lat }}, {{ lon }} | detail | API |
Source code: https://git.4angle.com/edward/geocode