Skip to main content
GuidesAPI ReferenceExamples

Reverse Geocode API

|

Current version: 1.0.0, View Release Notes

The Reverse Geocode API provides comprehensive geocoding capabilities. This powerful service combines forward geocoding (text-to-coordinates) and reverse geocoding (coordinates-to-address) functionality, making it essential for location-based applications, delivery systems, store locators, and any service requiring precise geographic information.

Complete API Reference

View the complete Reverse Geocode API Reference for detailed request/response schemas, examples, and interactive documentation.


Endpoint: POST /revgeocode

Base URL: https://api.magiclane.net/api/v1

Key Features:

  • Convert coordinates to detailed addresses
  • Search around a point, within an area, or along a path
  • Returns multiple address results with distance ranking
  • Includes administrative hierarchy (settlement, city, county, state, country)
  • Identifies nearby points of interest

Required Parameters:

At least one geographic filter is required

Optional Parameters:

  • at - Reverse geocode at a point coordinate [longitude, latitude]
  • in - Reverse geocode within an area (polygon, circle, or bbox)
    • polygon - Polygon area defined by coordinates or polyline
    • circle - Circle area with center [longitude, latitude] and radius in meters
    • bbox - Bounding box with east, west, south, north coordinates
  • along - Reverse geocode along a path with:
    • polyline - Encoded polyline path
    • coords - Array of coordinates defining the path
    • radius - Search radius around the path in meters
  • limit - Maximum number of results to return

Example Request - Reverse Geocode at Point

curl -X POST https://api.magiclane.net/api/v1/revgeocode \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"at": [13.388860, 52.517037],
"limit": 5
}'

This returns address information for the specified coordinates.

Example Request - Reverse Geocode in Area

curl -X POST https://api.magiclane.net/api/v1/revgeocode \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"in": {
"circle": {
"center": [6.85524, 50.951736],
"radius": 500
}
},
"limit": 10
}'

This finds all addresses and POIs within a 500m radius.

Example Request - Reverse Geocode Along Path

curl -X POST https://api.magiclane.net/api/v1/revgeocode \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"along": {
"coords": [
[13.388860, 52.517037],
[13.397634, 52.529407],
[13.428555, 52.523219]
],
"radius": 100
},
"limit": 20
}'

This finds addresses along the specified path within 100m.

Response Structure

The API returns a JSON object containing:

  • info - Copyright and attribution information
  • results - Array of address objects, each containing:
    • coordinates - Location as [longitude, latitude]
    • name - Place or feature name
    • address - Detailed address components:
      • street name - Street name
      • street number - House/building number
      • postal code - Postal/ZIP code
      • settlement - Settlement/neighborhood
      • city - City name
      • county - County name
      • state - State/province name
      • country - Country name
      • country code - ISO country code
    • distance - Distance from search point in meters (when applicable)