# Unable to parse data with API, please help?

**URL:** <https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920>\
**Category:** Questions about Thunkable X\
**Created:** [March 2, 2021, 7:43pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920 "2021-03-02T19:43:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![thecodingmasterabeer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/thecodingmasterabeer/32/90158_2.png) [@thecodingmasterabeer](https://community.thunkable.com/u/thecodingmasterabeer)\
**Post date:** [March 2, 2021, 7:43pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/1 "2021-03-02T19:43:47Z")

</div>

Hi All,

I am trying to consume a news app API. all I am trying to do is setting the URL of API (includes the key) and fetching the image of first news article on an image component. Not sure what is going wrong and Thunkable on running the app doesn’t even shows the error but goes blank instead (super irritating as how we are suppose to debug if something is not right).

URL of API with Key:  
[http://newsapi.org/v2/top-headlines](http://newsapi.org/v2/top-headlines)? **sources=google-news-in** &apiKey=0d9cacd76c4a49ffa0f295214bcbdea8

Thunkable blocks:

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

JSON Viewer:

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

**API JSON response:**  
{  
“status”: “ok”,  
“totalResults”: 9,  
“articles”: [  
{  
“source”: {  
“id”: “google-news-in”,  
“name”: “Google News (India)”  
},  
“author”: “Kumar Shakti Shekhar”,  
“title”: “Gujarat local body election results: BJP reigns supreme, Congress slides as AAP rises”,  
“description”: “India News: The counting for the Gujarat local body elections on Tuesday has thrown up almost the same results as those of the municipal corporation polls declare”,  
“url”: “[Gujarat local body election results: BJP reigns supreme, Congress slides as AAP rises | India News - Times of India](https://timesofindia.indiatimes.com/india/gujarat-local-body-election-results-bjp-reigns-supreme-congress-slides-as-aap-rises/articleshow/81296933.cms)”,  
“urlToImage”: “[https://static.toiimg.com/thumb/msid-81296985,width-1070,height-580,imgsize-233016,resizemode-75,overlay-toi\_sw,pt-32,y\_pad-40/photo.jpg](https://static.toiimg.com/thumb/msid-81296985,width-1070,height-580,imgsize-233016,resizemode-75,overlay-toi_sw,pt-32,y_pad-40/photo.jpg)”,  
“publishedAt”: “2021-03-02T16:20:00+00:00”,  
“content”: “Results of the Nagar Palika, Taluka Panchayat and District Panchayat polls across Gujarat give a crystal clear mess [https://t.co/dJERzTyu5X\r\n—](https://t.co/dJERzTyu5X%5Cr%5Cn%E2%80%94) Narendra Modi (@narendramodi) 1614687609000”  
},  
{  
“source”: {  
“id”: “google-news-in”,  
“name”: “Google News (India)”  
},  
“author”: “Radhika Ramaseshan”,  
“title”: “Will Bengal, Tamil Nadu put a spanner in the BJP’s well-oiled election machinery?”,  
“description”: “India News: Unlike the Congress, which was happy as long as it dominated Delhi, the BJP believes in a clean sweep both at the Centre and the states.”,  
“url”: “[https://timesofindia.indiatimes.com/india/will-bengal-tamil-nadu-put-a-spanner-in-the-bjps-well-oiled-election-machinery/articleshow/81275896.cms](https://timesofindia.indiatimes.com/india/will-bengal-tamil-nadu-put-a-spanner-in-the-bjps-well-oiled-election-machinery/articleshow/81275896.cms)”,  
“urlToImage”: “[https://static.toiimg.com/thumb/msid-81275870,width-1070,height-580,imgsize-1,resizemode-75,overlay-toi\_sw,pt-32,y\_pad-40/photo.jpg](https://static.toiimg.com/thumb/msid-81275870,width-1070,height-580,imgsize-1,resizemode-75,overlay-toi_sw,pt-32,y_pad-40/photo.jpg)”,  
“publishedAt”: “2021-03-01T13:29:00+00:00”,  
“content”: “India News: Unlike the Congress, which was happy as long as it dominated Delhi, the BJP believes in a clean sweep both at the Centre and the states.”  
}  
]  
}

Looking forward to positive response!

---

<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 2, 2021, 8:44pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/2 "2021-03-02T20:44:05Z")

</div>

First of all, **thank you** for providing so many details including the full API url and screenshots of the blocks and the JSON data. That makes helping you so much easier and faster.

I actually think your blocks are correct. 🤷‍♂️

I’ll try it myself and see what happens…

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 2, 2021, 8:46pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/3 "2021-03-02T20:46:41Z")

</div>

The URL of the API component starts with [https://Jasonviewer.stack.hu](https://Jasonviewer.stack.hu)…

Are you sure about it?

---

<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 2, 2021, 8:47pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/4 "2021-03-02T20:47:50Z")

</div>

> [@thecodingmasterabeer](#):
>
> [http://newsapi.org/v2/top-headlines?\*\*sources=google-news-in](http://newsapi.org/v2/top-headlines?**sources=google-news-in)\*\* &apiKey=(removed)

Good catch! The blocks are correct… the url is wrong.

Also, you might not want to post a full API key here on the forums. Anyone can use your key and you might even get charged money for that use.

---

<div class="post-metadata">

**Author:** ![thecodingmasterabeer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/thecodingmasterabeer/32/90158_2.png) [@thecodingmasterabeer](https://community.thunkable.com/u/thecodingmasterabeer)\
**Post date:** [March 3, 2021, 5:19am UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/5 "2021-03-03T05:19:25Z")

</div>

Um no, actually this is the link for the JSON Viewer.

---

<div class="post-metadata">

**Author:** ![thecodingmasterabeer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/thecodingmasterabeer/32/90158_2.png) [@thecodingmasterabeer](https://community.thunkable.com/u/thecodingmasterabeer)\
**Post date:** [March 3, 2021, 5:23am UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/6 "2021-03-03T05:23:37Z")

</div>

OK @tatiang, will take care of this from now on.  
Even I thought at a certain point of time, that the API had some error.  
P.S. You and @muneer are my favorite members of the Thubkable community. 😊

---

<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 3, 2021, 5:24am UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/7 "2021-03-03T05:24:21Z")

</div>

> [@thecodingmasterabeer](#):
>
> Um no, actually this is the link for the JSON Viewer.

Sure, but your “set ApiNews’s URL to” block needs to use the url [http://newsapi.org/v2/top-headlines?sources=google-news-in&apiKey=0d9cacd76c4a49ffa0f295214bcbdea8](http://newsapi.org/v2/top-headlines?sources=google-news-in&apiKey=0d9cacd76c4a49ffa0f295214bcbdea8)

And thank you for the kind words. There are quite a few very helpful and knowledgeable people here.

---

<div class="post-metadata">

**Author:** ![thecodingmasterabeer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/thecodingmasterabeer/32/90158_2.png) [@thecodingmasterabeer](https://community.thunkable.com/u/thecodingmasterabeer)\
**Post date:** [March 3, 2021, 8:48am UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/8 "2021-03-03T08:48:07Z")

</div>

> [@tatiang](#):
>
> Sure, but your “set ApiNews’s URL to” block needs to use the url [http://newsapi.org/v2/top-headlines?sources=google-news-in&apiKey=0d9cacd76c4a49ffa0f295214bcbdea8](http://newsapi.org/v2/top-headlines?sources=google-news-in&apiKey=0d9cacd76c4a49ffa0f295214bcbdea8)

Hey!  
Tried this too, yet in the Preview, the screen is disappearing.

---

<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 3, 2021, 8:58am UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/9 "2021-03-03T08:58:28Z")

</div>

If you get a white screen, that usually means that you are trying to get a property that doesn’t exist.

Can you post a link to your project? Or if not, then a screenshot of your blocks – assuming they’ve changed?

---

<div class="post-metadata">

**Author:** ![thecodingmasterabeer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/thecodingmasterabeer/32/90158_2.png) [@thecodingmasterabeer](https://community.thunkable.com/u/thecodingmasterabeer)\
**Post date:** [March 3, 2021, 11:21am UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/10 "2021-03-03T11:21:19Z")

</div>

Hey, All thank you so much, its all working now.

Steps to fix:

1. Change URL to proper API url (I mistakenly added Json viewer url. Thanks @tatiang . @muneer for catching that).
2. Any project with API doesn’t work with LiveTest (I mean on computer). You have to test the same on Thunkable live on mobile device.

I know , it was silly on my part on putting bad URL and expecting the app to work on Computer. Two learning from here.

Thanks everyone for the collaboration!

Thunkable community rocks!! 🚀 🚀 🚀

@thecodingmasterabeer

---

<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 3, 2021, 4:04pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/11 "2021-03-03T16:04:13Z")

</div>

> [@thecodingmasterabeer](#):
>
> 1. Any project with API doesn’t work with LiveTest (I mean on computer). You have to test the same on Thunkable live on mobile device.

Just a point of clarification: APIs sometimes do work when Live Testing in a browser. But they often do not. I haven’t figured out why some do and some don’t.

---

<div class="post-metadata">

**Author:** ![thecodingmasterabeer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/thecodingmasterabeer/32/90158_2.png) [@thecodingmasterabeer](https://community.thunkable.com/u/thecodingmasterabeer)\
**Post date:** [March 6, 2021, 3:33pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/12 "2021-03-06T15:33:37Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:29pm UTC](https://community.thunkable.com/t/unable-to-parse-data-with-api-please-help/1137920/13 "2024-11-08T13:29:03Z")

</div>


