1

I am uploading data using Thingspeak and I would like to get only values stored in a field. Is there any way to get this in a cvs http request?

When you call a cvs http url, you get:

enter image description here

What I am trying to get is just the value in field2: 10,10,12,12,16 without the headers.

4
  • Is your hope to get just the content of field2 via the HTTP request? Or are you looking for a way to parse the data to get the content of the field?
    – dlu
    Commented Dec 9, 2015 at 3:18
  • I woud like to get just the content of field2 via HTTP request to integrate data into an array of chart library that only accepts thins kind of data.
    – user19566
    Commented Dec 9, 2015 at 10:00
  • Where you wrote, “i would like to get only values stored in a field.Is there any way to get this in a csv http request?.When you call a csv http url,you get: created_id,entry_id,field1,field2 2015-10-22 19:30:00,14878,18,5 ,what i am trying to get is only the value in field2: 5 without headers”, does “csv” stand for comma separated values or is it some other acronym? Please edit your question and make it more understandable. Commented Dec 9, 2015 at 20:15
  • The csv url data comes with comma separated values and all data is the first field when they opened with excel.I have edited the question and added a picture to show the format.
    – user19566
    Commented Dec 10, 2015 at 9:19

1 Answer 1

0

You can use this format to achieve what you described:

http://api.thingspeak.com/channels/(channel_id)/field/(field_id).(format)

Source: http://community.thingspeak.com/documentation/api/

Edit: It seems that there are no available options that can do what you want. But, you can tweak the response like in this example:

  int i;
  String response = "created_at,entry_id,field2 2015-10-22 19:30:00,14878,5";

  for (i = response.length()-1; i >= 0 ; i--)
  {
    if (s.charAt(i) == ',') break;
  }
  String value = response.substring(i+1);
  Serial.println(value); // This will show only 5
2
  • Hello. Thanks for your reply. I already tried that option through the following url:https://thingspeak.com/channels/(channel_id)/fields/field2.csv?key=***&results=1 ,but the final result is: created_at,entry_id,field2 2015-10-22 19:30:00,14878,5,so i don't know if there is more url options to get only 5 value. Thanks.
    – user19566
    Commented Nov 10, 2015 at 9:34
  • It seems there are no options like that, but you can always try my answer.
    – Ikbel
    Commented Nov 10, 2015 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.