---
title: "Advanced Nl Geocode Endpoint"
method: POST
path: "/api/nl-geocode-advanced"
---

# Advanced Nl Geocode Endpoint

`POST /api/nl-geocode-advanced`

🚀 ADVANCED Natural Language Geocoding with comprehensive spatial operations.

This endpoint uses a hybrid approach combining:
- Nominatim for place lookup (5M+ places from Who's On First)
- Natural Earth for high-quality continent boundaries
- Spatial operations library for complex geometric operations
- Claude Sonnet 4 for natural language understanding

Supported spatial operations:
- **Buffer**: "within 50km of Paris"
- **Union**: "California and Nevada"
- **Intersection**: "in New Mexico, west of Albuquerque"
- **Difference**: "France except Paris"
- **Directional**: "north of Seattle", "west of London"
- **CoastOf**: "coast of California"
- **BorderBetween**: "border between USA and Mexico"
- **Between**: "between Baltimore and Washington DC"
- **OffTheCoastOf**: "50 nautical miles off the coast of Florida"

Returns:
    GeoJSON with complex geometries

## Request body

- NLGeocodeRequest
  - `query` string, required — Complex natural language spatial query (e.g., 'within 50km of Paris', 'France except Paris')

## Response `200`

Successful Response

- APIResponse
  - `status` string, required
  - `data` object, nullable
  - `error` string, nullable
  - `timestamp` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/monarcha/apis/monarcha-gis-api.md) · [All operations](https://skmtc.dev/monarcha/apis/monarcha-gis-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/monarcha/monarcha-gis-api/revisions/a2923fbc4d26/schema)
