How to get json data from ThingHTTP API | ThingSpeak Apps | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
How to get json data from ThingHTTP API
No permission to create posts
January 29, 2018
12:44 pm
New Member
Forum Posts: 1
Member Since:
January 29, 2018
sp_UserOfflineSmall Offline

Hi, I am new to Thingspeak and I am now struggling with the ThingHTTP. 

I am sending a http get request to receive data for my ESP8266. So far, everything is working perfectly well. My problem is that I need the data in the json format. Where can I specify, that thingspeak gives me a json format back to my get request? What do I have to type into the "Content Type:" field?

Thanks for your helpLaugh

January 31, 2018
9:38 am

Forum Posts: 867
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

Generally the HTTP requests end in the format you need (before the parameters).  Thingspeak supports JSON and XML for most endpoints.  Some of them also support TXT and CSV.

For example 
will return 2 results from a private channel in JSON format.
will return 2 days of results from field 6 of channel 987654321 (up to 8000 entries) and include location information, as long as the channel is public.

For GET requests, you do not need content type.  If you need to include that header, you can usually specify application/x-www-form-urlencoded unless you are using Bulk Update.

Have a look at the REST API documentation for more info.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Team_mafia, icXu, emorphistechno, VTVMART, manimozhi, adamhebrew

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457