Amazon Purchased Kindle books from API
Asked Answered
S

3

9

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.

Slave answered 19/9, 2012 at 21:34 Comment(1)
The topic Get Kindle Library Book List has useful information for people who want to download lists of their own books, including code snippets or links. I posted working C# code just a few minutes ago.Manchineel
W
6

Yes there is. Due to the bloated and extremely slow management web page for the kindle I invested 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.

Weig answered 16/6, 2013 at 0:50 Comment(2)
There is a new, better API used internally, which supports batch deletes. Might want to have a look at that: github.com/fatso83/amazon_fiona_js/blob/master/TODO.md#new-apiWeig
Also recommend trying to this: gist.github.com/jkubecki/d61d3e953ed5c8379075b5ddd8a95f22Weig
I
3

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.

Inferential answered 15/10, 2012 at 22:40 Comment(2)
If Amazon use OAuth2, it can let the user decide whether to authorize a third-party program access his private information or not. There are some useful use cases: I develop a program for myself so I do want to authorize the program to access my information. And if a program promise that it won't share my information to any body else and it is very useful, I may authorize it to my privacy too...etc. I don't know why Amazon don't do this.Horticulture
Third parties? No. Myself? Yes, of course! In particular, I would very much like to "archive" the titles I have already read - now that I have 287 books in my Kindle collection, it's little short of unusable without this feature. If I could simply subdivide my set of books into "read", "unread" and "currently reading", it would give a much, much better user experience ... so far, it looks like my best way to achieve that is either by poking around inside the web reader's innards, or by downloading all 287 of them to my Mac and parsing the .apnx files. Of course I'd prefer a proper API!Revamp
R
1

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...)

Roborant answered 5/6, 2014 at 2:6 Comment(1)
The file now seems to contain a purchase_date also!Zakarias

© 2022 - 2024 — McMap. All rights reserved.