Is there a way to programmatically retrieve a list of kindle ebooks that a user has purchased?
I've searched for an answer extensively on SO, however the few related questions I could find are ancient. The Amazon documentation is also not very helpful as from what I can tell the Amazon Associates Program API only lets you do lookups against Amazon's product database, it doesn't let you retrieve information for a signed in user.
Yes there is. Due to the bloated and extremely slow management web page for the kindle I invested quite a few hours into finding a way of creating my own. So far, there is just a library of functions for listing and deleting titles (books and personal docs), but you can make useful stuff on top of it. You can find a Python version here and a JS version here.
This is alpha-quality, reverse-engineered software, that is literally a few minutes old as I write this, but if it scratches your itch ...
Beware: it is not suitable for third parties as you need the email and password of the user. For general, safe, third-party access to that info you would need OAuth support on Amazon's side.
No. User purchase history is not available externally. Think about this from reverse, would you want Amazon to make available to third-parties everything you may have purchased? I know I wouldn't, and I suspect most customers would not either. Hence, it's unlikely such an API would ever exist.
Your best bet is to find what files are downloaded on the device and somehow infer the titles. Using that route you run into needing to do an ANR (Ambiguous Name Resolution) based on filenames, and if that fails then you'll need to find a way to crack open the files, bypass the DRM encryption, and read metadata.
This isn't anything as good as a web service, but, if you're the user (i.e., you're trying to get a list of the titles you own): If you install Kindle for PC then you can let it sync and then look in %LOCALAPPDATA%\Amazon\Kindle\Cache\KindleSyncMetadataCache.xml
. It contains the ASIN and some other fields (title, authors) (doesn't have purchase date). Seems to contain only books, though that could just be because I don't have documents sent to my Kindle for PC.
(And I hope they don't encrypt it in the future...)
来源:https://stackoverflow.com/questions/12503231/amazon-purchased-kindle-books-from-api