I am trying to call the api from a Flutter app but getting 403 error response. However the same url when called through a testing tool works fine and returns 200 response code.
First of all, before you even consider using the Photon demo API, check your code and make a calculation how often the API is called from a single client and how many installations of your app you anticipate. Multiply the two values. If you end up with more than 1 request/s, you will need to run your own instance of Photon instead of using the demo server.
With that out of the way: please use a user agent that identifies your application clearly. The user agent is well chosen if one can paste it into google and end up at the website of your app (which should then describe a means to get in touch with you). Once you do that, you should be able to use the API.
I only call it once and print the url everytime it gets called.
I also checked now, the api call works when I call it while the app is running in a web browser as a site. It only gives me 403 error when the app is deployed on my phone.
I don’t think I have anything setup to define those things for the app yet. I can later but just when the development has started and checking the app api connection is also hindered.
if you are not willing to do bare minimum of following quite clear guidelines and setting user agent that identifies you, and you are not paying for support, why you expect others to provide support for you?
We do not give guarantees for availability and reserve the right to implement changes without notice.
note: I am not maintainer of support or having any role in Photon or Komoot. Maybe once I made a PR with a typo fix.
Yes, if it is an email which actually gets a response. You wouldn’t believe how many user agents have an email that starts with example@…
To be fair here: the chance that clients gets contacted before they are blocked is very, very low. For one thing that is because the number of apps bombarding the geocoding APIs carelessly with lots of requests is just to high to make that scalable. For another thing, the success rate in getting a response when actually trying to make contact has been so disappointingly low that it is really not worth the time.
A well customized user agent mostly helps against becoming collateral damage when other apps need to be blocked. Which is exactly the issue of the original poster here.
oh, I am aware, and it is what I accept if I use public free server (that also typically explicitly notes that there is no promise whatsoever of uptime, continued service or anything else)
in case of OSM services I have faint hope of getting recognized and getting notified if I bungle retry attempts or made something similarly silly