# Call API, not returning JSON, but HTML

**URL:** <https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030>\
**Category:** Ask for Help\
**Created:** [March 28, 2025, 2:15am UTC](https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030 "2025-03-28T02:15:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deny\_Pratama](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/deny_pratama/32/61099_2.png) [@Deny\_Pratama](https://community.glideapps.com/u/Deny_Pratama)\
**Post date:** [March 28, 2025, 2:15am UTC](https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030/1 "2025-03-28T02:15:32Z")

</div>

Hi Experts.  
I think I have followed step by step to Call API, but the response is not in JSON format, but in HTML format (although I think in that HTML-format response, I found the information I need).

I am making my weather prediction in my country with the API from our nation’s weather service body:  
[https://api.bmkg.go.id/publik/prakiraan-cuaca?adm4={kode\_wilayah\_tingkat\_iv}](https://api.bmkg.go.id/publik/prakiraan-cuaca?adm4=%7Bkode_wilayah_tingkat_iv%7D)

parameter {kode\_wilayah\_tingkat\_iv} replaced with 71.71.08.1011.

I have made the Construct URL column (API\_BMKG), and it did return the correct JSON format when I paste the constructed URL. Here is the constructed URL form the API:  
[https://api.bmkg.go.id/publik/prakiraan-cuaca?adm4=71.71.08.1011](https://api.bmkg.go.id/publik/prakiraan-cuaca?adm4=71.71.08.1011)

 ![Screenshot 2025-03-28 at 08.50.29](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/a/9af6a3bb46d829ebf4c794ba2fe6b10b162375d8.jpeg)

 ![Screenshot 2025-03-28 at 10.09.37](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/b/dbfb0d9b5ac243a0580db659b87c0cc0a80ad565.png)

If I copy then paste the constructed URL, it returned the right JSON format, like below:

 ![Screenshot 2025-03-28 at 08.51.21](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/8/38df24af5e8a0237b8b0cc9884bc0b937a8ecfa3.jpeg)

But when I created a button to Call API, it returned not in pure JSON format (HTML, I think):

 ![Screenshot 2025-03-28 at 08.50.08](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/d/6d0506318e8ec5a47a585e66c6425bd3aee30b0c.jpeg)

This is the button configuration in Workflow:

 ![Screenshot 2025-03-28 at 10.14.13](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/f/2f8015e9cb5bf26e0009a44cd10d3e911e31a782.jpeg)

Please guide me what should I do to get the correct JSON format, so I can move on. Thank you.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 28, 2025, 3:08am UTC](https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030/2 "2025-03-28T03:08:01Z")

</div>

You need to pass the `adm` part as a query parameter, like below:

 ![CleanShot 2025-03-28 at 11.06.00@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/d/5d9512d13fd73205eec389797e37011471601c7e.png)

Then you should get the response as JSON:

 ![CleanShot 2025-03-28 at 11.07.26@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/4/c494ecb73ccf1dad6153c131479becf268467a9e.jpeg)

---

<div class="post-metadata">

**Author:** ![Deny\_Pratama](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/deny_pratama/32/61099_2.png) [@Deny\_Pratama](https://community.glideapps.com/u/Deny_Pratama)\
**Post date:** [March 29, 2025, 12:44am UTC](https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030/3 "2025-03-29T00:44:38Z")

</div>

Thank you once again. By following your suggestion, I figured out my mistake and fixed it.

Using JSON is something brand new for me as a non-IT developer. Appreciate.

---

<div class="post-metadata">

**Author:** ![Deny\_Pratama](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/deny_pratama/32/61099_2.png) [@Deny\_Pratama](https://community.glideapps.com/u/Deny_Pratama)\
**Post date:** [March 29, 2025, 1:07am UTC](https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030/4 "2025-03-29T01:07:47Z")

</div>

Pardon, Darren. Before I make another ask for help topic, is there any way to import a table from an HTML page? Because I can do it on Google Sheet with formula IMPORTHTML and targeting the table name. Thank you 🙏

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 29, 2025, 1:15am UTC](https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030/5 "2025-03-29T01:15:24Z")

</div>

I’d suggest experimenting with the following columns:

- Get Webpage Source
- Text to JSON

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [April 5, 2025, 1:15am UTC](https://community.glideapps.com/t/call-api-not-returning-json-but-html/81030/6 "2025-04-05T01:15:46Z")

</div>

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