Skip to content

Instantly share code, notes, and snippets.

@wilmtang
Last active November 23, 2025 08:23
Show Gist options
  • Select an option

  • Save wilmtang/6fa77ae78d5898ff693bc68ed52fccc7 to your computer and use it in GitHub Desktop.

Select an option

Save wilmtang/6fa77ae78d5898ff693bc68ed52fccc7 to your computer and use it in GitHub Desktop.
Cancels all subscriptions in Amazon Subscribe and Save
// This script cancels all subscriptions in Amazon Subscribe and Save, which is fairly annoying to do manually one by one (it's def intentional)
// Inspired by reddit post https://www.reddit.com/r/amazonprime/comments/1d3agri/mass_cancel_move_all_subscribe_save_items_in_bulk
// Improved on getting subscriptionId, and fetching the urls (so it doesn't open a new tab on every unsub)
// Ussage
// 1. Visit this URL showing all subs: https://www.amazon.com/auto-deliveries/subscriptionList?listFilter=active
// 2. Press the "Show more subscriptions" button until you can see every item you're subscribed to
// 3. Open developer tool(cmd + opt + i) and paste the following into Javascript console. Then hit Enter
// 4. Profit
// Bascially the script parse the webpage to find all subscriptions and create a cancel request for each sub
let baseUrl = "https://www.amazon.com/auto-deliveries/ajax/cancelSubscriptionAction?actionType=cancelSubscription&canceledNextDeliveryDate=1749020400000&subscriptionId=";
let subscriptionIds = Array.from(document.getElementById('subscription-list-container').children).map(dv => dv.getAttribute('data-subscription-id'));
console.log(`Found ${subscriptionIds.length} subscription IDs.`);
function openNextUrl(index) {
if (index >= subscriptionIds.length) {
console.log(' All URLs have been opened. ');
return;
}
let id = subscriptionIds[index];
let url = baseUrl + id;
console.log(`Requesting URL: ${url}`);
fetch(url).catch(error => {
console.error(`Error fetching URL:${url}: `, error);
});
setTimeout(() => {
openNextUrl(index + 1);
}, 1000);
}
openNextUrl(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment