This happens because you may have added IP/ HTTP referrer restrictions for your public access tokens. You'll see this error if requests do not originate from the IP/ referrer you approved.
To verify the configuration of your access token:
- Login to the LocationIQ dashboard
- Please navigate to the 'API Access Tokens' tab
- Select the token of your choice and click 'View'
You'll find authorized HTTP referrers and IP addresses here. If you want to update this:
- Click 'Update'
- Modify approved referrers/ IP addresses
- Click 'Update'
You can define a list of URLs authorised to call our APIs or Maps with an access token. If not specified or empty, the API will default to any URL. URLs can be targeted by matching a prefix or a suffix using the * character. For multiple HTTP referrers, specify one pattern per line.
A few examples:
"https://example.com/* will restrict access to all referrers starting with https://example.com
*.example.com will restrict access to all referrers ending with .example.com
If you want to allow access for the full domain example.com, you can use *example.com/*