Getting started
TopoExport offers three HTTP APIs. They share one account, one plan and one dashboard.
| API | Host | Key | What it returns |
|---|---|---|---|
| Map tiles | https://tiles.topoexport.com | tpk_… in the URL | Vector tiles, ready-made MapLibre styles, fonts, sprites, 3D Tiles and terrain |
| Geocoding | https://geocode.topoexport.com | tpk_… in the URL | Autocomplete, search, structured search, reverse geocoding, place lookup |
| Export API | https://data.topoexport.com | sk_… in the Authorization header | Official 2D and 3D datasets (buildings, parcels, roads, terrain…) as GeoJSON, glTF, OBJ, GeoTIFF or PNG |
Get a key
- Sign in to the TopoExport app and open Services & API.
- Start the API Trial or choose the API plan.
- Create a
tpk_key in the Maps and geocoding tab for tiles and geocoding. The secretsk_key of the Export API is in the Export API tab.
tpk_ key is meant to live in a browser: restrict it to your sites' origins. An sk_ key is a secret: keep it on your server and never ship it in front-end code.Authentication
Map tiles and geocoding
Pass the key in the key query parameter:
curl "https://geocode.topoexport.com/v1/geocode/search?text=Lyon&key=$TOPOEXPORT_API_KEY"
Each key has a list of allowed origins, set in the dashboard. A request is accepted when its Origin header, or else its Referer, starts with one of them. A key with no origin listed accepts every origin: use one for servers, scripts, QGIS and ArcGIS Pro, which send neither header.
Changes to a key (revocation, origins) apply everywhere within 60 seconds.
Export API
Send the secret key as a bearer token:
curl -H "Authorization: Bearer $TOPOEXPORT_SECRET_KEY" \
"https://data.topoexport.com/lookup?lat=48.8584&lon=2.2945"
Plans and credits
Map tiles and geocoding draw on one pool of map credits. The Export API counts export credits separately. Prices are on the API page.
| API Trial | API | Enterprise | |
|---|---|---|---|
| Map credits (tiles + geocoding) | 2,000,000 for the trial | 5,000,000 per month | Custom |
| Beyond the map credits | Requests refused (429) | €3, $3 or £3 per 1,000,000 credits, up to your cap | Custom |
| Export API credits | 4,000 for the trial | 4,000 per month | Custom |
| Beyond the export credits | Requests refused (403) | €0.003, $0.003 or £0.003 per credit, up to your cap | Custom |
| API keys | 1 | 10 | Custom |
| Commercial use | No | Yes | Yes |
| Attribution required | Yes | Yes | No |
Map credits per request, for map tiles:
| Request | Credits |
|---|---|
| Vector tile | 1 |
| Terrain tile | 1 |
| 3D tile resource | 3 |
| Styles, fonts, metadata | Free |
and for geocoding:
| Request | Credits |
|---|---|
| Autocomplete | 5 |
| Search, structured, nearby | 10 |
| Reverse geocoding, place by ID | 5 |
Export credits depend on the area and the format: see Export API credits.
- Only successful responses are billed. A response in error costs nothing.
- A geocoding response served from cache costs the same credits as a fresh one.
- On the API Trial, credits are granted once for 30 days. On the API plan they renew on the first day of each month (UTC). Beyond them, usage is billed up to the monthly spending cap you set for each product in the dashboard.
- All the keys of an account share the same credits.
Rate limits
Rate limits are there to stop abuse and keep the service responsive for every customer. We don't publish fixed figures: normal use of a web or mobile application, busy hours included, stays well below them. They apply as follows:
- Per key, for every request.
- Per key and per user IP for requests sent from a browser (with an
OriginorReferer): a single user or script sending too many requests is slowed down without affecting the other users of your application. - Lower from a local development server (
Originonlocalhostor127.0.0.1). - Server-side calls (no
Origin) are only limited per key, since they all come from the same IP.
How the API answers:
| Situation | Response |
|---|---|
| Too many requests | 429 with a Retry-After of 10 seconds |
| Credits used up (the trial credits, or the spending cap you set on the API plan) | 429 with Retry-After set to the start of the next month |
| Geocoder momentarily saturated | 503 with a Retry-After of 5 seconds, not billed |
Wait for Retry-After before retrying. If you plan a high request rate, a batch job or a launch, write to [email protected] beforehand and we will plan capacity with you.
Fair use
Storing the results your application uses is fine, for example the coordinates of an address a user saved. Without a written agreement, the following are not allowed:
- giving third parties access to the APIs through your own proxy or service;
- bulk downloading tiles or geocoding results;
- systematically caching tiles or geocoding results to build your own copy of the data.
Keys used this way may be rate-limited or deactivated.
Attribution
On the API Trial and API plans, display the data attribution on your map or next to your results:
- for maps, keep the map library's attribution control: the style and the TileJSON carry the sources to credit (OpenStreetMap contributors, cadastre publishers…);
- for geocoding results, show the
geocoding.attributionstring of the response; - and add © TopoExport.
Errors
Map tiles and geocoding answer errors as JSON {"error": "…"}:
| Status | Meaning |
|---|---|
400 | Missing or invalid parameter |
401 | Missing key |
403 | Unknown or inactive key, or origin not allowed for this key |
404 | Unknown tileset, style or endpoint |
429 | Rate limit exceeded, or monthly credits used up |
502, 503 | Geocoding temporarily unavailable or saturated: retry after Retry-After |
The Export API uses its own codes, listed in Export API errors.
Service status: status.topoexport.com.