Skip to main content

Quickstart

Prerequisites​

  • An API key (get one here)
  • A tool to make HTTP requests (curl, or your language runtime)
  • Python: Python 3.6+ (the examples use f-strings and requests library type annotations compatible with 3.6+)
  • JavaScript: Node.js 18+ (the examples use top-level await and ES modules)
  • PHP: PHP 7.4+ with the curl extension enabled (the examples use curl_init()). Most distributions include it; if not, install php-curl via your package manager.

Make Your First Request​

Replace gm_YOUR_API_KEY below with the real API key you copied from your Dashboard.

For cURL, pass it directly in the header. For Python, JavaScript, and PHP, set the GEOCODEME_API_KEY environment variable first:

# macOS / Linux
export GEOCODEME_API_KEY="gm_YOUR_API_KEY"
# Windows PowerShell
$env:GEOCODEME_API_KEY = "gm_YOUR_API_KEY"
:: Windows Command Prompt
set GEOCODEME_API_KEY=gm_YOUR_API_KEY
curl -H "X-Api-Key: gm_YOUR_API_KEY" \
"https://api.geocodeme.net/v1/geocode?q=Paris%2C%20France&limit=1"

To also check the HTTP status code, use -f (fail on HTTP errors):

curl -sf -H "X-Api-Key: gm_YOUR_API_KEY" \
"https://api.geocodeme.net/v1/geocode?q=Paris%2C%20France&limit=1" || echo "Error: request failed" >&2

Request Parameters​

ParameterTypeRequiredDescription
qstringYesAddress or place name to search for (URL-encoded)
limitintegerNoMaximum number of results to return (default: 10, max: 50)

For the full list of parameters, see the API Reference.

Expected Response​

OSM Attribution Required

The attribution field in every response must be displayed in your application when using geocodeme.net data, as required by the OpenStreetMap license (ODbL). Include it in your UI footer or about page, for example:

<footer>Geocoding by geocodeme.net — © OpenStreetMap contributors</footer>
{
"results": [
{
"name": "Paris",
"display_name": "Paris, Île-de-France, France",
"lat": 48.8566101,
"lon": 2.3514992,
"type": "city",
"importance": 0.9288,
"address": {
"city": "Paris",
"state": "Île-de-France",
"country": "France",
"country_code": "fr"
}
}
],
"attribution": "© OpenStreetMap contributors",
"meta": {
"took_ms": 12,
"cache_hit": false
}
}
FieldDescription
resultsArray of location objects matching the query
results[].nameProper name of the place (OSM name tag); null for an unnamed object such as a plain street. Display it as the title, display_name underneath. See The name field
results[].display_nameHuman-readable location string (always present)
results[].lat, lonCoordinates as numbers (always present)
results[].addressStructured address object; optional, may be absent for some results.

Fields like house_number, road, suburb, city, state, country, and country_code are optional and depend on the location.

results[].type, importancePlace type (e.g. city, house) and relevance score (0 to 1), optional
attributionRequired OSM attribution string; must be displayed in any public-facing application
meta.took_msServer processing time in milliseconds
meta.cache_hitWhether the response was served from Redis cache
caution

The address, type, and importance fields are optional and may be absent depending on the result. Always check for their presence before accessing them in your code.

Reverse Geocode​

Convert coordinates to an address using the /v1/reverse endpoint.

Request Parameters​

ParameterTypeRequiredDescription
latnumberYesLatitude of the location (-90 to 90)
lonnumberYesLongitude of the location (-180 to 180)
zoomintegerNoLevel of detail for the address (3 to 18, default: 18). Higher values return more specific addresses
addressdetailsintegerNoInclude a breakdown of the address into elements (0 or 1, default: 1)

For the full list of parameters, see the Reverse Geocoding API Reference.

curl -s -f -H "X-Api-Key: gm_YOUR_API_KEY" \
"https://api.geocodeme.net/v1/reverse?lat=48.8566&lon=2.3522" || echo "Error: request failed" >&2

Expected Response​

{
"result": {
"display_name": "3 Rue de Rivoli, Paris, Île-de-France, France",
"lat": 48.8565,
"lon": 2.3524,
"address": {
"house_number": "3",
"road": "Rue de Rivoli",
"city": "Paris",
"state": "Île-de-France",
"country": "France",
"country_code": "fr"
}
},
"attribution": "© OpenStreetMap contributors",
"meta": {
"took_ms": 8,
"cache_hit": false
}
}
caution

Unlike /v1/geocode which returns results (an array), /v1/reverse returns result: a single object, or null when no address is found. Address fields like house_number and road are optional; always check for their presence before accessing them.

Common Errors​

The API returns errors in a standard format:

{
"error": {
"code": "INVALID_API_KEY",
"message": "API key missing or invalid",
"field": null
}
}
HTTP StatusError CodeCauseFix
400MISSING_PARAMETERRequired query parameter not provided (e.g., missing q)Add the missing parameter to your request
400INVALID_PARAMETERParameter value out of range (e.g., lat=999)Check parameter constraints in the API Reference
401INVALID_API_KEYX-Api-Key header missing or key revokedVerify your key in the Dashboard; regenerate if needed
429RATE_LIMIT_EXCEEDEDToo many requests for your plan tier; see plan tiersImplement exponential backoff; check X-RateLimit-Remaining header
500INTERNAL_ERRORUnexpected server errorRetry after a short delay; contact support if persistent

Rate Limits​

PlanRequests/secondCredit quota
Free13,000 / day
Startup10150,000 / month
Growth15500,000 / month
Pro251,500,000 / month

See current pricing for plan details.

Every API response includes rate limit headers. Inspect them with:

curl -I -H "X-Api-Key: gm_YOUR_API_KEY" \
"https://api.geocodeme.net/v1/geocode?q=Paris"
  • X-RateLimit-Remaining: number of requests remaining in the current per-second window
  • X-RateLimit-Reset: Unix timestamp when the rate limit window resets
  • X-RateLimit-Monthly-Remaining: number of requests remaining in your monthly quota

See Rate Limiting for the full list of headers and how to handle 429 responses.

Next Steps​

  • Authentication: API key security best practices and rate limits per plan
  • API Reference: full endpoint documentation with all parameters
  • Examples: more code samples for common geocoding tasks