How to retrieve specific set of fields in response instead of all the fields

  • 1
  • Question
  • Updated 3 years ago
How to retrieve only a specific set of information ?

For example:
http://api.wunderground.com/api/key/c...

returns all the fields. I just need to have 5-7 major fields, How to get response (json file) just for specific columns? Is there anyway to specify it ?

Thanks,
Shri
Photo of shri01

shri01

  • 2 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 1
Photo of afelicioni

afelicioni

  • 227 Posts
  • 43 Reply Likes
Sorry, unfortunately current API version doesn't offer ways to filter fields from queries.
Photo of Paul D Smith

Paul D Smith

  • 2 Posts
  • 1 Reply Like
Was going to ask exactly the same question.  I'm trying to use the API on an Internet of Things (IoT) device with very limited capabilities and the response is far too large for what I really need.  Some way to just request specific fields would be very nice.
Photo of Ravi Yadav

Ravi Yadav

  • 82 Posts
  • 9 Reply Likes
I have seen 2 approaches: 

1. Parse the data off-board, i.e. have a node server or cloud service etc. Make the call, parse it, and send the wanted results to the device.

2. There are some libraries available that try and parse json, success depends on the particular program and hardware but its possible to do all the work in-device. ex: https://github.com/bblanchon/ArduinoJson
Photo of Paul D Smith

Paul D Smith

  • 2 Posts
  • 1 Reply Like
Thanks Ravi.  I'm using an ESP8266-01 and it does have a JSON parsing library.  I've not had a chance to implement the code yet so I'm hoping the resulting code will fit on the board together with the other parts of my project.