API and developers — Help Center
Embedding the map and calling the REST API.
API and developers
Quick Start: Embed the UPCS Map on Your SiteEmbed the UPCS map in a few steps: register your origin, create a session on your server, then mount the map in your page and read the selected code.Create a UPCS Map Session From Your ServerCreate a short-lived UPCS map session with POST /v1/embed/sessions, pass your origin and optional ttl, and read the session token from the response.Mount the UPCS Map With UPCS.mountUPCS.mount renders the map in a page element. See the options for session token, height, center, zoom and style, the callbacks and how to destroy it.Read the UPCS Map Click ResponseThe onSelect callback receives the UPCS code, latitude, longitude, address, country code, cell bounds, saved status and share URL. See each field.Resolve Coordinates to a Code Server-to-ServerUse POST /v1/embed/resolve with latitude and longitude to get a UPCS code from your server without showing the map, and optionally save the result.Look Up a UPCS Code With the APICall GET /v1/upcs/lookup/{code} with your API key to get a code's location, map links and share URL. Unknown codes return 404.Generate and Store a UPCS Code via the APIUse POST /v1/upcs/generate with latitude, longitude and an optional address and label to create a UPCS code and get its share URL.UPCS API Error Codes ExplainedA reference to UPCS API errors: session_expired, key_inactive, partner_required, origin_not_allowed, unsupported_location and rate_limited, with fixes.UPCS Map Session Expiry and RenewalUPCS map sessions are short-lived, 15 minutes by default and 60 to 3600 seconds with ttl. Learn how to detect session_expired and renew a session.Handle the UPCS API Rate Limit (429)Each UPCS API key has an hourly request limit. See what a 429 rate_limited response looks like and how to handle it safely in your code.UPCS API Security ChecklistA practical security checklist for UPCS integrations: keep API keys on the server, register https origins, use separate keys and rotate when needed.Countries Supported by the UPCS APIThe UPCS API returns codes for 25 supported countries. See the list, how the country prefix works, and what unsupported_location means.
