Weekend Nerd Challenge: Importing Kindle reading times into Apple Health using Shortcuts
- Robbie
- Mar 20
- 9 min read
Updated: Mar 21
I’ve been working on mindfulness lately, and one way I’ve been doing that is by reading more. I've found that I've been using my Kindle more and more, and it got me thinking - since Amazon collects so much data on its users, I wondered if I could access my reading stats. If so, I thought it might be possible to import them into Apple Health as mindful minutes and incorporate them into my weekly health check routine.
Good news: the data is available! It takes a bit of effort to get it, though. Here’s how I did it, step by step, with some working (beta) code that you're welcome to use. [It's for moderately advanced Apple iPhone users]
How to Request Your Kindle Data from Amazon
Amazon makes this process desktop-only, so for the Amazon data extract, you’ll need a full browser on a computer. Here’s what to do:
Open Amazon.co.uk on a desktop computer (for US users, use Amazon.com). Mobile browsers and the app won’t work.
Click “My Account.”
Scroll to the “Manage Your Data” section (or “Privacy Hub” for US users) and select “Request your data.”
From the data category dropdown, choose “Kindle,” then click “Submit request.”
You’ll receive an email confirming your request. Open it and click “Confirm Data Request.”
Wait for the data to arrive. I submitted my request at 8 a.m. on a Monday, and the email with my data came at 3:15 a.m. on Wednesday, about 43 hours later.
In the email, click “Download data” to get a ZIP file.
Inside the ZIP, look for the “Kindle.Devices.ReadingSession” folder and the file Kindle.Devices.ReadingSession.csv. That’s the one you need.
The CSV file isn’t the easiest to read at first glance, with timestamps, milliseconds, and cryptic codes like ASIN (Amazon Standard Identifier Number - like the ISBN / reference number for your book).
After digging through it, I found it contains exactly what I need: reading session start and end times. (Although at first, I thought there was an error with the dataset, and also misread the specification for Apple Health data... and ended up trying to calculate time differences in milliseconds... aaaaah)
If you want to do this process regularly (I'll probably do it monthly), then just request the data file in the same way, and load the entire data file into the Shortcut; it's got logic that stops duplicates.
Checking Apple Health First
Before importing or anything, it’s a good idea to check your current Apple Health data. Here’s how:
Open Apple Health on your iPhone.
Go to Browse > Mental Wellbeing > Mindful Minutes > Data Sources & Access > Shortcuts.
If there’s no data listed in there from Shortcuts, you’re starting fresh. You can reset to a clean slate later if needed by selecting “Edit” and “Delete All.” Be very careful here: double-check you’re in Mindful Minutes, and that you're in the "Shortcuts" data set, as this action can’t be undone.
If Shortcuts data already exists inside the Mindful Minutes health section, note that resetting will remove it too, so proceed carefully.
Setting Up the Shortcut
I created a Shortcut to process the CSV and log reading sessions as mindful minutes in Apple Health, skipping duplicates and handling data quirks.
There's a standard safety warning here... you shouldn't really just download stuff you've found on the internet and run it.
You can use my ready-made version here, and of course you can trust me - the shortcut doesn't take your personal data, or anything like that, but feel free to look through the code to reassure yourself of that fact!:
Add Reading Times to Apple Health -You need to access this on your iPhone so that it triggers the Shortcuts app. The link is also here: https://www.icloud.com/shortcuts/e0fc240b207a4d158b72a657a4dcf25f.
Or you could build the workflow yourself from the screenshots I've shared below. Either way, you need to cross check some configuration during install:
Open the Shortcut in the Shortcuts app by clicking on three dots (...) on the main Shortcuts screen (taking care not to just tap the shortcut; it'll crash out with a "you must attach a file" error), once inside the shortcut, tap the info (i) icon at the bottom of the screen, and make sure “Show in Share Sheet” is enabled.
Ensure Shortcuts has read and write access to Mindful Minutes in Settings > Health > Apps > Shortcuts. You can also just send the CSV into the Shortcut twice - the first time it'll throw an error saying it doesn't have read access to Health (Mindful Minutes), and once you've given that permission, on the second run, it'll complain that it doesnt have write-access, and again you can just provide that permission. Read permission, by the way, is limited to that health category, and its used just before the "Write" task to check for an existing record before creating one - to avoid duplicates, so you can just keep reloading the updated file forever without having to keep clearing the base data.
Whatever the file source (lets say you're using Files, and the Share tab), you'll need to give the Shortcut authorisation to read from that location. Sadly, you can't just use "Allow Once", because Shortcuts inexplicably wants approval each time the file is handled not just each time its opened. Either that, or Apple's "Get Text From File" action is repeatedly opening the file rather than loading it to memory... either way, you need to "Allow Forever" or get comfortable clicking the "Allow Once" a few hundred times.
To run it:
Locate Kindle.Devices.ReadingSession.csv in the Files app*
Tap (or Long-press), and select "Share", scroll down to select “Add Reading Times to Apple Health” from the actions list, and wait. It takes a moment to process.
*If you saved the file in OneDrive, there's an extra step... Tap Share, then click "send a copy", and then do the Add Reading Times process.
[Ed
When it finishes, you’ll see a notification showing how many records were added and how many were skipped, either as duplicates or due to formatting issues (like “not available” instead of a timestamp).
Here's how a successful import looks:

If it fails with a “data quality” error, check the latest entry in Apple Health under Mindful Minutes > Data Sources & Access > Shortcuts. Then, open the CSV, find that timestamp, and look at the next row. That’s likely where the problem is.
Once the data is imported, you should be able to see your reading times inside that Data Sources & Access area of Apple Health (Mindful Minutes category):

The Workflow Explained
Here’s the full workflow I settled on after some trial and error:
Enable “Show in Share Sheet” in settings, with Accepted Types set to Files.
Set “TotalAdded” to 0 using “Number” and “Set Variable.”
Set “TotalSkipped” to 0 using “Number” and “Set Variable.”
Use “Get Text from Input” with “Shortcut Input” to read the CSV.
Split the text by newline (\n) with “Split Text.”
Skip the header row with “Get Item from List,” Index: 2 to Last.
Loop through each row with “Repeat with Each” on “Items.”
Split each row by comma (,) with “Split Text.”
Get Index 1 (start timestamp) and set it as “RawStartTime.”
Get Index 2 (end timestamp) and set it as “RawEndTime.”
If “RawStartTime” is not “not available”:
If “RawEndTime” is not “not available”:
Format “RawStartTime” as ISO 8601 and set it as “StartTime.”
Format “RawEndTime” as ISO 8601 and set it as “EndTime.”
Check for duplicates with “Find Health Samples” (Mindful Minutes, Start: “StartTime,” End: “StartTime,” Limit: 1).
If no existing entry is found:
Log the session with “Log Health Sample” (Mindful Minutes, Start: “StartTime,” End: “EndTime”).
Increment “TotalAdded” by 1.
Otherwise (duplicate found):
Increment “TotalSkipped” by 1.
Otherwise (invalid end time):
Increment “TotalSkipped” by 1.
Otherwise (invalid start time):
Increment “TotalSkipped” by 1.
Show a notification: “Mindful Minutes Import Complete - Added: [TotalAdded], Skipped: [TotalSkipped].”
How It Works
Simply: It takes the input CSV from Amazon, takes the start / end time columns and preps for import
Tracking: “TotalAdded” counts new sessions logged to Health. “TotalSkipped” tallies both duplicates and rows with “not available” timestamps.
Error Handling: The “If” checks filter out bad data before formatting, keeping the shortcut running smoothly.
Deduplication: It only adds sessions not already in Health, using the start time as a unique marker.
Reflections and Wishlist
The Shortcut did what I wanted it to do - it pulled my data into Apple Health, and allowed me to see the trend by day / week / month. Although I tend to read a reasonable amount, it's not always on Kindle (though I do increasingly prefer it to physical books, if only because I can pick up those "un put downable" books wherever I am, on Kindle or iPhone app) - and the data will only be complete if I lean more into Kindle books... which I'm ok with.
My "standard" reading session tends to be 45-60 minutes long, though I can see periods where I really like a book, because I can do 2-3 hours per day, on consecutive days. My longest reading session was in fact 7 hours long, and started at 23:30 in an evening... I was sure it was an error until I searched the ASIN, and that evening came back to me, a book I thoroughly enjoyed, and had totally forgotten.
My average reading time taken over 6 weeks is a lot lower than I thought it would be, because whilst I can read a lot, if I'm disengaged from a single book, I tend to disengage from the Kindle for a while: I hadn't realised that about myself, and maybe if I develop the idea further, I'll put a "you haven't done any reading for a while" reminder in... I have a morning Shortcut that runs anyway to do stuff like changing my Watch out of cinema mode (if I'd put it on its charger in that mode), so I might chuck something in there like "select the latest 1 Health Sample from Mindful Minutes from the last month; if that sample >3 days ago, show a friendly alert".... at one point last year, I was averaging just 20 minutes reading per day 😮
Of course, to develop this further, I'd probably be writing an app, and getting the Health permissions up front, and I'd probably use it to broker a few of these different types of dataset... I noticed that Withings syncs a lot of data from their app to Apple Health, and in the data export I found "sleeping respiratory rate" taken from a Withings Sleep Mat - a great indicator of overall health - which isn't synced to Health (however, heart rate, and sleep apnea indicators are sync'd?!).
Or I could avoid needing to develop it further by simply persuading Amazon to add "sync my reading data to Apple Health" in the iPhone Kindle app... which might be overstating my influence on Amazon somewhat!
To the Shortcut itself - the error handling is simple but effective. Building this on my iPhone was slow going - the Shortcuts editor lags with nested “If” statements, and rearranging actions is clunky. If I’d built it on a mac, I might have added a debug option and kept some alerts for testing, but without a console, I stripped those out.
(Also, I'm like a toddler when I use a mac, I wish I was cool enough for them, but I just can't get my head around how they work - a lifetime of learning things like Win+R -> Notepad -> [Enter], and of using cmd/powershell to do little bits of automation here and there, made the learning curve too steep... whilst I did buy a Macbook Air when it came out, I ended up selling it and buying a Windows laptop instead)
I also haven't done anything like enough work on the input file validation - if you load the wrong file, then you could end up with loads of junk in the Mindful Minutes health entry, which you'd need to delete all. I probably should've added a filename filter at least, rather than just accepting any file - these would be trivial changes, and maybe I'll make those to the Shortcut when I get some time.
I’d love for Apple to add a console to Shortcuts, plus for other projects, things like global variables at a “Home” or “Personal” level - maybe by creating dummy devices for state tracking (without having to use something like Homebridge to fudge it). Being able to view and edit the raw code would be a game-changer too. I can only hope, eh.
Final Thoughts
It’s not flawless, but it gets the job done, especially as a proof of concept. My Kindle reading now shows up as mindful minutes in Apple Health, and I can track trends over time. I’m still curious why some sessions come back as “not available” - I guess its somewhere that my Kindle ran out of battery or something.
For now, I’m happy to have my reading habit reflected in my mindfulness stats. Try it out, and let me know how it works for you!
Annex: The Visual Representation for those who want to manually build it
Here's what the algorithm looks like inside Apple Shortcuts:









Comentarios