A Flask-based REST API that provides endpoints for scraping listings from Bazos marketplace. The API supports both synchronous and asynchronous search operations with customizable search parameters. Main purpose is to be used with ChangeDetection.
- Search listings with customizable parameters
- Synchronous and asynchronous operation modes
- CORS support for cross-origin requests
- Flexible price range filtering
- Distance-based location filtering
- Customizable results limit
- Sorting options
Pull and run the Docker image:
docker pull bladecell/bazos-scraper-api
docker run -p 5000:5000 bladecell/bazos-scraper-api
- Clone the repository
- Install dependencies using the requirements.txt file:
pip install -r requirements.txt
The project includes a Dockerfile for containerized deployment. You can build the image locally:
docker build -t bazos-scraper-api .
docker run -p 5000:5000 bazos-scraper-api
Or use the pre-built image from Docker Hub:
docker pull bladecell/bazos-scraper-api
GET /api/search
Both endpoints accept the following query parameters:
Parameter | Type | Default | Description |
---|---|---|---|
search | string | '' | Search query text |
location | string | null | Location for search |
distance | string | '25' | Search radius in kilometers |
min_price | integer | null | Minimum price filter |
max_price | integer | null | Maximum price filter |
order | integer | null | Sort order for results |
results_limit | integer | null | Maximum number of results to return |
GET /api/search?search=iphone&location=Prague
GET /api/search?search=car&location=Brno&distance=50&min_price=1000&max_price=5000&order=1&results_limit=20
GET /api/async_search?search=laptop&location=Ostrava
The API returns a JSON array of listings, where each listing contains the scraped data from Bazos.
Example response:
[
{
"title": "Item Title",
"price": 1000,
"location": "Prague",
"url": "https://bazos.cz/item/123"
// ... additional listing details
}
]
docker run -p 5000:5000 bladecell/bazos-scraper-api
python app.py
The server will start on http://localhost:5000
by default.