Apple Books Highlights to Anki
Mac · Client-side · No upload
Apple Books lets you share one highlight at a time. Your full collection sits in two database folders on your Mac. Drop their files here, pick the books, and download every highlight and note as a flashcard deck or a Markdown file of quotes.
- Quit Books. In the file picker below, press Cmd+Shift+G.
- Paste
~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation, then select every file in the folder. - For book titles, add the files from
~/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrarytoo. Drop or pick them all at once.
Drop the Apple Books database files here
AEAnnotation and BKLibrary folders at once. Read in your browser — never uploaded.Highlights worth seeing again
Everything at once. Apple's own export is a share sheet per book or per passage. This takes every book in the database in one pass, in reading order, with the chapter each passage came from.
Cards built for recall. The passage is the question; the book, chapter and your note are the answer. The Markdown file is one heading per book with each passage as a quote, ready for Obsidian or Notion, or as the start of a commonplace book.
Or skip the export next time. GemReader on iPhone and iPad opens your DRM-free EPUBs and PDFs, and every highlight you make there is already a flashcard, scheduled for review. How highlights become cards on iPhone.
Questions
Where are the Apple Books database files?
On a Mac, in two folders: ~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation holds the highlights and notes, and ~/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrary holds the titles and authors. In the file picker, press Cmd+Shift+G, paste the first path, select every file in the folder, and repeat for the second. Or copy both folders to the desktop first and drop all the files in at once.
Why are there several files per folder?
Apple Books keeps each database as a .sqlite file plus a -wal file that holds the most recent changes, which can be most of them. Without the -wal file, new highlights are missing, so select everything in each folder. Quitting Books before copying makes sure everything has been written.
My highlights are on my iPhone. Can I export them?
Not from the phone directly: iOS doesn't let any app or website read the Books database. Turn on iCloud for Books on the iPhone and on a Mac signed in to the same Apple Account, open Books on the Mac so the highlights sync down, then export them from the Mac.
Why does a book show as Unknown?
Titles come from the BKLibrary database. If it wasn't included, or the book has since been removed from your library, the highlights are still exported, grouped under the book's store ID.
How do I import the deck into Anki?
In Anki desktop, choose File → Import and pick the downloaded .txt. The passage goes on the front, the book, chapter and your note on the back, and each card is tagged applebooks::Book_Title, so a book can be studied as its own deck.
Are the files uploaded?
No. They are read with JavaScript in your browser tab by a small built-in SQLite reader, and the deck is built there too. Nothing leaves your Mac, and the database files are never modified.