projecthorus / sondehub-infra

GNU General Public License v3.0
26 stars 4 forks source link

API data using wget or curl #31

Closed weather01089 closed 2 years ago

weather01089 commented 2 years ago

under linux, trying to retrieve sounding telemetry using wget or curl. It creates a file, but its all hex. Doing it in a browser with the wget on the test page is fine. What wget or curl options do I need for command line in Ubuntu?

Ray

darksidelemm commented 2 years ago

This would be because the data is probably GZIP compressed (to save bandwidth). This is signified in the HTTP headers (Content-Encoding: gzip), but not all clients will respect that as-is.

There are a few ways to deal with it:

$ curl -L --compressed https://api.v2.sondehub.org/sonde/S4350348
$ curl -L https://api.v2.sondehub.org/sonde/S4350348 | gunzip

These both have the same effect. Note the use of -L allows redirects, which are used by all the APIs.

Hopefully this helps! If not, feel free to re-open the issue.