A collection of production-ready recipes and scripts to help you get started with Bright Data faster. Each recipe demonstrates best practices for web scraping using Bright Data's proxy infrastructure.
This cookbook provides ready-to-use scraping recipes that you can run immediately or use as a foundation for your own projects. Each recipe includes:
- Complete, working code
- Detailed documentation
- Configuration examples
- Best practices and tips
- Error handling patterns
Production-ready Amazon product scraper with concurrent scraping using Bright Data's Web Unlocker API.
Features:
- ⚡ Concurrent scraping (configurable: 10-200+ concurrent requests)
- 🔓 Web Unlocker API with automatic IP rotation and anti-bot bypass
- 🎯 Two-phase scraping (search results → product details)
- 📦 Structured data extraction (title, price, ratings, images, specs, reviews)
- 📊 Search metadata (searchTerm, searchRank, searchPage)
- 💾 Organized output with ASIN-based folders
- 🔌 Easy integration with other projects
Use Cases:
- Price monitoring
- Market research
- Competitor analysis
- Inventory tracking
Each recipe is self-contained in its own directory. To use a recipe:
-
Navigate to the recipe directory:
cd Amazon_scraper -
Install dependencies:
npm install
-
Configure your credentials:
cp .env.example .env # Edit .env with your Bright Data credentials -
Run the recipe:
npm run scrape
- Node.js 18+ - All recipes require Node.js 18 or higher
- Bright Data Account - Sign up at brightdata.com
- API Token or Proxy Zone - Depending on the recipe
Sign up at brightdata.com if you don't have an account.
- Go to Bright Data Settings
- Generate an API token
- Create a Web Unlocker zone at Zones Dashboard
- Add credentials to your recipe's
.envfile:BRIGHT_DATA_API_TOKEN=your_token_here WEB_UNLOCKER_ZONE=unlocker
- Go to Bright Data Dashboard
- Click "Add Zone"
- Select proxy type:
- Datacenter - Cost-efficient, good for high-volume scraping
- Residential - Higher success rate, better for difficult sites
- Get your credentials:
- Customer ID (starts with
hl_) - Zone name
- Zone password
- Customer ID (starts with
- Add these to your recipe's
.envfile
Each recipe follows this structure:
recipe_name/
├── README.md # Complete documentation
├── package.json # Dependencies and scripts
├── .env.example # Environment variable template
├── src/ # Source code
│ └── *.js # Main scripts
└── examples/ # Example scripts and tests (optional)
└── test_connection.js
Test with minimal settings first:
- Small number of pages/products
- Short delays between requests
- Test connection before full runs
- Datacenter: Start here - cheaper, good success rate
- Residential: Use if datacenter gets blocked - higher cost, better success
- All recipes include built-in delays
- Don't reduce delays too much
- Monitor success rates
- Check error logs in output directories
- Review failed requests
- Adjust settings based on error patterns
- Recipes auto-organize output
- Keep raw HTML for debugging
- Extract structured data separately
We welcome contributions! To add a new recipe:
-
Fork this repository
-
Create a new recipe directory:
mkdir My_Recipe cd My_Recipe -
Follow the recipe structure:
- Add README.md with clear documentation
- Include .env.example for credentials
- Provide working example code
- Add error handling
- Include test scripts
-
Update this README:
- Add your recipe to the "Available Recipes" section
- Include a brief description and use cases
-
Submit a Pull Request:
- Describe what your recipe does
- Include any special requirements
- Provide example output
Your recipe should:
- ✅ Work out of the box after configuration
- ✅ Include comprehensive documentation in README.md
- ✅ Handle errors gracefully
- ✅ Use environment variables for credentials
- ✅ Include example output/logs
- ✅ Follow Node.js best practices
- ✅ Implement proper rate limiting or concurrency control
- ✅ Use Bright Data's Web Unlocker API or session rotation for unique IPs
- ✅ Be production-ready and easily integrable
# Test your Bright Data connection
cd recipe_name
npm testAuthentication Failed:
- Verify credentials in
.envfile - Check zone is active in Bright Data dashboard
- Ensure zone type matches configuration
High Failure Rate:
- Increase delays between requests
- Switch from Datacenter to Residential proxies
- Check if target site has changed structure
No Data Extracted:
- Review raw HTML output
- Check if selectors need updating
- Verify site structure hasn't changed
MIT License - feel free to use these recipes for personal and commercial projects.
- Check individual recipe documentation
- Review error logs in output directories
- Open an issue for bugs or feature requests
- Contribute improvements via Pull Requests
Built with Bright Data - The world's #1 web data platform
Start fast. Scrape responsibly. Build amazing things.