Geocoding

Convert human-readable addresses into geographic coordinates (geocoding) and convert coordinates back into addresses (reverse geocoding). Powered by OpenStreetMap via the Nominatim API.

Get API Key

Vue d'ensemble

Cas d'utilisation

  • Place pins on a map from a user-supplied address
  • Convert GPS coordinates to a readable address for display
  • Validate and normalise addresses
  • Power location-aware search and filtering features

Fonctionnalités

Forward geocoding (address to lat/lon)
Reverse geocoding (lat/lon to address)
Worldwide coverage via OpenStreetMap data
Results cached for 24 hours for fast repeated lookups

Points de terminaison de l'API

Geocode Address

Converts a free-text address into latitude and longitude coordinates.

GET
https://requiems.xyz/v1/places/geocode

Paramètres

Nom Type Requis Description
address string Requis The address to geocode (street, city, country, or any combination)

Essayez-le

Démo en direct
Requête

The address to geocode (street, city, country, or any combination)

Champs de réponse

Champ Type Description
address string Full display name of the matched location
city string City or town of the matched location
country string ISO 3166-1 alpha-2 country code (uppercase)
lat number Latitude of the matched location
lon number Longitude of the matched location

Exemples de code

curl "https://requiems.xyz/v1/places/geocode?address=1600+Pennsylvania+Ave+NW" \
  -H "requiems-api-key: YOUR_API_KEY"

Réponses d'erreur

not_found

No results found for the given address.

upstream_error

The geocoding service is temporarily unavailable.

bad_request

The address parameter is missing.

Reverse Geocode

Converts geographic coordinates into a human-readable address.

GET
https://requiems.xyz/v1/places/reverse-geocode

Paramètres

Nom Type Requis Description
lat number Requis Latitude of the location (-90 to 90)
lon number Requis Longitude of the location (-180 to 180)

Essayez-le

Démo en direct
Requête

Latitude of the location (-90 to 90)

Longitude of the location (-180 to 180)

Champs de réponse

Champ Type Description
lat number Latitude as provided in the request
lon number Longitude as provided in the request
address string Full display name of the location at the given coordinates
city string City or town at the given coordinates
country string ISO 3166-1 alpha-2 country code (uppercase)

Exemples de code

curl "https://requiems.xyz/v1/places/reverse-geocode?lat=38.8977&lon=-77.0365" \
  -H "requiems-api-key: YOUR_API_KEY"

Réponses d'erreur

not_found

No address found for the given coordinates.

upstream_error

The geocoding service is temporarily unavailable.

bad_request

lat or lon is missing or out of range (lat: -90..90, lon: -180..180).

Batch Geocode Addresses

Convert up to 20 addresses to coordinates in a single request. Processed concurrently; results are returned in input order. Per-item errors are reported inline. Cache hits avoid outbound network calls.

POST
https://requiems.xyz/v1/places/geocode/batch

Paramètres

Nom Type Requis Description
addresses array<string> Requis List of addresses to geocode (1–20 items, each non-empty). Max 20 due to Nominatim usage policy.

Essayez-le

Démo en direct
Requête

List of addresses to geocode (1–20 items, each non-empty). Max 20 due to Nominatim usage policy.

Champs de réponse

Champ Type Description
results array<object> Per-item results in input order.
results[].address string The original address as provided in the request.
results[].result object Geocoding result (omitted on error). Same fields as the single-item endpoint.
results[].error string Error message if geocoding failed (omitted on success).
total integer Total number of items processed.

Exemples de code

curl -X POST https://requiems.xyz/v1/places/geocode/batch \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"addresses": ["1600 Pennsylvania Ave NW, Washington DC", "Eiffel Tower, Paris"]}'

Réponses d'erreur

validation_failed

The addresses array is missing, empty, or exceeds 20 items.

bad_request

The request body is missing or malformed.

Batch Reverse Geocode

Convert up to 20 coordinate pairs to addresses in a single request. Processed concurrently; results are returned in input order. Per-item errors are reported inline.

POST
https://requiems.xyz/v1/places/reverse-geocode/batch

Paramètres

Nom Type Requis Description
items array<object> Requis List of coordinate pairs to reverse-geocode (1–20 items). Max 20 due to Nominatim usage policy.
items[].lat number Requis Latitude (-90 to 90).
items[].lon number Requis Longitude (-180 to 180).

Essayez-le

Démo en direct
Requête

List of coordinate pairs to reverse-geocode (1–20 items). Max 20 due to Nominatim usage policy.

Latitude (-90 to 90).

Longitude (-180 to 180).

Champs de réponse

Champ Type Description
results array<object> Per-item results in input order.
results[].lat number Latitude as provided in the request.
results[].lon number Longitude as provided in the request.
results[].result object Reverse geocoding result (omitted on error). Same fields as the single-item endpoint.
results[].error string Error message if reverse geocoding failed (omitted on success).
total integer Total number of items processed.

Exemples de code

curl -X POST https://requiems.xyz/v1/places/reverse-geocode/batch \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"lat": 38.8977, "lon": -77.0365}, {"lat": 48.8584, "lon": 2.2945}]}'

Réponses d'erreur

validation_failed

The items array is missing, empty, or exceeds 20 items.

bad_request

The request body is missing or malformed.

Foire aux questions