I am having trouble receiving data from an api called weatherbit
it requires an api key which i have given, I want to just display the weather from the response.
It also requires:- (which are given)
- Latitude & Longitude (which are given through
This what I have tried so far: -
You need to fist check the green error block to see that the API has been executed successfully before attempting to read the response block.
When using an API with Thunkable, the first step should be to make sure you can get a valid JSON response in a browser without using Thunkable. What happens if you paste the whole url into a browser? Does that work? If so, post that response here as text and format it using the “Preformatted text” button in the toolbar ( </> ).
Also, I don’t think there is a “temp” property at the top level of the JSON. So once we have your JSON response, we can help you figure out how to access that property. You may find my tutorial helpful: API JSON Tutorial (Video).
Edit: there are many “temp” properties but the first one is here:
You can see on Best JSON Viewer and JSON Beautifier Online that the path to that property shown at the top is “data.temp” whereas you’re trying to access it as just “temp”.
I got my mistake by your tutorial, Thanks @tatiang @muneer for replying!