Biz-Scrape-Python is a REST API built with FastAPI that scrapes business information using Google Places API. It allows users to find business details by specifying a business type, location (latitude/longitude + radius), and returns structured business information.
- 📍 Search businesses by latitude/longitude + radius
- 🔎 Filter results by business type (Hotels, Restaurants, Lawyers, etc.)
- 📦 Store business data in a database for future updates
- 📊 Return structured JSON containing:
- Name
- Website (if available)
- Email (if available)
- Place ID
- Address
- Phone number (if available)
- Rating and reviews
- Opening hours
Before running the application, you'll need:
- Python 3.8 or higher
- Google Places API credentials (see API Keys Setup)
- pip or another package manager
This project requires Google Places API credentials to function. We support two authentication methods:
- API Key (simpler, good for development)
- Service Account (more secure, recommended for production)
The project includes a keys
directory structure for managing these credentials:
keys/
├── google/
│ ├── service-account.json # Your Google service account key (if using service account)
│ └── README.md # Detailed setup instructions
└── README.md # General keys management info
Follow these steps to set up your credentials:
-
Copy
.env.example
to.env
:cp .env.example .env
-
Choose your authentication method:
- For API Key: Add your key to
.env
- For Service Account: Place your JSON key file in
keys/google/
- For API Key: Add your key to
Detailed setup instructions can be found in:
keys/README.md
- General credentials managementkeys/google/README.md
- Google-specific setup instructions
-
Clone the repository
git clone https://github.com/your-repo/biz-scrape-python.git cd biz-scrape-python
-
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up your API credentials (see API Keys Setup)
-
Run the FastAPI server
uvicorn main:app --reload
-
Access API documentation
- Swagger UI: http://127.0.0.1:8000/docs
- ReDoc: http://127.0.0.1:8000/redoc
- Never commit API keys or service account files to version control
- Use different credentials for development and production
- Regularly rotate your credentials
- Consider using a secrets management service in production
Feel free to submit pull requests or open issues for suggestions and improvements. 🚀
This project is licensed under the MIT License - see the LICENSE file for details.