{"_id":"@buslix/tomtom-sdk","_rev":"8-ab28a883320e9a84b4b91b5fce3b38d1","name":"@buslix/tomtom-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@buslix/tomtom-sdk","version":"0.0.1","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"author":{"name":"Marvin Koch"},"license":"MIT","_id":"@buslix/tomtom-sdk@0.0.1","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"homepage":"https://github.com/Buslix/tomtom-sdk#readme","bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"dist":{"shasum":"0eb45836ee35578ff6fde9cbef0b62a3456e5b3c","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.0.1.tgz","fileCount":13,"integrity":"sha512-fLi9sGMuQxGorEh+Z89VrxEE4cGMXWqd0UN3NbIFJCUcGlLlKYOOYd+5+F8y8uhZ8MzovSKx6lBNH8t9FRGJ3Q==","signatures":[{"sig":"MEQCIA3N5D5eBD10s2Lup9ZHZlHa5Za13Zpq2WUQKSW0H4HOAiAZo3BBmy26+bVfexaiIfhvS5a1ZvbGD3dXHbm+J7MKdw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38147},"main":"index.js","gitHead":"0c1f6f38a3a593d7916c2b018d5a3204cb0536c1","scripts":{"build":"tsc","start":"node dist/index.js","build:prod":"tsc"},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"repository":{"url":"git+https://github.com/Buslix/tomtom-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/tomtom-sdk_0.0.1_1740137499020_0.07087120143939885","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@buslix/tomtom-sdk","version":"0.0.2","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"author":{"name":"Marvin Koch"},"license":"MIT","_id":"@buslix/tomtom-sdk@0.0.2","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"homepage":"https://github.com/Buslix/tomtom-sdk#readme","bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"dist":{"shasum":"552247fb2dc5c5042cdd15bf31d2ca40edbef6d7","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.0.2.tgz","fileCount":13,"integrity":"sha512-QQOhCYBoUzmJFjFW4K6lDPL5zIdUzYrbyd9Wuqxmx8vDOckW50vHdk/CzFM2QlsqsWR0bjkS8YYC17eaooRX6g==","signatures":[{"sig":"MEQCIH3KE+VN/Cvw7Yom+zL11eojUQiSCBucmhNHC0PBVtqzAiAo87wbNcQ2Lh8UPlS3eCUREZ5jl01BPFol3hJ1y9yD+g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39559},"main":"index.js","gitHead":"b88890f7b687ca30f34b85658c56554f1422be34","scripts":{"build":"tsc","start":"node dist/index.js","build:prod":"tsc"},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"repository":{"url":"git+https://github.com/Buslix/tomtom-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/tomtom-sdk_0.0.2_1740139695716_0.18707660038483298","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@buslix/tomtom-sdk","version":"0.0.3","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"author":{"name":"Marvin Koch"},"license":"MIT","_id":"@buslix/tomtom-sdk@0.0.3","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"homepage":"https://github.com/Buslix/tomtom-sdk#readme","bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"dist":{"shasum":"1671f3545561538977aa64d96b444019d96445d0","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.0.3.tgz","fileCount":13,"integrity":"sha512-7eEg06568VQeCRfAu0XEwBY21u0TLNpv8fF5wIEMhFlNL5c6iDP4gMce4oI66t6ItHm/XX1kECL/aGpY9QOePg==","signatures":[{"sig":"MEYCIQCG9jNO3Cr4eQJT+37AbWVqYnp7e6q9QTAyMu6hRpHv5wIhAMDs7VrJkjMvAiiRdRbd8mpGVRkFubejEihndhnVp9Yt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39618},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"adf92b70eb77d15eea702ff9ca5d9eebe3bb0eb5","scripts":{"build":"tsc","start":"node dist/index.js","build:prod":"tsc"},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"repository":{"url":"git+https://github.com/Buslix/tomtom-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/tomtom-sdk_0.0.3_1752478001530_0.05314338141198216","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@buslix/tomtom-sdk","version":"0.0.4","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"author":{"name":"Marvin Koch"},"license":"MIT","_id":"@buslix/tomtom-sdk@0.0.4","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"homepage":"https://github.com/Buslix/tomtom-sdk#readme","bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"dist":{"shasum":"65caf9482e8f4214b4d595d7e9731d522cd34db8","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.0.4.tgz","fileCount":13,"integrity":"sha512-RtsxZJ91jYdYKhn79du6V9oE/z50MeRVKfYxaQwJs9o0Ai8cbTQL+HvBBPxIaObsCBiFdiyhfZHgDBNCFavHXg==","signatures":[{"sig":"MEUCIHAmeg+OTbKiNRIGXLRnQB+njD+2ALOU4QnYiQ4vSjWUAiEA0eLuE4/U3q0ldk4ExO993a+GthrrcKruaiSm13yFEqg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39800},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"1b428aec88d34ee79e934cd73cba7e651327276e","scripts":{"build":"tsc","start":"node dist/index.js","build:prod":"tsc"},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"repository":{"url":"git+https://github.com/Buslix/tomtom-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/tomtom-sdk_0.0.4_1752497646685_0.5230661986285849","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@buslix/tomtom-sdk","version":"0.0.5","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"author":{"name":"Marvin Koch"},"license":"MIT","_id":"@buslix/tomtom-sdk@0.0.5","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"homepage":"https://github.com/Buslix/tomtom-sdk#readme","bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"dist":{"shasum":"d1b945cd2ecd0045706c2a7f14f513a650cbda20","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.0.5.tgz","fileCount":13,"integrity":"sha512-jhwF06GSyHIKCcbCmzNox05PPHKoogAoIxmBCifXOwsZo2qrqy1uWJM4Q3zOwAInDALoLJ0OIqQ4A437Nu6I+g==","signatures":[{"sig":"MEUCIBKXwYstwK3Ns4wp6/6gfS2FmGRmh2F2nMdmCZKySTjpAiEAi2f25h+QSnj/J1lXetxZaBfZbHdTNJPk6s9PIRMRQSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39836},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"4588c7ff8238bdc4354812af09a50e0cfc2edc70","scripts":{"build":"tsc","start":"node dist/index.js","build:prod":"tsc"},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"repository":{"url":"git+https://github.com/Buslix/tomtom-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/tomtom-sdk_0.0.5_1752498413394_0.9998237144656297","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@buslix/tomtom-sdk","version":"0.0.6","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"author":{"name":"Marvin Koch"},"license":"MIT","_id":"@buslix/tomtom-sdk@0.0.6","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"homepage":"https://github.com/Buslix/tomtom-sdk#readme","bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"dist":{"shasum":"de3f06cf005150ccbf9a2bc8cb9a3d70862d1083","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.0.6.tgz","fileCount":13,"integrity":"sha512-Pm0LdujS7Q03ThbkNbBt9ps1tZqA3kUwPZ7DFje6McsMUfQqDASLWvlApUf4nPU9z7be0ZUxQGqWHLvOxiRk+Q==","signatures":[{"sig":"MEQCIH4VpuGhETtHPLe+qkHZJGhSxsSX56srvCbZo57N1mu6AiAzVvF1XVd2OemyNk7V3w37ZQcsXjJ6IqxVieOdWHyj6A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40242},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"fc77be98893771f5519f8967c72978797196ff68","scripts":{"build":"tsc","start":"node dist/index.js","build:prod":"tsc"},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"repository":{"url":"git+https://github.com/Buslix/tomtom-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/tomtom-sdk_0.0.6_1752581792032_0.6802112978569801","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@buslix/tomtom-sdk","version":"0.0.7","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"author":{"name":"Marvin Koch"},"license":"MIT","_id":"@buslix/tomtom-sdk@0.0.7","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"homepage":"https://github.com/Buslix/tomtom-sdk#readme","bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"dist":{"shasum":"58d0a089ef7beaa3ec68a78e40ff5147f524f4d2","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.0.7.tgz","fileCount":13,"integrity":"sha512-Gyng/DKW6YSWFndCDthL0Zb/RNNyNdO6IYvhgYDDrsL+kaUw77lCQ3GrqCgNaygOZ6zEY8DYpAGlYTPnyv6/Jw==","signatures":[{"sig":"MEQCIDHJTxahl9uk8pGgH/sRYcy1znVVvrZ1zooMrpWfeKEqAiAQghKe4glLBfbI0XkMR6N4WEFhuSZQnsCVqoyfVxt2/g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40390},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"85bc8106b0a617a75cc06c080bd96a21facd7c30","scripts":{"build":"tsc","start":"node dist/index.js","build:prod":"tsc"},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"repository":{"url":"git+https://github.com/Buslix/tomtom-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/tomtom-sdk_0.0.7_1752582784689_0.05290348425646729","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@buslix/tomtom-sdk","version":"0.1.0","description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","main":"dist/index.js","scripts":{"build":"tsc","build:prod":"tsc","start":"node dist/index.js","test":"jest","test:ci":"jest --ci"},"keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"repository":{"type":"git","url":"git+https://github.com/Buslix/tomtom-sdk.git"},"bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"homepage":"https://github.com/Buslix/tomtom-sdk#readme","author":{"name":"Marvin Koch"},"license":"MIT","devDependencies":{"@eslint/js":"^10.0.1","@types/jest":"^30.0.0","@types/node":"^22.13.4","@typescript-eslint/eslint-plugin":"^8.57.1","@typescript-eslint/parser":"^8.57.1","dotenv":"^17.3.1","eslint":"^10.0.3","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","globals":"^17.4.0","jest":"^30.3.0","jiti":"^2.6.1","prettier":"^3.8.1","ts-jest":"^29.4.6","type-fest":"^5.4.4","typescript":"^5.7.3","typescript-eslint":"^8.57.1"},"_id":"@buslix/tomtom-sdk@0.1.0","gitHead":"fc634e176967fb980fa5d51c7ecd5e44c0b0e0d5","types":"./dist/index.d.ts","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-oOry8h0DT4kl55hDvLJuFYKP7DhzI7NXDMZ8HRvnq1gcdMV9fcQf+K3x6AjsE+6CPPMMJCJrg3rt5YD85oz6QA==","shasum":"c6fa602e8ea66eb6c8c87f229bfa77af2d398f5f","tarball":"https://registry.npmjs.org/@buslix/tomtom-sdk/-/tomtom-sdk-0.1.0.tgz","fileCount":43,"unpackedSize":169445,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBLHj2eXpaXBSOLInjMr282qjud3Z4OvDt6NnY313G7+AiBzd94ACmIvGunBICkPGCka26vb6Dh/zft9Kvt4uHPNMg=="}]},"_npmUser":{"name":"kochmarvin","email":"marvin.info@gmx.at"},"directories":{},"maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tomtom-sdk_0.1.0_1773690034005_0.7251547278489074"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-21T11:31:38.928Z","modified":"2026-03-16T19:40:34.351Z","0.0.1":"2025-02-21T11:31:39.217Z","0.0.2":"2025-02-21T12:08:15.954Z","0.0.3":"2025-07-14T07:26:41.689Z","0.0.4":"2025-07-14T12:54:06.880Z","0.0.5":"2025-07-14T13:06:53.601Z","0.0.6":"2025-07-15T12:16:32.220Z","0.0.7":"2025-07-15T12:33:04.879Z","0.1.0":"2026-03-16T19:40:34.181Z"},"bugs":{"url":"https://github.com/Buslix/tomtom-sdk/issues"},"author":{"name":"Marvin Koch"},"license":"MIT","homepage":"https://github.com/Buslix/tomtom-sdk#readme","keywords":["tomtom","tomtom-api","tomtom-wrapper","typescript","navigation"],"repository":{"type":"git","url":"git+https://github.com/Buslix/tomtom-sdk.git"},"description":"A lightweight, TypeScript-friendly wrapper around TomTom’s REST API, providing convenient methods for route calculations and other location-based services.","maintainers":[{"name":"kochmarvin","email":"marvin.info@gmx.at"}],"readme":"# TomTom SDK\n\nA lightweight, TypeScript-first wrapper around [TomTom’s Routing API](https://developer.tomtom.com/routing-api/documentation) and [Search API](https://developer.tomtom.com/search-api/documentation) (Autocomplete). Use it for route calculation, reachable range, batch routing, and search autocomplete.\n\n## Installation\n\n```bash\nnpm install @buslix/tomtom-sdk\n```\n\n## Requirements\n\n- **Node.js** 18+ (for `fetch`)\n- A [TomTom API key](https://developer.tomtom.com/)\n\n## Quick start\n\n```ts\nimport { TomTom } from '@buslix/tomtom-sdk';\n\nconst client = new TomTom('YOUR_API_KEY');\n\n// Calculate a route\nconst route = await client.calculateRoute({\n  from: { lat: 52.376372, lng: 4.908066 },\n  to: { lat: 52.39081, lng: 4.88802 },\n});\nconsole.log(route.routes[0].summary.lengthInMeters);\n```\n\n---\n\n## API Reference\n\n### Client\n\n```ts\nimport { TomTom } from '@buslix/tomtom-sdk';\n\nconst client = new TomTom(apiKey: string, versionNumber?: string);\n```\n\n- **`apiKey`** – Your TomTom API key (required).\n- **`versionNumber`** – Routing API version, default `'1'`.\n- **`client.baseUrl`** – Base URL (default `'https://api.tomtom.com'`). Override for region-specific endpoints (e.g. South Korea).\n\n---\n\n### Calculate Route\n\nCompute a route between two points with optional waypoints and options.\n\n```ts\nconst result = await client.calculateRoute({\n  from: { lat: 52.51, lng: 13.43 },\n  to: { lat: 52.50, lng: 13.44 },\n  waypoints: [{ lat: 52.505, lng: 13.435 }],  // optional\n  travelMode: 'car',       // optional: car, truck, taxi, bus, van, motorcycle, bicycle, pedestrian\n  routeType: 'fastest',    // optional: fastest, shortest, eco, thrilling\n});\n// result.routes[0].summary, result.routes[0].legs, ...\n```\n\nOptions include `sectionType`, `avoid`, `departAt`, `vehicleLoadType`, `computeBestOrder`, `computeTravelTimeFor`, `reassessmentParameterSets`, and more. See [Calculate Route](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/calculate-route) and the exported type `CalculateRouteOptions`.\n\n---\n\n### Calculate Reachable Range\n\nGet the reachable area from an origin given a time, distance, fuel, or energy budget.\n\n```ts\nconst result = await client.calculateReachableRange({\n  origin: { lat: 52.36, lng: 4.85 },\n  timeBudgetInSec: 1800,  // exactly one budget required\n});\n// result.reachableRange.center, result.reachableRange.boundary\n```\n\nBudget options (use exactly one): `timeBudgetInSec`, `distanceBudgetInMeters`, `fuelBudgetInLiters` (with `constantSpeedConsumptionInLitersPerHundredkm`), `energyBudgetInkWh` (with consumption params). See [Calculate Reachable Range](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/calculate-reachable-range) and `CalculateReachableRangeOptions`.\n\n---\n\n### Batch Routing\n\n#### Synchronous batch (up to 100 items)\n\nRun multiple route and/or reachable-range requests in one call. Fails if processing exceeds ~60s.\n\n```ts\nconst result = await client.syncBatch([\n  { type: 'calculateRoute', options: { from: a, to: b } },\n  { type: 'calculateReachableRange', options: { origin: c, timeBudgetInSec: 600 } },\n]);\n// result.batchItems[i].statusCode, result.batchItems[i].response\n// result.summary.successfulRequests, result.summary.totalRequests\n```\n\n#### Asynchronous batch (up to 700 items)\n\nSubmit a batch, then poll for results.\n\n```ts\n// 1. Submit\nconst { location } = await client.submitBatchAsync(\n  [\n    { type: 'calculateRoute', options: { from: a, to: b } },\n  ],\n  { redirectMode: 'manual', waitTimeSeconds: 120 },\n);\n\n// 2. Fetch results (location may be relative; client handles it)\nconst result = await client.fetchBatchResults(location);\n\n// Or by batch ID (parsed from location URL)\nconst batchId = new URL(location, 'https://api.tomtom.com').pathname.split('/').pop();\nconst result = await client.fetchBatchResultsByBatchId(batchId!, { waitTimeSeconds: 120 });\n```\n\nOn **202 Accepted**, the batch is still processing; call `fetchBatchResults` again (or follow the new `Location` header). See [Synchronous batch](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/batch-routing/synchronous-batch) and [Asynchronous batch](https://docs.tomtom.com/routing-api/documentation/tomtom-maps/batch-routing/asynchronous-batch-submission).\n\n---\n\n### Autocomplete (Search API)\n\nGet query-term suggestions (brand, category, plaintext) for a search string.\n\n```ts\nconst result = await client.autocomplete('pizza Berlin', {\n  language: 'en-US',   // required\n  limit: 5,            // optional, 1–10, default 5\n  lat: 52.52,          // optional bias\n  lon: 13.405,\n  radius: 50000,       // meters, with lat/lon\n  countrySet: 'DE',\n  resultSet: 'category,brand',\n});\n// result.context.inputQuery, result.results[].segments (type, value, matches)\n```\n\nSee [Autocomplete](https://docs.tomtom.com/search-api/documentation/autocomplete-service/autocomplete) and `AutocompleteOptions`.\n\n---\n\n### Error handling\n\nAll API methods throw **`TomTomRoutingError`** on failure (HTTP errors or API error payloads).\n\n```ts\nimport { TomTom, TomTomRoutingError } from '@buslix/tomtom-sdk';\n\ntry {\n  await client.calculateRoute({ from: { lat: 0, lng: 0 }, to });\n} catch (err) {\n  if (err instanceof TomTomRoutingError) {\n    console.error(err.message, err.code, err.statusCode);\n  }\n}\n```\n\n---\n\n### Types and helpers\n\n- **`Point`** – `{ lat: number; lng: number }`.\n- **Route / range / batch / autocomplete** – Options and response types are exported (e.g. `CalculateRouteOptions`, `SyncBatchItemRequest`, `AutocompleteResponse`). Use your IDE’s types for full options.\n- **`haversineDistance(a, b, unit?)`** – Great-circle distance between two points.\n\n```ts\nimport { haversineDistance, type Point } from '@buslix/tomtom-sdk';\n\nconst d = haversineDistance(\n  { lat: 52.52, lng: 13.405 },\n  { lat: 52.50, lng: 13.44 },\n  'km',\n);\n```\n\n---\n\n### TypeScript\n\nThe package is written in TypeScript and ships with declaration files. Route response types are inferred from options (e.g. `computeBestOrder: true` implies `optimizedWaypoints` on the response).\n\n---\n\n## Links\n\n- [TomTom Routing API](https://developer.tomtom.com/routing-api/documentation)\n- [TomTom Search API](https://developer.tomtom.com/search-api/documentation)\n- [Get an API key](https://developer.tomtom.com/)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}