Scrapes and notifies on new Yad2 items with a minimal setup.
Struggling to find a high demand product in Yad2? No problem! The scraper will scan Yad2 and will find for you the relevant items. Once a new item has been uploaded, it will notify you with a Telegram message.
The scraper will be executed approximately once in every 15 minutes (between 08:00-21:00). The cronjob is handled by Github actions - so it is not guaranteed to be executed.
When new items are uploaded, the next Github actions run will push the items to a json file under data directory (it will be created automatically when needed) - so remember to git pull if you want to add scraping targets.
To start using the scraper simply:
- Clone / fork the repository.
- Set up a Telegram bot.
- For local development: Copy
.env.exampleto.envand add your credentials:cp .env.example .env # Edit .env with your actual API_TOKEN and CHAT_ID - For GitHub Actions: Add
API_TOKENandCHAT_IDas GitHub secrets (more secure - recommended).
For Multiple Projects:
- Automatic way: Run
npm run github-vars:update(requires GitHub CLI) - Manual way: Run
npm run github-varsto generate the JSON, then:- Go to your repository Settings → Secrets and variables → Actions
- Add this repository variable:
SCRAPER_PROJECTS - Set the value to the generated JSON array of projects:
[ { "topic": "סורנטו", "url": "https://www.yad2.co.il/vehicles/cars?manufacturer=48&model=10718&year=2023--1", "disabled": false }, { "topic": "טויוטה", "url": "https://www.yad2.co.il/vehicles/cars?manufacturer=20&model=12345&year=2023--1", "disabled": false } ]
For Single Project (Backward Compatible):
SCRAPER_TOPIC: Your topic name (e.g., "סורנטו")SCRAPER_URL: Your Yad2 search URL
GitHub CLI Setup (for automatic updates):
- Install GitHub CLI: https://cli.github.com/
- Authenticate:
gh auth login - Use:
npm run github-vars:update
Edit config.json directly:
{
"projects": [
{
"topic": "סורנטו",
"url": "https://www.yad2.co.il/vehicles/cars?manufacturer=48&model=10718&year=2023--1",
"disabled": false
}
]
}- Local:
npm run scrape - GitHub: Push and wait for the workflow to run
If you want to disable a scraping topic, you can add a "disabled": true field in the config.json under a project in the projects list:
"projects": [
{
"topic": "...",
"url": "...",
"disabled": true
}
]
A modern React-based web application for managing scraper projects via a mobile-friendly interface.
- ✅ GitHub OAuth authentication
- ✅ Add, edit, and delete projects
- ✅ Enable/disable projects with a toggle
- ✅ Mobile-responsive design (iPhone-friendly)
- ✅ Updates GitHub repository variables automatically
cd frontend
npm installCopy .env.example to .env in the frontend/ directory:
cp frontend/.env.example frontend/.envFill in the required values:
VITE_GITHUB_CLIENT_ID: Your GitHub OAuth App Client IDGITHUB_CLIENT_SECRET: Your GitHub OAuth App Client SecretGITHUB_REPO_OWNER: Your GitHub username or organizationGITHUB_REPO_NAME: Your repository name (e.g.,yad2-scraper)
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click "New OAuth App"
- Fill in:
- Application name:
Yad2 Scraper Config Manager - Homepage URL:
https://your-domain.com(your deployment URL) - Authorization callback URL:
https://your-domain.com/api/auth/callback
- Application name:
- Copy the Client ID and generate a Client Secret
- Add these to your
.envfile
Important: The OAuth app needs the following scopes:
read:user- To read user informationrepo- To read and write repository variables
cd frontend
npm run devThe app will be available at http://localhost:3000
- Install Vercel CLI:
npm i -g vercel - Navigate to the project root:
cd .. - Run
verceland follow the prompts - Add environment variables in Vercel dashboard:
GITHUB_CLIENT_IDGITHUB_CLIENT_SECRETGITHUB_REPO_OWNERGITHUB_REPO_NAMEVITE_GITHUB_CLIENT_ID(same asGITHUB_CLIENT_ID)
Note: Update your GitHub OAuth App's callback URL to match your Vercel deployment URL.
- Install Netlify CLI:
npm i -g netlify-cli - Navigate to the project root:
cd .. - Run
netlify deploy --prod - Add environment variables in Netlify dashboard:
GITHUB_CLIENT_IDGITHUB_CLIENT_SECRETGITHUB_REPO_OWNERGITHUB_REPO_NAMEVITE_GITHUB_CLIENT_ID(same asGITHUB_CLIENT_ID)
Note: Update your GitHub OAuth App's callback URL to match your Netlify deployment URL.
- Visit your deployed frontend URL
- Click "Sign in with GitHub"
- Authorize the application with the required permissions
- Add, edit, or delete projects as needed
- Changes are automatically saved to GitHub repository variables (
SCRAPER_PROJECTS)
The web app directly updates the GitHub repository variable, so your GitHub Actions will use the updated configuration on the next run.