If you run a flipping business, you already know the pain: the best items vanish in seconds. I was wasting hours manually refreshing searches to find underpriced clothes. It wasn't scaling.
I wanted a reliable vinted new listings alert sent straight to my phone, so I decided to script a Telegram bot.
Here is how I built it using Node.js, and how you can do it too.
The Problem with Scraping Vinted
Initially, I tried writing a custom script using Puppeteer. Bad idea. Vinted's Cloudflare protections and IP bans make direct scraping a massive headache. You spend more time fixing your proxies than actually buying inventory.
To fix this, I outsourced the heavy lifting. I found a ready-to-use vinted scraper on Apify that handles all the proxy rotation and bypasses the anti-bot walls automatically.
The Stack
- Node.js: The runtime.
- Telegraf: A solid wrapper for the Telegram Bot API.
- Apify API: To run the scraper and fetch the JSON results.
The Code
First, get your Telegram Bot Token from the BotFather on Telegram, and grab your Apify API token.
Install the dependencies:
npm install telegraf axios
Here is the core logic to poll for items and ping your Telegram chat:
const { Telegraf } = require('telegraf');
const axios = require('axios');
// Your tokens
const TELEGRAM_TOKEN = 'YOUR_TELEGRAM_BOT_TOKEN';
const APIFY_TOKEN = 'YOUR_APIFY_TOKEN';
const CHAT_ID = 'YOUR_TELEGRAM_CHAT_ID';
const bot = new Telegraf(TELEGRAM_TOKEN);
// Function to trigger the Apify actor and get results
async function checkNewListings() {
try {
console.log('Checking for new Vinted items...');
// Trigger the Apify scraper (replace ACTOR_ID with the specific task ID)
const response = await axios.post(
`https://api.apify.com/v2/acts/kazkn~vinted-turbo-scraper/runs?token=${APIFY_TOKEN}`,
{
searchUrl: "https://www.vinted.fr/vetements?search_text=carhartt",
maxItems: 5
}
);
// In a real app, you'd wait for the run to finish and fetch the dataset.
// For simplicity, let's assume we grabbed the latest item:
const dummyItem = {
title: "Carhartt Detroit Jacket",
price: "45.00",
url: "https://vinted.fr/item/12345"
};
// Send the alert to Telegram
const message = `🚨 **New Item Found!**\n\n${dummyItem.title}\nPrice: €${dummyItem.price}\nLink: ${dummyItem.url}`;
await bot.telegram.sendMessage(CHAT_ID, message, { parse_mode: 'Markdown' });
} catch (error) {
console.error('Scraping failed:', error.message);
}
}
// Run the check every 10 minutes
setInterval(checkNewListings, 10 * 60 * 1000);
bot.launch();
console.log('Vinted Alert Bot is running...');
Next Steps
To make this production-ready, you just need to add a simple database (like SQLite or Redis) to store the IDs of the items you have already seen. This prevents the bot from spamming you with duplicate alerts.
Set this up on a cheap VPS or a Raspberry Pi, and you will never miss a vinted deal again.
Top comments (0)