canonical: https://jentic.com/apis/latlng.work/latlng

# Latlng Work LatLng API

The LatLng API turns place names and addresses into coordinates and back again, using OpenStreetMap data. Forward geocoding takes a free-text query in the q parameter with optional lat and lon to bias results, while reverse geocoding resolves a lat and lon pair into the nearest addresses. Beyond geocoding it searches places by name or category, finds places near a point within a radius, renders static map images from a center point or a posted GeoJSON FeatureCollection, and stores custom GeoJSON datasets for map tiles.

## For AI agents

Geocode addresses, reverse geocode coordinates, search or find nearby places by category, and render static map images with markers or GeoJSON overlays, all backed by OpenStreetMap data.

## Scope

Does not handle turn-by-turn routing, travel-time matrices, IP geolocation, or live traffic. Use for geocoding, places search, static maps, and GeoJSON dataset hosting only.

## Capabilities

- Convert a free-text address or place name into coordinates with forward geocoding, biased toward a lat and lon when given
- Resolve a lat and lon pair into nearby street addresses with reverse geocoding
- Find restaurants, cafes, or other places within a radius of a point using the nearby places search
- Search places by name and narrow results by type, category, or country
- Render a static map image from a center, zoom, and markers, or from a posted GeoJSON FeatureCollection
- Upload, list, inspect, and delete custom GeoJSON datasets used for map tiles

## Use cases

### Agent-driven location lookups through Jentic

An AI agent that answers questions like 'what is near this address' chains two LatLng calls: forward geocoding to turn the address into a lat and lon, then the nearby places search with a radius and category to list what is around it. Through Jentic the agent finds both operations by intent and calls them with the X-Api-Key credential injected at execution time, so the key never sits in the agent's context.

Example prompt: Call GET /api with q='221B Baker Street, London' and limit=1, take the returned coordinates, then call GET `/v1/places/nearby` with that lat and lon, radius=500, and category='cafe'

### Address-to-coordinate conversion for logistics

Delivery and field-service apps need coordinates for every stop before they can plan anything. The LatLng forward geocoding operation accepts a free-text query, an optional lang for localized results, and optional lat and lon to prefer matches near a known area, which helps disambiguate common street names. Reverse geocoding handles the opposite direction when a driver's device reports a GPS fix that needs a readable address.

Example prompt: Call GET /reverse with lat=40.7484 and lon=-73.9857 and limit=1 to return the street address for the delivery driver's current position

### Static map images for emails and reports

Order confirmations, incident reports, and listings often need a map image rather than an interactive widget. The LatLng static map operation renders an image from a center, zoom, width, height, and markers, and the POST variant accepts a GeoJSON FeatureCollection so routes or service areas can be drawn on the image directly.

Example prompt: Call GET `/v1/static` with center='51.5074,-0.1278', zoom=13, width=600, height=400, and markers for the two store locations, then attach the returned image to the report

### Custom map datasets for service areas

Teams that maintain their own geographic data, such as delivery zones or franchise territories, can upload it to LatLng as a GeoJSON FeatureCollection. Each uploaded dataset gets a datasetId that can be listed, fetched, or deleted later, and powers custom dataset map tiles.

Example prompt: Call POST `/v1/datasets` with a FeatureCollection of three delivery-zone polygons, then call GET `/v1/datasets/{datasetId}` with the returned id to confirm the upload

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/api` | Forward geocode a text query |
| GET | `/reverse` | Reverse geocode coordinates |
| GET | `/v1/places/nearby` | Find places near a point |
| GET | `/v1/places/search` | Search places by name |
| GET | `/v1/static` | Render a static map image |
| POST | `/v1/datasets` | Upload a GeoJSON dataset |

## Key resources

- **Geocoding** — Forward geocoding from a text query and reverse geocoding from a lat and lon pair
- **Places** — Search places by name, find places near a point, and list the available place categories
- **Static maps** — Render map images from center, zoom, and markers, or from a posted GeoJSON FeatureCollection
- **Datasets** — Upload, list, fetch, and delete custom GeoJSON datasets used for map tiles

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 61 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 69 / 100
  - AI-Readiness & Agent Experience: 47 / 100
  - Agent Usability: 94 / 100
  - Security: 33 / 100
  - AI Discoverability: 75 / 100
- **View full report:** https://jentic.com/apis/latlng.work/latlng/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the LatLng API by hand means picking between the X-Api-Key header and the api_key query parameter, remembering which operations are open, and building query strings for each geocoding and places call. Through Jentic you install once, import LatLng from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Most LatLng operations take their inputs as query parameters, so rules bound which operations your agent may call rather than which places it looks up. Datasets are the exception: the datasetId sits in the URL path (`/v1/datasets/{datasetId}`), so a rule can pin your agent to one dataset. You choose the operations it may call, so destructive ones like dataset deletion are not included unless you add them.
- **Credential handling:** Your LatLng API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'geocode an address' or 'find cafes near a point', and Jentic returns the matching LatLng operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenCage Geocoding API** — Forward and reverse geocoding aggregated from OpenStreetMap and other open sources
- **Geoapify API** — Geocoding, places, and routing APIs also built on OpenStreetMap data
- **Geocodio API** — Address geocoding focused on the United States and Canada
- **GeoNames API** — Geographic names database for countries, admin regions, and postal codes

## FAQ

### Is there a LatLng MCP server?

You don't need an MCP server to give your agent the LatLng API. Jentic connects it directly from the API Directory: import it, store your API key once, and your agent calls it. Operations are discovered on demand, so your agent's context is not filled with tool definitions it will not use.

### What authentication does the LatLng API use?

Per its OpenAPI spec, the LatLng API accepts an API key either in the X-Api-Key header or in the api_key query parameter. The place categories list and the health check are declared open and need no key. Through Jentic, the key is stored encrypted by your own Jentic One instance and injected at execution time.

### Can I find places near a coordinate with the LatLng API?

Yes. GET `/v1/places/nearby` takes a required lat and lon plus optional radius, type, category, and limit. Call GET `/v1/places/categories` first to see which category values are available for filtering.

### What are the rate limits for the LatLng API?

The OpenAPI spec does not specify rate limits. LatLng describes a free daily quota on its site; check https://www.latlng.work/docs for current limits.

### How do I geocode an address with the LatLng API through Jentic?

Install Jentic One with `curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | sh`, import the LatLng API from the directory, and store your API key. Your agent then searches for 'geocode an address' and Jentic returns the GET /api operation, which takes the address in the q parameter. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I draw GeoJSON on a LatLng static map?

Yes. POST `/v1/static` accepts a GeoJSON FeatureCollection in the request body, with type and features required, and returns a rendered map image. For simple pins, GET `/v1/static` takes center, zoom, width, height, and markers as query parameters instead.

### Can I limit what my agent is allowed to do with the LatLng API?

Yes. For a lookup assistant, write a rule that allows only GET /api, GET /reverse, and GET `/v1/places/nearby`: the agent can geocode and search nearby places, while dataset uploads and deletions stay out of reach, and every call it makes is logged.
