Using APIs in Thunkable and understanding how to parse JSON to get certain data from the API response is both a popular and a difficult aspect of using Thunkable. It’s not so much difficult because of Thunkable but because every API url format is different, every API documentation is different, every JSON response is different, etc.
In this video, I spend a lot of time talking you through some best practices. It’s not a quick tutorial because if you rush through setting up an API in Thunkable, you’re probably going to make a lot of mistakes and waste a lot of time.
If you watch this and still have problems – and you will! – make sure to include the following when you post a question on the forums:
- What is the name of the API you are using? For example: “Open Weather API”
- What is the full url of the API you are accessing (do not include the actual API key)? For example: https://api.openweathermap.org/data/2.5/weather?q=oakland&units=metric&APPID=[my_api_key]
- What is the full text of the response you get when visiting the full url in a browser (not in Thunkable)? That’s the entire wall of text that starts and ends with curly brackets { }
- If you are using Thunkable blocks, what is the value of the green “error” block?
- Include a screenshot of your blocks in Thunkable, especially the Web API URL and Web API Get blocks.