Welcome to pintrest-tg-api, the ultimate open-source Pinterest Image Downloader and Telegram Webhook Bot. Built entirely on a headless Node.js Serverless architecture, this project allows you to seamlessly extract maximum-resolution (4K/8K) images from Pinterest and deliver them natively as media albums directly to any Telegram chat.
Designed for instant deployment on Vercel, this bot bypasses strict anti-scraping walls by utilizing authenticated session cookies, making it one of the most reliable Pinterest Web Scrapers available on GitHub.
- Maximum Quality Extraction: The dynamic image engine safely upgrades thumbnail links and guarantees the highest original resolution (
/orig/or/736x/) stored on Pinterest servers without encountering AWS S3 403 Access Denied errors. - Interactive Telegram Albums: Transforms Pinterest queries into beautifully formatted 5-photo Telegram Albums (MediaGroups) paired with interactive inline keyboard buttons for endless image discovery.
- Anti-Bot Bypass: By injecting your real
PINTEREST_COOKIEdirectly into HTTP headers, it entirely avoids CAPTCHAs and 403 Forbidden blocks. - Vercel Serverless Ready: 100% optimized for Edge deployment. Zero server maintenance, zero polling—pure webhook-driven architecture.
- Universal Telegram Compatibility: Operates perfectly in both private Direct Messages (DMs) and public Group Chats without requiring admin rights.
Deploy your own instance of this Node.js Pinterest API Bot in seconds. The Vercel setup will automatically prompt you for your environment variables.
To securely connect the bot, you must provide:
BOT_TOKEN: Your unique Telegram Bot Token generated by @BotFather.PINTEREST_COOKIE: Your serialized Pinterest login session cookie (should start with_pinterest_referrer=...).
Once Vercel finishes deploying your API, you must link your bot by registering the Webhook URL. Open your browser and paste the following URL (replace the bracketed info):
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook?url=https://<YOUR-VERCEL-PROJECT-URL>.vercel.app/api
If you want to modify the scraper or add features locally:
- Clone this repository:
git clone https://github.com/ajisth69/pintrest-tg-api.git - Install dependencies:
npm install - Create a
.envfile containing yourBOT_TOKENandPINTEREST_COOKIE. - Start the local Express testing environment:
npm run dev - Use Ngrok to expose port
3000to the internet and set your Telegram webhook to the Ngrok URL.
/start- Initialize the bot./help- View the help menu and command list./owner- Show developer credits./pic <query>- Scrape and download the top 5 high-res photos for your search term (e.g.,/pic cyberpunk 4k wallpaper).
Keywords: Pinterest Downloader, Pinterest Scraper, Unofficial Pinterest API, Telegram Bot, Node.js Scraper, Vercel Serverless, Webhook Bot, High-Resolution Pinterest Images, Image Extractor.
Created by @letmesolo_her