{"id":14965718,"url":"https://github.com/samc621/sneakerbot","last_synced_at":"2025-05-15T02:05:16.282Z","repository":{"id":37486375,"uuid":"142079015","full_name":"samc621/SneakerBot","owner":"samc621","description":"All-in-one bot, with auto captcha-solving and proxy management, using Node.js and Puppeteer.","archived":false,"fork":false,"pushed_at":"2025-03-29T04:40:54.000Z","size":3645,"stargazers_count":767,"open_issues_count":16,"forks_count":195,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-03-30T19:02:13.227Z","etag":null,"topics":["2captcha","bot","docker","docker-compose","nodejs","puppeteer","sneakerbot","vnc","vncviewer","x11vnc","xvfb"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samc621.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-23T23:14:39.000Z","updated_at":"2025-03-25T12:04:09.000Z","dependencies_parsed_at":"2024-01-13T19:12:40.740Z","dependency_job_id":"b4bd21b3-a3d4-4b2b-a5a3-a1f4eafd67a9","html_url":"https://github.com/samc621/SneakerBot","commit_stats":{"total_commits":224,"total_committers":12,"mean_commits":"18.666666666666668","dds":0.4866071428571429,"last_synced_commit":"ed4e13ba4fb7887844f6480a3cb54ca11d585758"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samc621%2FSneakerBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samc621%2FSneakerBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samc621%2FSneakerBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samc621%2FSneakerBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samc621","download_url":"https://codeload.github.com/samc621/SneakerBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543585,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2captcha","bot","docker","docker-compose","nodejs","puppeteer","sneakerbot","vnc","vncviewer","x11vnc","xvfb"],"created_at":"2024-09-24T13:35:09.918Z","updated_at":"2025-04-06T20:04:04.194Z","avatar_url":"https://github.com/samc621.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/samc621"],"categories":[],"sub_categories":[],"readme":"# SneakerBot\n\n[![build, lint, test, deploy](https://github.com/samc621/SneakerBot/actions/workflows/build_lint_deploy.yml/badge.svg)](https://github.com/samc621/SneakerBot/actions/workflows/build_lint_deploy.yml)\n\nThis bot uses Node.js and Puppeteer to automate the checkout on various sneaker websites. It currently works on:\n\n1. Footsites (footlocker.com, footaction.com, eastbay.com, champssports.com)\n2. Shopify sites (e.g. BdgaStore, Concepts, Kith, etc.)\n3. Demandware sites (e.g. Adidas)\n4. Nike.com\n5. Supreme\n\n## About this project\n\nThis bot was made by developers, for developers. It is not a commercial product, it is a free and open source software. Thus, it may not be suitable for those with little or no software engineering experience.\n\nThe developers of this software should not be held liable for any lost opportunities resulting from its usage.\n\n## Prerequisites\n\nInstall the following on your machine:\n\n1. [Node.js](https://nodejs.org/en/download/) (comes with npm)\n2. [PostgreSQL](https://www.postgresql.org/download/)\n\n## Set up PostgreSQL\n\nView the [documentation](https://www.postgresql.org/docs/9.0/sql-createdatabase.html) for creating a user and database.\n\n## Configure environment variables\n\nMake a copy of the `.env.example` file, replacing `example` with the name of your `NODE_ENV` e.g. `.env.local` or `.env.development`.\n\nWhen you're ready, declare the environment name with:\n\n### Linux/Mac\n\n`$ export NODE_ENV=local`\n\n### Windows\n\n#### Cmd\n\n`$ set NODE_ENV=local`\n\n#### PowerShell\n\n`$env:NODE_ENV=\"local\"`\n\n### How to populate the .env file\n\n1. `PORT` is the port that the Node/Express API server will run on, _defaults to 8080_. You can use any TCP/UDP port (0-65535) that is unused by another service e.g. Postgres on 5432.\n2. `DB_USERNAME` and `DB_PASSWORD` is the username/password combo for the Postgres user you created (see documentation above for assistance).\n3. `DB_NAME` is the name of the Postgres database you created.\n4. `DB_PORT` and `DB_HOST` are the Postgres defaults, `5432` and `localhost`, respectively.\n5. `EMAIL_HOST` and `EMAIL_PORT` are the SMTP details for your email provider e.g. `smtp.gmail.com` and `587`, respectively, for Gmail.\n6. `EMAIL_USERNAME` and `EMAIL_PASSWORD` are your actual email credentials. We use the SMTP server to send email notifications about things like checkout errors or completions.\n7. `CARD_NUMBER`, `NAME_ON_CARD`, `EXPIRATION_MONTH`, `EXPIRATION_YEAR`, and `SECURITY_CODE` are your actual credit/debit card details.\n8. `API_KEY_2CAPTCHA` is your API key provided by `2Captcha` if you so desire to use their service. This can be left blank if not.\n\n## Optional: Configure credit cards\n\nThe `.env` file that you configure is set up for a single credit card.\n\nHowever, if you want to specify multiple credit cards, populate `credit-cards.js` using the example from `credit-cards-example.js`.\n\nIf you prefer not to use this method, you can simply leave this JS file as-is.\n\nWhen starting a task, you can optionally specify the card you want to use via its `friendlyName`, otherwise the card from the `.env` file will be used.\n\n## Install the dependencies\n\n`$ npm install`\n\n## Run the DB migrations\n\n\u003e You may need to include `npx` at the start of the commands\n\n`$ knex migrate:latest`\n\n## Run the DB seeders\n\n`$ knex seed:run`\n\n## Start the server\n\nTasks run parallelly using [puppeteer-cluster](https://github.com/thomasdondorf/puppeteer-cluster).\n\nBefore starting up the server, define the number of concurrent tasks you plan to run:\n\n`$ export PARALLEL_TASKS=5`\n\nIf you do not define this variable, it will default to `1`.\n\nYou can of course run more tasks, but they will be queued to run in a first-in, first-out (FIFO) manner.\n\nKeep in mind that tasks that do not result in `checkoutComplete` will remain idle (not terminate) so that you can open the browser and view the error(s).\n\nIf a task encounters a captcha that must be manually solved, it will also remain idle and await completion.\n\nEach task uses its own browser, so it's also important to keep in mind the CPU constraints of your machine.\n\nWhen you're ready, start the server with:\n\n`$ npm start`\n\n## Optional: Using Docker / Docker Compose\n\nThis may be particularly useful for Linux users who have reported issues with Puppeteer and Chromium.\n\nYou will need to have [Docker Compose](https://docs.docker.com/compose/install/) and/or [Docker](https://docs.docker.com/get-docker/) installed to use this.\n\nYou will also need to make a copy of the `.env.example` file, replacing `example` with the name of your `NODE_ENV` e.g. `docker`.\n\nA Docker image is available for the server code [here](https://hub.docker.com/repository/docker/samc621/sneakerbot). You can also build it yourself by running the following in the root directory:\n\n`$ docker build -t sneakerbot .`\n\nThen run it and specify the env file with:\n\n`docker run -p 5900:5900 -p 8000:8000 --env NODE_ENV=docker --env-file .env.docker sneakerbot` (replace `8000` with whatever `PORT` you specified in `.env.docker`)\n\nThis Docker image is built from `node:12` and uses [xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml) with [x11vnc](https://github.com/LibVNC/x11vnc) to provide access to a GUI.\n\nYou can use [vncviewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to the VNC server running in the container.\n\nYou may also opt to run Postgres via Docker, in which case you can make use of the `docker-compose.yml` file. Simply run the following in the root directory:\n\n`$ docker-compose build`\n\n`$ docker-compose up`\n\n## API\n\nThis bot exposes a Node/Express API server for managing addresses, proxies, and tasks. I would eventually like to see a UI, which integrates these APIs, built.\n\nFor each API, view the docs and try the requests in Postman.\n\n- [Addresses](https://documenter.getpostman.com/view/5027621/TVt2c3ef) - this is how you can pre-store billing and shipping addresses applied to tasks, and more specifically used at checkout time.\n- [Proxies](https://documenter.getpostman.com/view/5027621/TVt2c3ee) - this is how you can pre-store proxies that the bot will use when launching a task. Proxies are rotated so that they are never reused. In the future, this bot may include an integration with a proxy service like [Bright Data (formerly Luminati)](https://brightdata.com/).\n- [Tasks](https://documenter.getpostman.com/view/5027621/TVt2c3ed) - this is how you can pre-store, and then start checkout tasks.\n\n### UPDATE (as of 05/30/2021)\n\nYou can now specify a `product_code` on tasks. You will still need to provide the `url` e.g. https://nike.com but can also provide a `product_code` e.g. \"DA3130-100\".\n\nIf a `product_code` is specified, the bot will iteratively search the desired site until there is a search result, click it, and then proceed as usual.\n\nThis will work with the `nike.com`, `footsites`, and `demandware` sites.\n\nIf using with adidas.com, be sure to include the full site path e.g. https://www.adidas.com/us.\n\nFeel free to check the new [example](https://documenter.getpostman.com/view/5027621/TVt2c3ed#d55d7ad1-7126-4663-9fa1-fdc2220615d4) \"with product code\" under the POST /tasks API.\n\n### UPDATE (as of 06/24/2021)\n\nYou can now specify a `WEBHOOK_ENDPOINT` in your `.env` file for receiving webhook events (over HTTP/HTTPS) about task status.\n\nWhen a task is done processing, a `POST` request will be sent to the supplied URL with the following data:\n\n```\n{\n    taskId: integer,\n    checkoutComplete: true/false,\n    message: Some text about the task status, the same message is sent via email\n}\n```\n\n## Starting a Task\n\nYou may start a task via `POST /v1/tasks/:id/start` or use the `start-task.js` script like:\n\n`$ TASK_ID=\u003cTASK_ID\u003e CARD_FRIENDLY_NAME=\u003cCARD_FRIENDLY_NAME\u003e node ./scripts/start-task.js`\n\n## Stopping a Task\n\nYou may stop a task that has run too long via `POST /v1/tasks/:id/stop`\n\n## Captcha Solving\n\nThis bot enables manual and automatic (via [2Captcha](https://2captcha.com)) solving of captchas.\n\nWhen creating a task, you can specify `auto_solve_captcha` (Boolean), however, this parameter is optional and defaults to `true`.\n\nYou must sign up for and fund a 2Captcha account, and then add your `API_KEY_2CAPTCHA` to the .env file in order to auto-solve captchas.\n\nFor manually-solving captchas, you will be given a 5-minute timeout after the email notification to check the browser and solve the captcha.\n\n## Motivation\n\nAs a teenager, I operated sneakerbots.us, where I sold sneakerbots like this in addition to early links and ATC services.\n\nFastforward several years, I decided to upgrade this all-in-one bot from Java + Selenium to Node.js + Puppeteer, which I enjoy more for bot projects.\n\nI am open sourcing this repo now, since I no longer operate the business, but also because I am of the opinion that this software can rival many of its commercial competitors.\n\nFeel free to open a Pull Request to contribute to this project and help make it better! I will continue to support more websites and add more features as I can.\n\nAlso feel free to open an Issue or contact me via Telegram @samc621 if you have any trouble.\n\nIf you appreciate this, consider [buying me a coffee](https://www.buymeacoffee.com/samc621).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamc621%2Fsneakerbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamc621%2Fsneakerbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamc621%2Fsneakerbot/lists"}