# API results null

**URL:** <https://community.thunkable.com/t/api-results-null/2898406>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [March 17, 2024, 12:21am UTC](https://community.thunkable.com/t/api-results-null/2898406 "2024-03-17T00:21:44Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [March 17, 2024, 12:21am UTC](https://community.thunkable.com/t/api-results-null/2898406/1 "2024-03-17T00:21:44Z")

</div>

Hi All,

I try to work on this API but seem not shows.  
here the details.

URL :[https://api.aladhan.com/v1/calendarByCity/2024/4?city=Kualalumpur&country=Malaysia&method=2](https://api.aladhan.com/v1/calendarByCity/2024/4?city=Kualalumpur&country=Malaysia&method=2)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 17, 2024, 2:46am UTC](https://community.thunkable.com/t/api-results-null/2898406/2 "2024-03-17T02:46:48Z")

</div>

that URL returns data ! a huge amount.  
what fields do you want to extract.  
the fields (and json structure) can be found here

> **[Prayer Times API - Prayer Times and Adhan Player](https://aladhan.com/prayer-times-api#GetHijriCalendar)**
>
> Prayer Times API - Prayer Times and Adhan Player

specify the fields you want to obtain. do you want to get some fields for one day only,specificy city or all fields for all days.

please specify what you want to get.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [March 17, 2024, 3:11am UTC](https://community.thunkable.com/t/api-results-null/2898406/3 "2024-03-17T03:11:57Z")

</div>

Hi @manyone ,

Thank you for your respond.  
what i want from current date today it will show prayer times such as Fajr, Sunshine and Asr and location let say Europe/London.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 17, 2024, 3:38am UTC](https://community.thunkable.com/t/api-results-null/2898406/4 "2024-03-17T03:38:15Z")

</div>

there are 9 timings  
“Fajr”: “03:57”,  
“Sunrise”: “05:46”,  
“Dhuhr”: “12:59”,  
“Asr”: “16:55”,  
“Sunset”: “20:12”,  
“Maghrib”: “20:12”,  
“Isha”: “22:02”,  
“Imsak”: “03:47”,  
“Midnight”: “00:59”  
do you want only fajr,sunshine and asr ? or all 9?

is the school (method of computation) to be supplied or use default 0=shafi  
do you have a list of city country combinations or it should generate choices from the json - so user can pick? or it should pick from your current location (as detercted by your mobile)?

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [March 17, 2024, 4:16am UTC](https://community.thunkable.com/t/api-results-null/2898406/5 "2024-03-17T04:16:37Z")

</div>

i want 6 of timing such as farj, sunrise, Dhuhr, Asr, Maghrib and Isha. each of them at different button or label.  
method of computation should be default one.  
Country Malaysia and city let user choose it such as kuala lumpur or Selangor.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 17, 2024, 8:02am UTC](https://community.thunkable.com/t/api-results-null/2898406/6 "2024-03-17T08:02:47Z")

</div>

right now -it’s specific for kuala lumpur, malaysia only.  
the button performs the lookup. today’s date is always taken, in the current month.  
here’s my output

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/075cf5dd9ee05330891d45d6280a8ee3fc5ee05b.png)

here’s the link to the program (go to screen named PrayerTime)  
[https://x.thunkable.com/copy/191fcb46b99362b7978400b30f89375d](https://x.thunkable.com/copy/191fcb46b99362b7978400b30f89375d)

here’s the code:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/4/8409397af789be64bd4ef4045aa7dbaba620c8e4.png)

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [March 17, 2024, 2:41pm UTC](https://community.thunkable.com/t/api-results-null/2898406/7 "2024-03-17T14:41:58Z")

</div>

@manyone

Apreacited your time and effort.

I will try to simulated the block to my page. i will let you know my opinion on this.

thanks again.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [March 18, 2024, 3:46am UTC](https://community.thunkable.com/t/api-results-null/2898406/8 "2024-03-18T03:46:23Z")

</div>

Hi @manyone

I tried simulating the block again, but it did not appear to work on my end.  
Maybe you can show me which part I am doing wrong.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/1/d1594e3a24988fcc11ac130033b4d4894f99985e.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/0/50ab33077de76644c00669352ba9f40b6be7655b.png)

[https://x.thunkable.com/copy/daf5eb4d4a61ce7d0383163c80b20696](https://x.thunkable.com/copy/daf5eb4d4a61ce7d0383163c80b20696)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 18, 2024, 3:55am UTC](https://community.thunkable.com/t/api-results-null/2898406/9 "2024-03-18T03:55:44Z")

</div>

Your Web API url is different from @manyone’s. Not sure if that’s causing the problem but it might.

**Edit:** I tried your url in @manyone’s project and it still worked.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 18, 2024, 5:54am UTC](https://community.thunkable.com/t/api-results-null/2898406/10 "2024-03-18T05:54:10Z")

</div>

thanks to @tatiang for responding to your issue.  
as he mentioned, your new url still works in my blocks, but the results are probably not what you expect.

it happens to work because the 2 api calls have the same required parameters.

> [http://api.aladhan.com/v1/calendarByCity/2024/3?city=...&country=](http://api.aladhan.com/v1/calendarByCity/2024/3?city=...&country=)…  
> [http://api.aladhan.com/v1/hijriCalendarByCity/2024/3?city=...&country=](http://api.aladhan.com/v1/hijriCalendarByCity/2024/3?city=...&country=)…

in version1, the year and month are obtained from the device automatically. However in version 2, the year and month are supposed to be valid values from the hijri calendar and the webapp may have converted the numbers to a different year and month!

look at the dates displayed by calling a differen url

**version 1 calendarByCity**  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/3/13aa3f2a99e1fb422405c5fdc211b84bd9f2fc32.png)

**version2 hijriCalendarByCity**  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/4/5475dcefc067ae7d2743bbe954a9a05bd6b0d122.png)

i suggest you stick to version 1 only

> [http://api.aladhan.com/v1/calendarByCity/2024/3?city=](http://api.aladhan.com/v1/calendarByCity/2024/3?city=).

i

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [March 18, 2024, 7:15am UTC](https://community.thunkable.com/t/api-results-null/2898406/11 "2024-03-18T07:15:24Z")

</div>

change url up to this sentence right? “[http://api.aladhan.com/v1/calendarByCity/](http://api.aladhan.com/v1/calendarByCity/)” or full url?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/0/40ace92ceec75290834a360e586b884e6206fa84.png)

still not work from my end.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 18, 2024, 7:20am UTC](https://community.thunkable.com/t/api-results-null/2898406/12 "2024-03-18T07:20:55Z")

</div>

> [@ozel1978](#):
>
> [http://api.aladhan.com/v1/calendarByCity/](http://api.aladhan.com/v1/calendarByCity/)

the first slot in your join block should contain this text:

> [http://api.aladhan.com/v1/calendarByCity/](http://api.aladhan.com/v1/calendarByCity/)

change the slot “?country” to “&country”

you also need to change the properties of your text input field by clicking on the Advance tab  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/2/d207ab39b773c901cecd546ea375a7f379230cde.png)

and making the settings for those shown below

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/1/81d2ea8c3f89db745785c0ce0ef88563ad87a691.png)

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [March 18, 2024, 3:36pm UTC](https://community.thunkable.com/t/api-results-null/2898406/13 "2024-03-18T15:36:36Z")

</div>

Thank you @manyone it worked now.

I am try to understand your block.

any chance if i want to create sunrise one text, dhuhr one text? what should i change?

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 18, 2024, 4:23pm UTC](https://community.thunkable.com/t/api-results-null/2898406/14 "2024-03-18T16:23:38Z")

</div>

Simple. Create a new routine, call it get\_timing\_text, copy from get\_timing2 but simply return the “get property…” value of the timing. Do not use the join block.

if you want to show the timings on screen in their own box, you have to do this statement below for one label , for example sunrise. (you have to convert to block, of course)  
Set label\_sunrise = get\_timing\_text(“sunrise”)

And do that for every timing you want (you have to define all labels first and put them in the screen where you want, of course)

Then you can delete the 'for each item" block.

You can do it

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [June 6, 2024, 8:44am UTC](https://community.thunkable.com/t/api-results-null/2898406/15 "2024-06-06T08:44:07Z")

</div>

Hi @manyone

I was doing something on block and somehow the Farj data not populate. i try to figure out but did not find the source. Appreciated if you can advice me how to get back the data. here the link and block.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/7/e701f8ce774f6bc20faa8ddf75143279b6aed9f6.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/4/e414300fe7436543c9086afbf6d65f06da307d1a.png)  
[https://x.thunkable.com/copy/c323e372380438c265fa7ba9e56b7b1c](https://x.thunkable.com/copy/c323e372380438c265fa7ba9e56b7b1c)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [June 6, 2024, 5:08pm UTC](https://community.thunkable.com/t/api-results-null/2898406/16 "2024-06-06T17:08:08Z")

</div>

you misspelled ‘Fajr’

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [June 7, 2024, 12:59am UTC](https://community.thunkable.com/t/api-results-null/2898406/17 "2024-06-07T00:59:40Z")

</div>

my bad, thank you for your help.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [June 7, 2024, 7:20am UTC](https://community.thunkable.com/t/api-results-null/2898406/18 "2024-06-07T07:20:09Z")

</div>

i enhance a bit of your block by adding a few cities. so users able to select which cites their belong. That good enough for now. Thank again @manyone

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/a/7ab213fae7facdde051a8709dea1c79cd604d9cb.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [September 5, 2024, 7:20am UTC](https://community.thunkable.com/t/api-results-null/2898406/19 "2024-09-05T07:20:42Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
