Quick start
Key → map → search → route on your own web page, in about 10 minutes.
On this page
You will create an API key, show a map of Almaty on a web page, find an address and draw a route to it. You need Node.js 20 or newer and an Atasuai account.
1. Get a web key
- Open the console and press Sign in with Atasuai.
- Create an organization (Create an organization → name → Create).
- Open API keys → Create a key. Type: Web. In Allowed origins enter the origin your page is
served from — for this guide
http://localhost:5173(one per line; addhttps://your-site.kzlater). Keep the products Basemap, Search and Routing ticked. - Press Create key, copy the key (
atk_live_…oratk_test_…) and confirm I have copied and stored it. The full key is shown only once.
A web key is public by design — it ends up in your page. The API accepts it only from the origins you listed, and only for the products of your plan.
2. Create the project
mkdir atasu-quickstart && cd atasu-quickstart
npm init -y
npm install @atasu/maps-gl
npm install --save-dev viteindex.html:
<!doctype html>
<html lang="kk">
<head>
<meta charset="utf-8" />
<title>Atasu Maps</title>
</head>
<body style="margin: 0">
<div id="map" style="height: 100vh"></div>
<script type="module" src="./main.js"></script>
</body>
</html>3. Map, search, route
main.js — replace YOUR_WEB_KEY with your key:
import { AtasuMap } from '@atasu/maps-gl';
import '@atasu/maps-gl/maplibre-gl.css';
const map = await AtasuMap.create({
container: 'map',
apiKey: 'YOUR_WEB_KEY',
center: [76.95692, 43.24313], // Almaty, Dostyk Ave × Abay Ave
zoom: 14,
});
const { items } = await map.search.search('Сәтбаев көшесі 4А');
const route = await map.routing.route({ from: [76.95692, 43.24313], to: { place_id: items[0].id } });
map.routes.draw(route);
console.log(`${Math.round(route.routes[0].distance_m)} m, ${Math.round(route.routes[0].duration_s / 60)} min`);npx vite --port 5173Open http://localhost:5173: a map of Almaty with Kazakh labels, the attribution in the corner and the route drawn on it. No bundler configuration is needed (Vite, webpack and Rollup pick up the map's worker file automatically).
What happened:
AtasuMap.create()started a map session with your key, received a short-lived tile token and only then loaded the style — tiles carry the token, never your key. The token is refreshed automatically.map.search.search()calledGET /v1/geocode/searchandmap.routing.route()calledPOST /v1/route; both count towards your usage in the console (Usage & budgets).
Server side: the same with curl
From your backend, use a server key (type Server, restricted to your servers' IP addresses). Never put a server key into a web page or an app.
curl -fsS -G "https://api.atasumaps.com/v1/geocode/search" \
-H "X-Atasu-Key: YOUR_SERVER_KEY" \
--data-urlencode "q=Сәтбаев көшесі 4А" \
--data-urlencode "lang=ru"curl -fsS -X POST "https://api.atasumaps.com/v1/route" \
-H "X-Atasu-Key: YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{"waypoints":[{"lnglat":[76.95692,43.24313]},{"lnglat":[76.955275,43.238767]}],"costing":"auto","lang":"ru","geometry_format":"geojson"}'The destination is the coordinate the search above returned for "Сәтбаев көшесі 4А".
Next
- Web SDK guide: language and theme, autocomplete, routes to an entrance, errors.
- API reference, error codes, rate limits and budgets.