Using API with Laravel Localhost


I’m trying to access the API Retrieve POI list, but every time I send a request with my website I get the following error: “CORS-header ‘Access-Control-Allow-Origin’ does not match with ‘’”.

Has anyone encountered this problem before and knows how to solve it?

Our CORS configuration should allow anyone to access the API from any context but you do need to set an API key and some ‘user-agent’ headers are banned.

If you are accessing the API via javascript (e.g. client side code on a web page) it’s different to accessing the API via a backend script (like PHP etc). You mentioned Larvel but if it’s just javascript you’re using it shouldn’t matter.

I just tested the following example running on - it’s working in Chrome and Firefox (note that I’m not accessing it via https though)

    <ul id="results"></ul>

        let results = fetch('')
            .then(response => response.json())
            .then(results => {
                const el = document.getElementById("results");
                for (let r of results) {
                    el.innerHTML += "<li>" + r.AddressInfo.Title + "</li>"


Thank you for the quick reply!

I am using Javascript to access the API, but i’ve got no idea why it’s trying to use https. So the main problem could be that my laravel tries to use HTTPS instead of just HTTP?

This is the code I used to get my result:

let responseEV = await fetch("" + + "&longitude=" + location.lng + "&distance=" + straal + "&distanceunit=km&key=MY_KEY")

I tried your code, but I got the same result as with my own. When I inspect the site in firefox it says as requestheader:

and the respons header says:

I can’t find why it says that it’s https instead of http.

Well https was a difference but I’ve just tried it with https myself and it’s working fine (Chrome and Firefox). The https part is appearing because your local development server (serving your web page) is running with https configured.

I don’t think the fact you are using Larvel (or PHP etc) is related because this code is javascript and running in the browser (not server side).

Do you get the same result in different web browsers?

If I look at the response headers we are sending back we do accept any origin (we reflect the origin you send):

I installed Chrome to test it and it worked.
After testing firefox in save mode I noticed one of my extensions is causing the problem…
Sorry for the troubles…

Great, glad you got it working!