How to extract Kindle vocabulary cards

Every time you look up a word on Kindle, it stores it into its vocabulary database.

Kindle is using an SQLite database internally, and when you plug the device into your computer, you can extract all the words that you have looked up, together with the book titles and complete sentences (!) where these words were encountered. Here's the SQL request:

SELECT
    words.stem, lookups.usage
    FROM lookups
    LEFT OUTER JOIN book_info
    ON lookups.book_key=book_info.id
    LEFT OUTER JOIN words
    ON lookups.word_key=words.id;

You can run the query like this (on OS X):

cat extract.sql | sqlite3 /Volumes/Kindle/system/vocabulary/vocab.db -separator $'\t' > lookups.txt

After that you can copy & paste the words into Google Translate and get translations for each word. The resulting CSV can be easily imported into popular spaced repetition apps, such as Anki or Memrise.

Note: in Memrise, when you create a course, there's an option to load the words in batch as CSV.

Here's the full code on GitHub.

Fork me on GitHub