A Node.js tool to automatically scrape and export your Kindle highlights and notes from Kindle Notebook.
Demo created using VHS
- 📚 Automatically scrapes all books in your Kindle library for book title, author, highlights and notes.
- 🔐 Handles Amazon login (with 2FA support)
- Currently requires manual 2FA
- 🍪 Saves session cookies to avoid frequent re-logins
- 📝 Exports highlights to JSON format
- 🐛 Debug mode for troubleshooting
- Node.js
- Amazon account with Kindle books
- Kindle highlights/notes to export
- Clone this repository
- Install dependencies:
npm install- Create a
.envfile with your credentials:
EMAIL[email protected]
PASSWORD=your-password
DEBUG=falseRun the script:
npm startFor debug mode (shows browser automation and additional logging):
npm run debugThe script will:
- Log into your Amazon account (may require 2FA)
- Stores session cookie which can be used to login next time
- Navigate through your Kindle library
- Extract highlights from each book
- Save results to
highlights.json
The script generates a highlights.json file containing an array of books with their highlights:
[
{
"asin": "EXAMPLEASIN1",
"title": "The Great Gatsby",
"subtitle": null,
"author": "F. Scott Fitzgerald",
"coverImage": "https://example.com/gatsby.jpg",
"dateAdded": "Monday January 1, 2024",
"highlights": [
{
"quote": "So we beat on, boats against the current, borne back ceaselessly into the past.",
"color": "Yellow",
"location": "123",
"note": ""
},
{
"quote": "He smiled understandingly—much more than understandingly. It was one of those rare smiles with a quality of eternal reassurance in it, that you may come across four or five times in life.",
"color": "Yellow",
"location": "45",
"note": ""
}
]
}
]