Geocode.xyz

Utility API · Works globally · Address to coordinates · No API key

TL;DR

Geocode.xyz provides both forward geocoding (address to coordinates) and reverse geocoding (coordinates to address) with global coverage. It handles full addresses, city names, landmarks, and postal codes. The free tier supports a generous number of requests per day without an API key. Output formats include JSON, GeoJSON, CSV, and XML. Particularly useful for mapping applications, store locators, and spatial data enrichment without paying for Google's API.

Quick start: https://geocode.xyz/51.50354,-0.12768?geoit=json

No API key needed — just make a request!

How to Use This API

1. Reverse Geocode — Coordinates to Address

Converts London coordinates to an address:

https://geocode.xyz/51.50354,-0.12768?geoit=json

2. Forward Geocode — City Name to Coordinates

https://geocode.xyz/paris?geoit=json

3. Full Address Lookup

https://geocode.xyz/1600+Pennsylvania+Ave+Washington+DC?geoit=json

4. JavaScript — Get User Location

navigator.geolocation.getCurrentPosition(pos => {
  const { latitude, longitude } = pos.coords;
  fetch(`https://geocode.xyz/${latitude},${longitude}?geoit=json`)
    .then(r => r.json())
    .then(data => {
      console.log(`You're near: ${data.city}, ${data.country}`);
      console.log(`Postal: ${data.postal}`);
    });
});

5. Python — Batch Geocode

import requests

cities = ['London', 'Tokyo', 'Sydney', 'Cairo', 'Rio de Janeiro']
for city in cities:
    data = requests.get(
        f'https://geocode.xyz/{city}?geoit=json'
    ).json()
    print(f"{city}: {data.get('latt', '?')}, {data.get('longt', '?')}")
Reverse geocode London: https://geocode.xyz/51.50354,-0.12768?geoit=json

Frequently Asked Questions

What output formats are supported?
Use geoit=json for JSON, geoit=xml for XML, geoit=csv for CSV, and geoit=geojson for GeoJSON. Also supports jsonp for cross-domain requests.
What is the rate limit for the free tier?
The free tier allows approximately 1 request per second without an API key. For higher limits, register for a free API key which increases your daily quota.
Does it support bulk geocoding?
Yes, you can geocode multiple addresses by separating them with semicolons in the URL. Response will be an array of results.
How accurate is the geocoding?
Accuracy varies by region. Major cities and well-known landmarks have precise results. Rural areas may have less accurate coordinates. Street-level data is best in North America and Europe.
Can I use it for store locator apps?
Yes, Geocode.xyz is well-suited for mapping applications. Use forward geocoding to plot store locations and reverse geocoding to detect user proximity.
What is the latt and longt in responses?
Note the spelling — the API returns latt (latitude) and longt (longitude) as strings. Parse them as floats for calculations.

API Details

API URL
https://geocode.xyz/
Documentation
geocode.xyz/api
Category
Utility
Authentication
Not Required (optional free key for higher limits)
Geographic Coverage
Global

What You Can Build