[SOLVED] RESTful API and GETing all history of a pin

Wahoo! Thanks for implementing a RESTful API which makes it nice and easy to get the data out via code in a usable format :slight_smile:
I have managed to get the current pin data using
cloud. blynk. cc:8080/authcode/pin/V4
but when I try to get all history using
cloud. blynk. cc:8080/authcode/data/V4
I get zero records returned.

If I follow the instructions on docs. blynkapi. apiary. io/#reference/0/get-pin-value/get-pin-value, I get an error because of the http://blynk-cloud.com/… address as opposed to http://cloud.blynk.cc:8080/…
I assumed that I could use the same syntax i.e. …/data/… but I don’t get any data back. No error, just no data. How can I get a pin’s history via the API? :confounded:

This was retired more than 12 months ago, you can only use blynk-cloud.com (or the IP for blynk-cloud.com or your local server).

Thanks for the reply. That kind of explains it (retired but still returns the current value of a pin?) but if I use
http://blynk-cloud.com/107468d84135467bbea921160b8xxxxx/data/v4
I get “invalid token” when I use it in the apiary console yet I get a csv.gz file back if I put the address into a browser. So the token is valid.
A work around could be by simply pointing at the URL but as it comes back as a .gz file, I can’t do this automatically.
Can I use REST to get the data as JSON or as a (non-zipped) csv?

I don’t think the console actually does anything, it just provides the syntax but I could be wrong.

Other than obtaining the csv.gz I’m not sure how else you can obtain the data.

How much data is it i.e. how often is the pin updated?

What would you like to do with the data when you have obtained it?

It brings data and a header back from somewhere so I think it’s doing more than providing syntax.

The CSV from the last 5 months is 900kB so not really massive in the scheme of things. I want to connect Qlik Sense to it (hopefully via REST) so I can use its analytic capabilities. I’ve done this in a few minutes by downloading the CSVs for each pin, but as they’re zipped, I can’t do this automatically (the pin is updated every 10 seconds although this isn’t critical and once every 5 minutes would be acceptable).
This http://docs.blynkapi.apiary.io/#reference/0/pin-history-data/get-all-history-data-for-specific-pin?console=1 tells me I can do it but I can only get a zipped CSV back?

But the Blynk servers around the world all have different user accounts on them so the only way it would work is to use the correct IP address and not blynk-cloud.com i.e. when you access blynk-cloud.com it is different to the one I connect to, understand?

I can get the IP back with a PING and use this as the connection string, but it’s no different as the DNS record is simply doing what I’m doing in advance i.e. looking up a physical IP address from a DNS record? Also, there’s no difference in the result if I use the IP or the domain.
Can I get to the non-compressed history any other way? Local server?

Yes the docs cover setting up a database on a local server.

12 posts were split to a new topic: Where I can find API docs to configure local server to not compress history