Skip to content

SERP Results using Bright Data is a Python script that automates Google search queries using the Bright Data API, extracts the top two organic search results, and saves them in an Excel file. It supports asynchronous execution, domain exclusions, and automated backups for efficient data retrieval. πŸš€

DataDiggerJay/SERP-results-using-BrightData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ README.md

A well-structured README for your SERP Results using Bright Data project.

# SERP Results using Bright Data πŸš€

**Fetch search engine results asynchronously using Bright Data API and store them in an Excel file.**  
This script automates Google searches, excludes specified domains, and extracts the top two organic search results.

---

## πŸ“Œ Features
βœ… **Asynchronous execution** for fast query processing  
βœ… **Exclusion filters** to remove unwanted domains  
βœ… **Automated backup & recovery** for large datasets  
βœ… **Excel & CSV support** for easy data handling  
βœ… **Logs & status updates** for real-time progress  

---

## πŸ“¦ Installation

### 1️⃣ Clone this repository:
```sh
git clone https://github.com/DataDiggerJay/SERP-results-using-BrightData.git
cd SERP-results-using-BrightData

2️⃣ Install dependencies:

pip install -r requirements.txt

πŸ”‘ How to Get a Bright Data API Key

  1. Sign Up on Bright Data

  2. Create a New Zone

    • Navigate to the Bright Data dashboard.
    • Go to Zones and create a new SERP API Zone.
  3. Generate an API Key

    • In the API settings, generate a new API key.
    • Keep this key private.
  4. Update script.py

    • Replace "YOUR_BRIGHT_DATA_API_KEY" in script.py with your actual API key.

πŸ›  Usage

1️⃣ Prepare Your Query File

  • Create an Excel file (queries.xlsx)
  • Add a column named "Search Query" containing search terms

2️⃣ Run the script:

python script.py

3️⃣ Output:

  • Results are saved back to the Excel file.
  • Backup is stored in backup.csv to prevent data loss.

πŸ›‘ Excluding Domains

To prevent fetching results from certain websites, modify the EXCLUDE_SITES list in script.py.
Example:

EXCLUDE_SITES = [".medium.com", ".blogger.com", ".blogspot.com", "youtube.com"]

⚑ Example Workflow

Input (queries.xlsx):

Search Query
Best Python courses
AI tools 2024

Output (queries.xlsx after running the script):

Search Query Result 1 Result 2
Best Python courses https://realpython.com https://learnpython.org
AI tools 2024 https://towardsdatascience.com https://ai.googleblog.com

πŸ›  Troubleshooting

πŸ”Ή Issue: API requests fail
πŸ‘‰ Check if your API key is correct and Zone settings allow requests.

πŸ”Ή Issue: Results are empty
πŸ‘‰ Ensure Google SERP API Zone is active & API usage is not limited.

πŸ”Ή Issue: queries.xlsx not found
πŸ‘‰ Make sure the Excel file exists and is correctly named.


🀝 Contributing

Feel free to fork this repository and submit pull requests! πŸ› 


πŸ“„ License

This project is licensed under the MIT License.


πŸ“¬ Contact

For questions or support, reach out on GitHub or open an issue. πŸš€


---

### πŸ”₯ What This README Covers:
βœ… **Project Overview**  
βœ… **Installation Guide**  
βœ… **How to Get an API Key**  
βœ… **How to Use the Script**  
βœ… **Example Output**  
βœ… **Troubleshooting & FAQs**  
βœ… **Contributing Guidelines**  
βœ… **License & Contact Info**  

About

SERP Results using Bright Data is a Python script that automates Google search queries using the Bright Data API, extracts the top two organic search results, and saves them in an Excel file. It supports asynchronous execution, domain exclusions, and automated backups for efficient data retrieval. πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages