Postcode Integration for UK

Postcode integration configuration task is now broken, it no longer works because Google blocked non authenticated access to their API. (that is what they mean by “keyless access” in the error message)

To make it work, you need to get an API key from Google Maps:

Note Google will ask for billing details, this is unfortunately a new thing since July 2018, they charge for using the API but will give you $200 usage per month for free. Your usage should be well within this, but there is ways to ensure it does not go over this by restricting usage to $200, it is mentioned in their pricing FAQ pages.

Then you need to edit the script in Automation > Scripts, “Postcode API” script

There are 2 URLs, you need to change them both to use HTTPS (change http:// to https://). (Google do not allow use of the API over HTTP anymore).

You then need to add your API key (which you will get once you register above) to each of the URLs.

Change the first line with the URL to

var urlfmt = 'https://maps.googleapis.com/maps/api/geocode/json?key=YOUR_API_KEY&components=postal_code:'+postcode;

and the second one to

var addrurl = 'https://maps.googleapis.com/maps/api/geocode/json?key=YOUR_API_KEY&latlng=' + lat + ',' + lng + '&sensor=false';

Replace YOUR_API_KEY in both URLs with the API key you get from Google.

6 Likes