How to POST / write continuous data to Thingspeak for visualization & analysis using the API link?

I’m doing school project right now, building an app using the Thunkable (free version). So the process is that app will send the continuous data detected by the phone gyroscope/accelerator sensors by using the POST api link formatting to ThingspeakxMatlab(free version) for data visualization and analysis, that the data detected by the phone sensor through the app will be compared with a set of data so that the Thingspeak will classify the conditions of the users.
I tried to post the data from the app to Thingspeak in many ways but it doesn’t work. Is there steps I have done wrong? How should I write the api link to send the data to Thingspeak? Should I use different platforms to do my work?


1 Like

What do the thingspeak docs recommend for connecting to their platform?

Here is where I get the reference. REST API - MATLAB & Simulink

You should be able to POST data to almost any REST endpoint. If you need to stream data, that’ll be a different case.

The docs indicate a POST should work, i encourage you to digest those docs and read through the forums as there are great examples of working with API’s.

We also have some great examples of working with API’s at academy.thunkable.com

You are mixing between the text type and the JSON type.

You are using the text format of the API and therefore you should use it this way

https://api.thingspeak.com/update?api_key=xxxxxxxxxxxx&field1=73

Try this from your browser after replacing xxxxxx with your API KEY and you should get a response.

Thank you for the help. I try to send the gyroscope value to Firebase Realtime database and it works well in showing the values in the text blocks only if I put the gyroscope1 block inside a “run forever” loop. (I still cannot send the values per second using the loop blocks though)

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