I'm using several reverse geocoding options such as Foursquare, Google, and OpenStreetMap to retrieve place information, but the one type of place that none of these seem to be able to do is residential areas.

Simply put, I want to know if a given lat/long belongs to a residential area or property.

OpenStreetMap seems to be the closest to a solution as it marks some roads as residential, but I don't know of an OSM API that would allow me to see if, given a lat/long, the corresponding property lies on a residential road. Nominatim only gives the single closest entry.

I don't mind paying.

  • Not sure if Gisgraphy provides that, but might be worth a try: http://services.gisgraphy.com/reversegeocoding/search?lat=${lat}&lng=${lon}&format=json for a quick glance (just replace the variables accordingly, using decimal format). For free it only works in a web browser, but you can register for API access (haven't checked their pricing, though).
    – Izzy
    Oct 4, 2018 at 10:14
  • Thanks @Izzy, but unfortunately not seeing any information that could lead to identifying residence or not. Oct 4, 2018 at 11:41
  • 1
    For OpenStreetMap, probably better to check if the location is within an area tagged as landuse=residential. Not sure if there is any API to do this.
    – vclaw
    Oct 4, 2018 at 11:44
  • 1
    I think @vclaw's answer is going to be the best. I've just checked landuse=residential on OpenStreetMap and it seems to provide the perfect level of information for my needs. I just need to either find or make an API that returns this information. overpass-turbo.eu might be able to do this it seems. Oct 4, 2018 at 13:53
  • 1
    @Mawg Depending on how good the service is, and whether it can replace other services I use, up to $200/month Oct 5, 2018 at 8:29

2 Answers 2


It looks like Gisgraphy should fit your needs. Here's the output from an example query:

    <name>Elenis Palaiologou</name>
    <isInAdm>Λευκωσία - Lefkoşa</isInAdm>
    <adm1Name>Λευκωσία - Lefkoşa</adm1Name>
    <adm2Name>Λευκωσία - Lefkoşa</adm2Name>
    <fullyQualifiedName>Elenis Palaiologou, Nicosia, Λευκωσία - Lefkoşa</fullyQualifiedName>
    <label>Elenis Palaiologou, Nicosia</label>
    <labelPostal>Elenis Palaiologou, Nicosia</labelPostal>

The attribute you are after is <streetType>RESIDENTIAL</streetType>.

Gisgraphy offers API access. I haven't checked their prices, but it seems they have a free and a premium service. Apart from that, you can also install the software on your own server, as it is available at Github. For details on how to use the API, please refer to their API reference. "Street type" is dealt with in chapter 7.

Oh: And as you can see by <source>OSM</source> it is using OpenStreetMap :)

  • 1
    Yeah, this seems to work for the things I have tried so far. Of course, it will probably fail if the GPS coordinate points to a house with no nearby road, but it's a good start! Oct 4, 2018 at 12:49
  • 3
    All I use it for is the label, so I cannot really tell #D Should definitely fit your basic needs. And as the saying goes: if you miss something, fork and make a PR 😁‎
    – Izzy
    Oct 4, 2018 at 13:09

I've found that using the OpenStreetMap Overpass API gives what I need. You can write a query in Overpass Query Language or XML to search OSM for nodes, ways and relations tagged as "residential":

out body;
out skel qt;

There's an online interpreter here: http://overpass-turbo.eu/

And an API endpoint here: https://z.overpass-api.de/api/interpreter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.