Git Product home page Git Product logo

Comments (5)

meezaan avatar meezaan commented on August 26, 2024

For March 11 2023 The "play" link Fajr time is displayed as 5:13 am which matches expectation

https://aladhan.com/play/Corvallis/OR,%20USA image

However, I am invoking the timingsByCity with the following code:

let URL = `https://api.aladhan.com/v1/timingsByCity?country=${Country}&region=${Region}&city=${City}&method=${Method}&adjustment=${HijriCorrection}`
this.Load(URL)

actual request...

https://api.aladhan.com/v1/timingsByCity?country=US&region=Oregon&city=Corvallis&method=2&adjustment=1

and I get the following JSON with Fajr time as 5:00 am

image

what parameter(s) am I missing to match the timings displayed in the play link? Also, I don't see a parameter regarding whether to use the system time or cloud time? if that matters? Thank you.

You need to use the correct method - ISNA - to get the same result.

from api.aladhan.com.

AlGantori avatar AlGantori commented on August 26, 2024

I am posting method=2 in my example above
https://api.aladhan.com/v1/timingsByCity?country=US&region=Oregon&city=Corvallis&method=2&adjustment=1
The returned JSON also says ISNA ?

image

from api.aladhan.com.

meezaan avatar meezaan commented on August 26, 2024

Where did you get the region query parameter from? The API only supports state, not region.

from api.aladhan.com.

AlGantori avatar AlGantori commented on August 26, 2024

Back in issue #52 I had asked whether "region" was an accepted parameters. I must have gotten side-tracked with your fix to a different issue and never double checked the returned timings where correct.
Because I started using a geolocation service returning "region" I must have "believed" is was accepted by this API.
TODO: Perhaps your API can return an error about illegal parameters in the future.
The following is now returning the expected times
https://api.aladhan.com/v1/timingsByCity/11-03-2023?country=US&state=Oregon&city=Corvallis&method=2&adjustment=1

Thank you for the catch, much appreciated.
Jazaakum Allahu Khayran! and Ramadhan Mubaarak and Kareem !!!

from api.aladhan.com.

meezaan avatar meezaan commented on August 26, 2024

Back in issue #52 I had asked whether "region" was an accepted parameters. I must have gotten side-tracked with your fix to a different issue and never double checked the returned timings where correct. Because I started using a geolocation service returning "region" I must have "believed" is was accepted by this API. TODO: Perhaps your API can return an error about illegal parameters in the future. The following is now returning the expected times https://api.aladhan.com/v1/timingsByCity/11-03-2023?country=US&state=Oregon&city=Corvallis&method=2&adjustment=1

Thank you for the catch, much appreciated. Jazaakum Allahu Khayran! and Ramadhan Mubaarak and Kareem !!!

Illegal query parameters are simply ignored - throwing errors for those is bordering an extreme in my humble opinion. Sometimes client side JavaScript calls append a timestamp or random query parameter to bypass caching, and that would result in failing calls.

It's a public API, so flexibility is always important. But reading the documentation is always the simplest way to get it right.

By the way, you can also just simply use the timingsByAddress endpoint, and just pass one string in the address query parameter.

JazakAllah for the Ramadan wishes! May yours be full of blessings too!

from api.aladhan.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.