A powerful API interface for Ebay-Kleinanzeigen.de that enables you to fetch listings and specific data.
π Looking for a ready-to-use solution?
Try it at kleinanzeigen-agent.de Β»
β Automated Search Agents
β Search & Detail API
Report Bug
Β·
Request Feature
Visit kleinanzeigen-agent.de for our hosted solution with additional features and zero configuration required.
- Python 3.12 or higher
- pip (Python package manager)
- Playwright
- Clone the repository
git clone https://github.com/DanielWTE/ebay-kleinanzeigen-api.git
cd ebay-kleinanzeigen-api- Install dependencies
pip install -r requirements.txt
playwright install chromium- Start the API
uvicorn main:app --reloadThe API will be available at http://localhost:8000
- uv package manager
uv syncuv run uvicorn main:app --reload- Build the Docker image
docker build -t ebay-kleinanzeigen-api .- Run the Docker container
docker run -p 8000:8000 ebay-kleinanzeigen-apiThe API will be available at http://localhost:8000
Endpoint: GET /inserate
Description: Retrieves a list of listings based on search criteria.
query(string, optional): The search term (e.g., "fahrrad" to search for bicycles).location(string, optional): The location or postal code to narrow the search (e.g.,10178for Berlin).radius(integer, optional): The search radius in kilometers from the specified location (e.g.,5for a 5 km radius).min_price(integer, optional): The minimum price in Euros for the listings (e.g.,200for at least 200 Euros).max_price(integer, optional): The maximum price in Euros for the listings (e.g.,500for at most 500 Euros).page_count(integer, optional): The number of pages to search or return (e.g.,5for the first 5 pages, default is 1, max: 20 pages).
GET /inserate?query=fahrrad&location=10178&radius=5&min_price=200&page_count=5Endpoint: GET /inserat/{id}
Description: Retrieves detailed information about a specific listing.
id(string): The unique identifier of the listing to fetch details for.
GET /inserat/12345Endpoint: GET /inserate-detailed
Description: Retrieves listings and their detailed information in a single request.
Same as /inserate endpoint, plus:
max_concurrent_details(integer, optional): Maximum concurrent detail fetches (default: 5, max: 10).
GET /inserate-detailed?query=laptop&page_count=2&max_concurrent_details=5All API endpoints return responses in the following JSON format:
{
"success": true,
"time_taken": 1.23,
"unique_results": 100,
"data": [...],
"performance_metrics": {
"pages_requested": 5,
"pages_successful": 5,
"success_rate": 100.0,
"average_page_time": 2.45
}
}{
"success": true,
"time_taken": 3.45,
"unique_results": 25,
"data": [
{
"adid": "123456",
"title": "Example Item",
"price": "100",
"details": {
"id": "123456",
"description": "Full description...",
"seller": {...},
"location": {...}
}
}
],
"performance_metrics": {
"listings_found": 25,
"details_fetched": 25,
"success_rate": 100.0
}
}Performance tests conducted on Arch Linux with Intel i7-1260P processor:
| Endpoint | Operation | Avg Time | Min Time | Max Time | Success Rate | Results |
|---|---|---|---|---|---|---|
| Root | API status check | 0.004s | 0.001s | 0.009s | 100% | - |
| Listings | 1 page search | 1.209s | 1.081s | 1.596s | 100% | 25 |
| Listings | 5 pages search | 2.436s | 2.328s | 2.532s | 100% | 125 |
| Listings | 10 pages search | 4.989s | 4.790s | 5.229s | 100% | 250 |
| Details | Single listing details | 1.072s | 0.928s | 1.276s | 100% | 1 |
| Combined | 1 page + details | 9.058s | 8.804s | 9.319s | 100% | 25 |
| Combined | 2 pages + details | 17.512s | 17.063s | 18.038s | 100% | 50 |
- Single page search: ~1.2s average response time
- 10-page search: ~5.0s average response time
- Individual listing details: ~1.1s average response time
- Combined search + details: ~9.1s average for 1 page with full details
All tests performed with uvloop optimization and browser context pooling enabled.
- uvloop Integration: High-performance asyncio event loop
- Context Pooling: Efficient browser resource reuse
- Memory Optimization: Automatic garbage collection and efficient processing
- Intelligent Concurrency: Optimal concurrent processing with resource control
- Clean API Responses: Minimal overhead with essential data only
- Resource Management: Automatic cleanup and efficient resource usage
- Scalable Architecture: Handles concurrent requests efficiently
- Docker Optimized: Fast container builds with uv package manager
API documentation is available at http://localhost:8000/docs when running locally.
Distributed under the MIT License. See LICENSE for more information.