Return country & city information in addition to coordinates
Since the project uses Google Maps API for the geocoding, it would be useful to also get the country and city data in the response alongside the coordinates currently being returned.
When getting times by coordinates (geolocation API), I need to additionally reverse geocode the coordinates in order to know what city the times are for. It'd be great to have the available directly from the response.
Thanks!
@Nurou Thank you for reaching out.
So far I have intentionally removed this as it encourages abuse of the service by people who actually have no interest in prayer times but want to reverse engineer co-ordinates.
We can always add authentication to the API, but that's something I have stayed clear of thus far.
Which endpoint are you using?
Thanks for the response and that's a fair point which I hadn't considered. The endpoint I initially call is (using IP location info):
http://api.aladhan.com/v1/timingsByCity/city=${city}&country=${country}
If/when the user grants geolocation info, I fetch times using the following endpoint:
http://api.aladhan.com/v1/timings/null?latitude={lat}&longitude={long}
But, now I've lost information about the city since the geolocation API doesn't return it, and neither does the adhan endpoint. I need it to update the UI so the user knows which city the time is based on.
OK, give me a few days to think about it.
Are you making your call client side or server side? Basically all machine to machine authentication become useless if the call is done purely on the client side.
Also, you can drop the null from the second api call.
/v1/timings?latitude.... should work just fine if you're always getting the time 'now'.
Yeah, sure.
I make all calls client side (I'm not running a server).
@Nurou I am working on a solution for this. Thanks for your patience.