Last active
March 31, 2026 19:45
-
-
Save raxityo/c82abe49b77d5feaeb5cf6b69f0e0d9d to your computer and use it in GitHub Desktop.
Clip all available BJ's coupons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name BJ's Coupon Clipper | |
| // @namespace Violentmonkey Scripts | |
| // @match https://www.bjs.com/ | |
| // @grant none | |
| // @version 1.0 | |
| // @author @raxityo | |
| // @description 3/24/2024, 11:01:30 PM | |
| // ==/UserScript== | |
| /** | |
| * Clip all available BJ's coupons | |
| * - Login to BJ's website | |
| * - Open dev console and paste this function | |
| * - Run it! Example `await clipAllOffers()` | |
| * @return {Promise<T>} | |
| */ | |
| (async function clipAllOffers() { | |
| const membershipNumber = localStorage.getItem("x_MembershipNumber"); | |
| const zipcode = JSON.parse( | |
| localStorage.getItem("clubDetailsForClubId") | |
| ).postalCode; | |
| await fetch( | |
| "https://api.bjs.com/digital/live/api/v1.0/member/available/offers", | |
| { | |
| method: "post", | |
| credentials: "include", | |
| body: JSON.stringify({ | |
| membershipNumber, | |
| zipcode, | |
| category: "", | |
| isPrev: false, | |
| isNext: true, | |
| pagesize: 500, | |
| searchString: "", | |
| indexForPagination: 0, | |
| brand: "" | |
| }) | |
| } | |
| ) | |
| .then((r) => r.json()) | |
| .then(([{ availableOffers }]) => { | |
| // Intentionally doing sequential requests to avoid hammering the backend | |
| availableOffers.forEach(async ({ offerId, storeId }) => { | |
| await fetch( | |
| `https://api.bjs.com/digital/live/api/v1.0/store/${storeId}/coupons/activate?zip=07302&offerId=${offerId}`, | |
| { | |
| credentials: "include" | |
| } | |
| ); | |
| }); | |
| }); | |
| })().then(); |
@trevorknight you can go ahead and try this one: https://greasyfork.org/en/scripts/528560-bj-s-coupon-clipper-with-live-count-fast-batching/code
Made an update to include BATCH_SIZE and BATCH_DELAY. Feel free to modify as needed. It worked for me a couple days ago. Let me know if this doesn't work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think they changed their API or introduced throttling or something recently.
I used to just run something like this on their coupons page: