Question

I have a Google Sheet that tracks the number of pyjamas supplied and demanded on eBay at various price points. For example:

 At Price    There were so many listings    and so many bids
 $90         20                             25
 $100*        15                             17

*extra cozy pyjamas

Every day I updated these data. This involved writing over revised data. Fortunately, Google Sheets saved a decent quantity of the document's revision history. I want to recover those data, ideally panel-wise by time, e.g.:

On New Year's Eve
data

The next day
too drunk to input data

How do I extract the data from the latest revision on each day (feel free to define days liberally, albeit consistently)?

Was it helpful?

Solution

You can use the documents list API to access all existing revisions for a given document, and then iterate through all of them, taking from them at intervals of 24 hrs (which you can check with the updated attribute existing on each recision entry). Then you can download the document of each revision taken.

Structurally, it would be a HTTP GET request for the revisions of a given document (something like https://docs.google.com/feeds/default/private/full/resource_id/revisions) and then iterate through those, and then just GET the ones that fit your criteria (of being spaces 24 hours apart).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top