Google Routes API — quick setup guide
Google Routes API gives you modern routing (ETA with live traffic), and a route matrix, replacing legacy Directions/Distance Matrix, which is used for the Quote Calculator Module. We use this API because it's the most modern and accurate, providing crucial route planning metrics.
Creating an API is often difficult to negotiate due to lack or documentation, however this guide should get you up and running a lot faster.
1) Create/select a Google Cloud project
If you don't have an account, create one first.
- Open the API Dashboard and choose the right project (top bar) - https://console.cloud.google.com/apis/dashboard.
2) Enable billing
Prices are very low cost, with 10k uses for free / month.
- If the project has no billing, you’ll be prompted to add a billing account when you enable an API - https://console.cloud.google.com/billing.
3) Enable the Routes API
- Go to APIs & Services → Library, search “Routes API”, then Enable - https://console.cloud.google.com/apis/library.
4) Create an API key & restrict it
Go to APIs & Services → Credentials → Create credentials → API key - https://console.cloud.google.com/apis/credentials
- Restrict your key (required for production)
- Application restrictions: HTTP referrers (web) or IPs (server).
- API restrictions: Allow only Routes API.
5) Make your first request
Post install, generate a new quote, if the quotation displays, all is well, if you receive a warning message (which happens when the API isn't setup correctly), follow the displayed guidance, and if all else fails;
Contact me on info@logistack.co.uk for support or questions.