Alexa Reminders To Reminders.app Access

With the removal of Alexa integration with IFTTT, it had myself along with many others wondering what to do to keep Alexa’s reminders synced with the iOS shared reminders list (which we use constantly for grocery / shopping).

I did some playing around with the Alexa documentation and ended up finding out I could access the Alexa list via their API using a login credential in Scriptable’s web view / request APIs.

The code can be found on my GitHub page here along with some additional instructions on setup.

3 Likes

Hello @mvan231!
First of all, thank you very much for your dedication on this subject. My wife and I used to share a Shopping list at iOS Reminders, but when I tried to migrate to Alexa’s list, my wife complained a lot. In fact, using Alexa’s shopping list through Alexa’s app while shopping is awful, while Reminders does a great job. However, even our kids and maid are able to feed the Alexa’s list with missing items through the Echo Dots in my home, so this integration is something extremely desirable.
I’m not a programmer (yet), neither I am familiar with Scriptable, GitHub, JavaScript, and other basic necessary knowledge to accomplish the setup, but I was able to copy the code and add a new Scriptable to the app.
As expected, at first use it opened the login page at Amazon. But, once logged, Scriptable returns the following error message:

Exception Occurred
Error on line 81:38: TypeError: undefined is not an object (evaluating ‘json [Object. keys(json)][“listltems”]’)

I tried many things including ChatGPT trying to find out a way to adjust the code, but GPT suggested to include some lines to the code to verify JSON structure in order to check the key‘s name returned by the API.
Instead, I just accessed https://amazon.com/alexashoppinglists/api/getlistitems and I could see “listItems” is mentioned there as is.
I just don’t know what to do. Do you have any idea on how to fix it?
Additional information:

  • My list at Reminders is called simply “Shopping” and I adjusted the code line during setup;
  • I’m from Brazil, and my Amazon account is at Amazon.com.br. I tweaked the code including .br in the URLs, but it got worse, so I deleted all .br instances. In other hand, I accessed the API’s URL through both country versions and notice no difference in the nomenclatures.

Thank you very much!!!

1 Like

Thanks for the detailed information about what you’ve tried and thanks for using the script too!

Around line 75 of the script, you should see:

let json = await r.loadJSON()
//log(json)

let itemArr = json[Object.keys(json)][“listItems”]
//log(itemArr)

Can you uncomment the two log lines and see what shows in the console log when running it?

Hi, Mark!
I confess you I didn’t expect you to answer so soon. Thank you!!!
By “uncomment” I understood to remove de double slashes for each log line. So I did it, and they became this code:

let json = await r.loadJSON()
log(json)

let itemArr = json[Object.keys(json)][“listItems”]
log(itemArr)

I directly edited the code previously added to Scriptable app.
I couldn’t find a console area in the app, but if you mean the message that pops up when running the script, unfortunately it kept exactly the same error message.
So I copied the edited code and added it to a new Scriptable, but I got the same result. I believe that it’s important to mention that for this new Scriptable, Amazon didn’t asked me to log in.
Am I missing something?

Thank you one mor time, Mark!

Amazon had killed off their third-party list APIs in July, so I had assumed this wouldn’t work anymore. Is this using the private API that the Alexa app uses? I’ll have to see if I can use this approach on my headless Mac Mini to copy over items to Reminders and Things.

1 Like

Yes this uses end points that are found by using the website

Sorry to hear you had issues still. I just uploaded a new set of code that would be worth trying

Thank you very much for that solution, it worked great for me.

There was only one error in line 105:
if (word.toLowerCase() === withVariable || word.toLowerCase() === withoutVar) {

i had to change the “withVariable” to “withVar” for it to work.

one question: did you do anything to make it run automatically. At the moment i have to run the script manually, to sinc the lists

Thanks for your finding. I have updated the code on GitHub now.

I have mine setup to run a few times a day via shortcuts automations

Thanks for the quick response and no worries.

Unfortunately there is no option to hourly repeat it via shortcuts. Will just set up a few automations, too.

1 Like

I’m using a Cron shortcut so for me, it’s pretty easy to add scheduled automations, however, I did have a lot of setup to do (24 automations; one for each hour of the day)

To anyone that reads this, I just had to make a change to the script to account for a change Amazon made. V6 of the script is on my GitHub and is working now without issue

Thank you!

1 Like

Hi Mark!

It’s been a long time since I last wrote to you. Sorry for that.

I’ve been frustrated with my lack of success in getting this automation to work. At first, I was able to authenticate my Amazon account, but for some reason, the automation didn’t fully work for me at that time.

No problem! I made some adjustments along the way, but after that, I couldn’t even authenticate on Amazon or renew my access to try again. I got really upset, but please don’t get me wrong: I was upset with myself and my own limitations.

Well… since November 2024 I’ve been taking a SysDev course, which has helped me a lot. Now, for example, I know what a terminal is! If I had known back then what I know today, I could have helped you help me much more easily.

Anyway, I’m writing just to let you know that I finally got it working, and it’s great! Thank you so much!

I believe three main factors may have contributed to making this possible:

  1. Going some time without trying to access my Amazon account through Scriptable may have caused my login session to reset.
  2. The latest script version may have introduced some improvements as well.
  3. Previously, I was able to access my Brazilian account through Amazon.com, but this time, I decided to try using the translations you suggested in the code and access the proper URL for my country. So, I researched and found the correct wordings to access Amazon.com.br in Brazilian Portuguese.

For this last point, I’d like to contribute by sharing this information with you and other users. Maybe you’d consider creating a table with contributors from different countries, including their languages and specific wordings.

Country/Language baseURL signInKeyVariable withVar withoutVar
:us: US/En www.amazon.com “Sign In” “with” “without”
:brazil: Brazil/BrPt www.amazon.com.br “Faça seu login” “com” “sem”

Now, everyone in my house is, directly or indirectly, using the automation you created. My kids, my wife, our housekeeper, and even myself have been adding items to Alexa. And when we go shopping, I simply ask Siri to “update shopping list”, and the magic happens!

Thank you so much, Mark! This automation has solved a big problem we had. :blush:

1 Like