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.

2 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!