# Accessing / Exporting Apple's Reminders Data on macOS Some notes on accessing / exporting Apple's Reminders data on macOS. ## Table of Contents - [Unsorted](#unsorted) - [See Also](#see-also) ## Unsorted > > > After some investigation it seems that Tags themselves aren't exposed in the API for the EKReminders class > > > > When you say 'tags', what specifically are you referring to? Do you mean the specific 'hashtags' tags assigned to a reminder? Or are you referring to something else? > > > > --- > > > > The rules for smart lists can have many different aspects, not just tags, so even if they aren't currently accessible, the others may be: > > > > _Originally posted by @0xdevalias in https://github.com/keith/reminders-cli/issues/72#issuecomment-1829203825_ > > --- > > > It looks like the underlying sqlite database backing the Reminders app is stored at: > > > > - `/Users/devalias/Library/Reminders/Container_v1/Stores/Data-SOME-UUID-TYPE-THING.sqlite` > > > > Within that I can see the tags information in the `ZREMCDHASHTAGLABEL` table. > > > > The `ZREMCDOBJECT` table seems to contain a lot of data, possibly related to the reminders themselves? The `ZNAME1` column seems to include some of the tags as well. > > > > The `ZREMCDREMINDER` table seems to have a lot of the actual reminder data, and seemingly foreign keys to link to some of the other tables. > > > > While I wouldn't personally risk writing to this DB for fear of corrupting it or similar; it might be possible to extract some relevant details from it in a 'read only' mode, that could then be used to filter the reminders returned from the official API's 'in app'. > > > > _Originally posted by @0xdevalias in https://github.com/keith/reminders-cli/issues/72#issuecomment-1829214924_ > > --- > > In `/Users/devalias/Library/Reminders/Container_v1/Stores/Data-SOME-UUID-TYPE-THING.sqlite`: > > - In the `ZREMCDHASHTAGLABEL` table: > - `Z_ENT`: seems to be `3` for all of the hashtag entries > - `ZNAME` / `ZCANONICALNAME`: seem to contain the text of my hashtags > - In the `ZREMCDREMINDER` table: > - `Z_PK`: ?reminder primary key? > - `Z_ENT`: seems to be `32` for all of the reminder entries > - `ZCOMPLETED`: `1` for completed, `0` for not completed > - `ZFLAGGED`: ?probably `1` if flagged, otherwise `0`? > - `ZPRIORITY`: ?reminder priority? > - `ZLIST`: ?ID of list the reminder relates to? > - `ZTITLE`: Main reminder text > - `ZNOTES`: Reminder notes > - etc > - In the `ZREMCDOBJECT` table, columns such as the following look potentially useful: > - `ZCKIDENTIFIER`: ?some sort of UUID? > - `ZREMINDERIDENTIFIER`: ?some sort of UUID? > - `ZREMINDER3`: ?might contain the ID of the reminder the row relates to? > - `ZHASHTAGLABEL`: seems to contain the PK of the hashtag from `ZREMCDHASHTAGLABEL` > - `ZDATECOMPONENTSDATA`: ?stuff related to the reminder date? > - `Z_ENT`: > - `30`: seems to correlate to the smart lists > - `Z_FOK_PARENTLIST1`: ?Foreign key for the associated parent list? > - `ZBADGEEMBLEM1`: Contains data like: `{"Emoji" : "🎥"}` that I assigned to the smartlists > - `ZNAME3`: This seems to contain the name I assigned to the smartlists > - `ZSMARTLISTTYPE`: seems to contain things like: > - `com.apple.reminders.smartlist.today` > - `com.apple.reminders.smartlist.assigned` > - `com.apple.reminders.smartlist.custom` > - `com.apple.reminders.smartlist.flagged` > - `ZSORTINGSTYLE1`: eg. `manual` > - `ZFILTEREDDATA`: json data relating to the smartlist config; eg: > - `{"hashtags":{"hashtags":["health"]}}` > - `{"date":{"relativeRange":["inNext","1","week"]}}` > - `{"hashtags":{"hashtags":{"include":["to-watch","youtube-aaa","youtube-bbb","youtube-ccc","youtube-ddd"],"exclude":[],"operation":"or"}},"date":{"any":""},"operation":"and"}` > - `26`: ??? > - `ZLISTID`: seems to contain things like: > - `com.apple.reminders.smartlist.today` > - Or sometimes a UUID (eg. in my data: `BA189B19-F050-43FD-A76F-115415ED91A2` / `5C703F5C-7ED3-4AC3-B064-7F9C1E01AA95`) > - `25`: seems to correlate to normal lists > - `ZBADGEEMBLEM` seems to be the image I assigned to the normal lists (eg. `{"Emoji" : "💲"}`) > - `ZNAME2` seems to be the name of the normal list > - `ZSORTINGSTYLE`: eg. `manual` > - `24`: seems to (at least partially?) correlate to hashtags for reminders > - `ZNAME1`: seems to contain the text of a hashtag for the reminder > - `22`: ??? > - `21`: ??? > - `18`: ?URL related? > - Looks like `ZUTI` (eg. `public.url`), `ZURL`, etc; may be related to this.. > - `ZURL`: reminder URL field > - `17`: ?attachment related? > - Looks like `ZUTI` (eg. `public.jpeg`), `ZFILENAME` (eg. `24B9CB35-CC7F-45F0-B52F-8BED9C2F2769-732-00055908B19E5135.jpeg`), `ZSHA512SUM`, etc; may be related to this.. > - `10`: ?location related? > - Looks like `ZLATITUDE` / `ZLONGITUDE` / `ZADDRESS` / `ZLOCATIONUID` / `ZTITLE` etc are related to this > - `9`: ?reminder date/time related? > - Looks like `ZALARM` / `ZDATECOMPONENTSDATA` / etc may be related to this > - `7`: ??? > - Looks like `ZREMINDER` / `ZTRIGGER` / `Z8TRIGGER` / etc may be related to this > - `6`: ?settings/flags related? > - I only seem to have a single entry for this type, and it seems to correlate with fields like `ZDAALLOWSCALENDARADDDELETEMODIFY` / `ZDASUPPORTSSHAREDCALENDARS` / etc (seemingly at least 10 fields like this seem to correlate with it), as well as `ZCKUSERRECORDNAME`, `ZNAME` (`iCloud`), `ZPERSONID` (`PRIMARY-CLOUDKIT`) > > That seems to be enough basic info to figure out resolving both this issue, and maybe also #72 > > Would just need to figure out how to match up the ID/data that the API is currently able to provide, with an ID that can be looked up in the sqlite database; and then extract the associated hashtags/etc. > > I was thinking that maybe `externalId` from `reminders show Reminders --sort creation-date --sort-order ascending --format json` might have worked.. but it only seems to show up in `ZREMCDOBJECT` within some fields with LOTS of other IDs in them, so doesn't seem ideal; though `ZREMCDREMINDER` seems to have a single row match with the ID being in `ZCKIDENTIFIER` / `ZDACALENDARITEMUNIQUEIDENTIFIER`, so maybe we can do it that way in like 2 steps.. > > _Originally posted by @0xdevalias in https://github.com/keith/reminders-cli/issues/74#issuecomment-2029147628_ ## See Also - [Accessing / Exporting Apple's Screen Time Data (0xdevalias' gist)](https://gist.github.com/0xdevalias/38cfc92278f85ae89a46f0c156208fd5#accessing--exporting-apples-screen-time-data) - [Accessing Apple's iCloud Synced Passwords Keychain (0xdevalias' gist)](https://gist.github.com/0xdevalias/2da38a9d57f3125a7214b4bf1cbc185e#accessing-apples-icloud-synced-passwords-keychain) - [Decompile Apple Shortcuts into raw XML 'source code' (0xdevalias' gist)](https://gist.github.com/0xdevalias/27d9aea9529be7b6ce59055332a94477#decompile-apple-shortcuts-into-raw-xml-source-code) - [AppleScript Automation Snippets (0xdevalias' gist)](https://gist.github.com/0xdevalias/db8b0c8b626ccb9a775b806be673eb55#applescript-automation-snippets) - [Reverse Engineering on macOS (0xdevalias' gist)](https://gist.github.com/0xdevalias/256a8018473839695e8684e37da92c25#reverse-engineering-on-macos)