Forward Geocoding API

Send an address, a place name, a postcode or a rough description like "coffee shop near Kings Cross" and get back coordinates, a cleaned up address, its parts, a bounding box and a precision level that tells you how much to trust the point.

GEThttps://api.mygeocode.com/v1/forward?q=...

Try it in the demo Full reference

Example

Request
$ curl "https://api.mygeocode.com/v1/forward?q=221B+Baker+Street,+London&limit=1"

Free-form text works. So does a structured query, if you already have the pieces: street=221B Baker Street&city=London&country=gb. Restrict results to one or more countries with country=gb,ie, bias them toward a point with proximity=lat,lon, or toward a box with bounds.

Response
{
  "status": "ok",
  "query": "221B Baker Street, London",
  "results": [
    {
      "formatted": "221B Baker Street, London NW1 6XE, United Kingdom",
      "lat": 51.523767,
      "lon": -0.158555,
      "type": "address",
      "precision": "house",
      "confidence": 0.97,
      "components": {
        "house_number": "221B",
        "road": "Baker Street",
        "neighbourhood": "Marylebone",
        "city": "London",
        "state": "England",
        "postcode": "NW1 6XE",
        "country": "United Kingdom",
        "country_code": "gb"
      },
      "bounds": { "north": 51.523917, "south": 51.523617, "east": -0.158305, "west": -0.158805 }
    }
  ]
}

What you get back

FieldMeaning
formattedThe full address, written the way that country writes addresses.
lat, lonDecimal degrees, WGS 84. Up to six decimals.
typeWhat was matched: address, street, postcode, city, region, country or poi.
precisionhouse, street, postcode or admin. See coverage.
confidence0 to 1. How sure we are this is the place you meant, given the query. Independent of precision: a city query can be matched with confidence 1 at precision admin.
componentsThe address broken into parts, with the same key names in every country. Only the parts that exist are present.
boundsA bounding box for the matched feature: the building, the street, the postcode area or the city.

Where it is used

Cleaning customer addresses

Geocode on signup and store formatted and components alongside what the customer typed. Reject anything below precision: street and ask them to check.

Putting records on a map

Batch through a CSV of store or property addresses at 50 a second and plot them. The bounds field gives you a sensible zoom for each.

Search by place

Turn "flats in Hackney" into a bounding box and query your own database with it. type tells you whether the user typed a city, a street or a building.

Accuracy

House-level results depend on address data existing for that country, and it does not exist everywhere. The coverage page lists the best level we reach in each of 249 countries and territories. Where we cannot match a house number we fall back to the street, then the postcode, then the locality, and the precision field says which. We never return a country centroid labelled as an address.

Price and limits

One call is one request, however many results it returns (up to 10 with limit). 2,500 requests a day are free per IP address with no key. After that, credits at $0.001 per request or €50 a month unlimited. Burst limit: 10 a second anonymous, 50 with an account. Pricing details.

Migrating from another provider? The Google, Bing, HERE, Mapbox and other drop-in hosts answer forward geocoding requests in those providers' formats.