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

Descripción general

Casos de uso

  • 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

Funcionalidades

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

Puntos finales de la API

Geocode Address

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

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

Parámetros

Nombre Tipo Obligatorio Descripción
address string Obligatorio The address to geocode (street, city, country, or any combination)

Pruébalo

Demostración en vivo
Solicitud

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

Campos de respuesta

Campo Tipo Descripción
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

Ejemplos de código

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

Respuestas de error

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

Parámetros

Nombre Tipo Obligatorio Descripción
lat number Obligatorio Latitude of the location (-90 to 90)
lon number Obligatorio Longitude of the location (-180 to 180)

Pruébalo

Demostración en vivo
Solicitud

Latitude of the location (-90 to 90)

Longitude of the location (-180 to 180)

Campos de respuesta

Campo Tipo Descripción
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)

Ejemplos de código

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

Respuestas de error

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

Parámetros

Nombre Tipo Obligatorio Descripción
addresses array<string> Obligatorio List of addresses to geocode (1–20 items, each non-empty). Max 20 due to Nominatim usage policy.

Pruébalo

Demostración en vivo
Solicitud

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

Campos de respuesta

Campo Tipo Descripción
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.

Ejemplos de código

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"]}'

Respuestas de error

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

Parámetros

Nombre Tipo Obligatorio Descripción
items array<object> Obligatorio List of coordinate pairs to reverse-geocode (1–20 items). Max 20 due to Nominatim usage policy.
items[].lat number Obligatorio Latitude (-90 to 90).
items[].lon number Obligatorio Longitude (-180 to 180).

Pruébalo

Demostración en vivo
Solicitud

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).

Campos de respuesta

Campo Tipo Descripción
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.

Ejemplos de código

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}]}'

Respuestas de error

validation_failed

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

bad_request

The request body is missing or malformed.

Preguntas frecuentes