canonical: https://jentic.com/apis/onemap.gov.sg/onemap-main

# OneMap Singapore API

OneMap is the authoritative national map of Singapore, providing geocoding, reverse geocoding, routing, coordinate system conversion, and access to government themed datasets. The API authenticates via a token endpoint and exposes address search across the Singapore land registry, reverse geocoding in both WGS84 and SVY21 coordinates, and bidirectional conversion between WGS84, SVY21, and EPSG:3857. Theme endpoints return categorised points of interest such as schools, parks, and transport facilities.

## For AI agents

Search Singapore addresses, geocode and reverse-geocode coordinates, calculate routes, and pull government-themed map datasets via the official OneMap API.

## Scope

Does not handle global geocoding, traffic-aware navigation, or non-Singapore datasets - use for Singapore address search, geocoding, routing, and government themes only.

## Capabilities

- Search Singapore addresses and return coordinates with postal codes
- Reverse-geocode coordinates in either WGS84 or SVY21 to nearby addresses
- Convert coordinates between WGS84, SVY21, and EPSG:3857 projections
- Calculate routes between two Singapore points using the routing service
- List all government-published map themes available on OneMap
- Retrieve points of interest within a theme such as schools or parks

## Use cases

### Singapore Address Autocomplete

Power Singapore-specific address search inside delivery, ride-hailing, or government service apps using the official OneMap address index. GET `/api/common/elastic/search` returns candidate addresses with WGS84 coordinates and postal codes that align with Singapore Land Authority records.

Example prompt: Search 'Marina Bay Sands' on `/api/common/elastic/search` and return the matching address with its postal code and coordinates.

### Coordinate System Conversion for GIS Workflows

Translate field measurements between SVY21 (the Singapore national grid) and WGS84 or EPSG:3857 for web map display. The conversion endpoints under `/api/common/convert` handle each direction, removing the need for a local proj library when integrating with Singapore datasets.

Example prompt: Convert SVY21 coordinates 30000, 30000 to WGS84 using GET `/api/common/convert/3414to4326.`

### Routing for Singapore Logistics

Plan vehicle, walking, or cycling routes within Singapore using the official routing service. GET `/api/public/routingsvc/route` accepts start and end coordinates plus a route type and returns a structured itinerary suited to Singapore's road and pedestrian network.

Example prompt: Calculate a driving route from 1.3521,103.8198 to 1.2936,103.8520 via `/api/public/routingsvc/route` and return the geometry and duration.

### Agent Geocoding via Jentic

Logistics and civic agents resolve Singapore addresses or look up government themes through Jentic without managing the OneMap token directly. The agent searches for the geocoding intent, loads the schema, and executes the call with the access token Jentic injects from its vault.

Example prompt: Use Jentic search 'search singapore address' to locate `/api/common/elastic/search`, load its schema, and execute the lookup for a delivery address.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/auth/post/getToken` | Get an authentication token |
| GET | `/api/common/elastic/search` | Search Singapore addresses |
| GET | `/api/public/revgeocode` | Reverse-geocode WGS84 coordinates |
| GET | `/api/public/revgeocodexy` | Reverse-geocode SVY21 coordinates |
| GET | `/api/public/routingsvc/route` | Calculate a route between two points |
| GET | `/api/public/themesvc/getAllThemesInfo` | List all available themes |
| GET | `/api/public/themesvc/retrieveTheme` | Retrieve theme data |

## Key resources

- **Authentication** — Mint access tokens via POST `/api/auth/post/getToken`
- **Search** — Search Singapore addresses with the elastic search endpoint
- **Reverse Geocode** — Resolve coordinates to nearby addresses in WGS84 or SVY21
- **Coordinate Conversion** — Convert between WGS84, SVY21, and EPSG:3857
- **Routing** — Calculate routes between two Singapore points
- **Themes** — List and retrieve government-published map themes

## Why Jentic

- **Setup:** Wiring the OneMap Singapore API by hand means exchanging login credentials at `/api/auth/post/getToken` for a short-lived JWT, refreshing it, and building each search, geocode, and routing call against www.onemap.gov.sg yourself. Through Jentic you install once, import the OneMap Singapore API from the API Directory, store the login credentials once, and your agent calls it.
- **Permission scoping:** OneMap passes its search, reverse-geocode, and routing parameters in the query string rather than the URL path, so you limit the agent to the operations it needs, such as address search or reverse geocoding. Theme retrieval or routing are excluded unless you add those operations to the allowed set.
- **Credential handling:** Your OneMap login credentials and JWT are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'reverse geocode singapore coordinates' or 'search a singapore address', and Jentic returns the matching OneMap operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenCage Geocoding API** — OpenCage offers global geocoding but lacks Singapore-specific themes and SVY21 conversion that OneMap exposes.
- **OneMap Singapore (alternate)** — An alternate OneMap spec entry covering the same Singapore endpoints.
- **Stripe API** — Pair OneMap address validation with Stripe to confirm Singapore billing addresses at checkout.

## FAQ

### What authentication does the OneMap Singapore API use?

The API uses HTTP bearer tokens. Mint a token via POST `/api/auth/post/getToken` with email and password, then send it on subsequent calls. Jentic stores the credentials encrypted and exposes only a scoped reference to the agent.

### Can I search Singapore addresses with the OneMap API?

Yes. GET `/api/common/elastic/search` returns matching addresses, postal codes, and coordinates from the Singapore Land Authority dataset, suitable for autocomplete and validation flows.

### Does the OneMap API convert between SVY21 and WGS84?

Yes. The `/api/common/convert` endpoints provide bidirectional conversion between WGS84, SVY21, and EPSG:3857 so callers do not need a local projection library.

### What route types are supported by OneMap routing?

GET `/api/public/routingsvc/route` accepts a route type parameter for driving, walking, cycling, and public transport options across Singapore's network. Inspect the OneMap docs for the current parameter list.

### What are the rate limits for the OneMap Singapore API?

Rate limits are not declared in this OpenAPI spec. Consult onemap.gov.sg/docs for current public and authenticated tier limits before scaling traffic.

### How do I geocode a Singapore address through Jentic?

Run pip install jentic, search 'search singapore address', then load the `/api/common/elastic/search` schema and execute. Jentic injects the bearer token from its vault and returns the JSON response for downstream use.

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

Yes. Because your Jentic One instance is self-hosted, your own rules decide which OneMap operations and credentials the agent may use. You can allow only the operations it needs, such as address search on `/api/common/elastic/search` or reverse geocoding on `/api/public/revgeocode`, and leave routing on `/api/public/routingsvc/route` or theme retrieval out of the allowed set. The token minted at `/api/auth/post/getToken` is injected at execution time, so the agent only ever calls the endpoints you approve.
