Developers

Build with Tareky.

Plain HTTPS and JSON, request shapes your Mapbox and OSRM code already speaks, and one error shape everywhere. Here is everything to start.

Quickstart

  1. 1Get a keyDuring early access we issue keys by hand. A public tareky_pk_ key is for browsers and apps; a secret tareky_sk_ key stays on your server.
  2. 2Make a requestSend the secret key as a Bearer token, or a public key as access_token. Every answer carries your remaining limits.
  3. 3Draw a mapLoad a style URL in MapLibre GL JS v6, which shapes Arabic itself. A map load is one unit; its tiles are free.
Quickstart
a secret key, from a server
# Directions, in Mapbox Directions’ shape
curl -H "Authorization: Bearer $TAREKY_SECRET_KEY" \
"https://api.tareky.com/v1/directions/driving/44.4183,33.3049;44.3650,33.3118"
# Search: الكراده finds الكرادة
curl -H "Authorization: Bearer $TAREKY_SECRET_KEY" \
--get "https://api.tareky.com/v1/locations/geocode" --data-urlencode "q=الكراده"
# An address people actually use
curl -H "Authorization: Bearer $TAREKY_SECRET_KEY" \
"https://api.tareky.com/v1/locations/reverse-geocode?lng=44.3661&lat=33.3152"
a public key, in the browser
import maplibregl from 'maplibre-gl' // v6 shapes Arabic natively
const map = new maplibregl.Map({
container: 'map',
// one map load is billed here; the tiles are free
style: `https://api.tareky.com/v1/styles/light?lang=ar&access_token=${pk}`,
center: [44.3661, 33.3152],
zoom: 12,
})
map.on('click', async ({ lngLat }) => {
const place = await fetch(`https://api.tareky.com/v1/locations/reverse-geocode
?lng=${lngLat.lng}&lat=${lngLat.lat}&access_token=${pk}`).then((r) => r.json())
})
no SDK needed
import 'package:http/http.dart' as http;
// A static map is an image URL; a tareky_pk_ key is safe to ship.
Image.network(
'https://api.tareky.com/v1/static-map/light/'
'44.0091,36.1911,13/[email protected]?lang=ar&access_token=$pk',
);
final eta = await http.get(Uri.parse(
'https://api.tareky.com/v1/matrix/driving/'
'44.0091,36.1911;44.0217,36.2012?access_token=$pk',
));

Endpoints

The public API under /v1, read from the same OpenAPI spec the API is checked against.

Endpoints
MethodPathProduct
GET/v1/locations/reverse-geocodeReverse geocodingEarly access
GET/v1/locations/searchSearch & geocodingEarly access
POST/v1/locations/geo-codingReverse geocodingEarly access
GET/v1/locations/geocodeSearch & geocodingEarly access
POST/v1/tokensKeys, scopes & limitsEarly access
GET/v1/poi/nearbyPlaces nearbyEarly access
GET/v1/poi/in-boundsPlaces nearbyEarly access
POST/v1/poi/along-routePlaces nearbyEarly access
GET/v1/directions/{profile}/{coordinates}DirectionsEarly access
GET/v1/matrix/{profile}/{coordinates}Travel-time matrixEarly access
GET/v1/match/{profile}/{coordinates}Map matchingEarly access
GET/v1/optimize/{profile}/{coordinates}Trip optimisationEarly access
GET/v1/traffic/tiles/{z}/{x}/{y}Live trafficNot available yet
GET/v1/traffic/flowLive trafficNot available yet
GET/v1/traffic/historicalLive trafficNot available yet
GET/v1/traffic/snapshotLive trafficNot available yet
GET/v1/static-map/{theme}/{coords}/{size}Static mapsEarly access
GET/v1/geofencesGeofences & devicesIn development
POST/v1/geofencesGeofences & devicesIn development
POST/v1/geofences/importGeofences & devicesIn development
GET/v1/geofences/{id}Geofences & devicesIn development
DELETE/v1/geofences/{id}Geofences & devicesIn development
POST/v1/tracking/devices/{externalId}/positionsGeofences & devicesIn development
GET/v1/tracking/devices/{externalId}Geofences & devicesIn development
POST/v1/tracking/devices/{externalId}/sharesTracking linksIn development
GET/v1/styles/glyphs/{handle}/{fontstack}/{file}Fonts & iconsIn development
GET/v1/tilesets/{id}TilesetsIn development
POST/v1/tilesets/{name}/uploadsTilesetsIn development
POST/v1/tilesets/{name}/buildsTilesetsIn development
GET/v1/tilesets/{name}/builds/{jobId}TilesetsIn development
GET/v1/styles/{theme}Map stylesEarly access
GET/v1/styles/{handle}/{styleId}Custom styles & StudioIn development
GET/v1/styles/{handle}/{styleId}/sprites/{file}Custom styles & StudioIn development
GET/v1/styles/{handle}/{styleId}/static/{coords}/{size}Custom styles & StudioIn development
GET/v1/styles/{handle}/{styleId}/tiles/{z}/{x}/{y}Custom styles & StudioIn development
GET/v1/tiles/{theme}/{z}/{x}/{y}Raster tilesEarly access
GET/v1/tilequery/{point}TilequeryEarly access
GET/v1/transit/plan/{points}Transit trip planningEarly access
GET/v1/transit/{points}Transit trip planningEarly access
GET/v1/feeds/cifs.jsonIncident feedsEarly access
GET/v1/feeds/incidents.geojsonIncident feedsEarly access
POST/v1/feeds/incidentsIncident feedsEarly access

Keys

Limits and errors

Every plan has per-second and per-minute limits in front of a monthly quota. Over a limit the API answers 429 with Retry-After, and every response says where you stand.

Every response carries

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset
  • X-Quota-Limit
  • X-Quota-Remaining
  • Retry-After

Every error has the same shape

429 Too Many Requests
{
"error": {
"code": "quota_exceeded",
"message": "Monthly quota exhausted for this app",
"status": 429,
"docsUrl": "https://docs.tareky.com/errors/#quota_exceeded"
},
"requestId": "…"
}

Migrating from Mapbox

Static images, directions, matrix, map matching and tilequery take the same paths, parameters and responses as their Mapbox equivalents, and a public key rides in access_token like a Mapbox token. For most code the migration is the host.

most of a migration is the host
// Mapbox static images
const url = `https://api.mapbox.com/styles/v1/mapbox/dark-v11/static/
${lng},${lat},${zoom}/720x420@2x?access_token=${token}`
const url = `https://api.tareky.com/v1/static-map/dark/
${lng},${lat},${zoom}/[email protected]?lang=ar&access_token=${pk}`
// Directions: same path, same response
const base = 'https://api.mapbox.com/directions/v5/mapbox'
const base = 'https://api.tareky.com/v1/directions'

Documentation

Every endpoint with its parameters, responses and errors, generated from the OpenAPI spec.

Open the API reference

Help

Questions about the API reach the engineers who build it.

Build on Iraq’s own map.

Tell us what you are building. During early access we issue keys by hand, and we email you once when yours are ready.

هذه الصفحة متوفرة بالعربية أيضًا.

اقرأها بالعربية

ئەم پەڕەیە بە کوردیش هەیە.

بە کوردی بیخوێنەوە