Dubizzle Motors Parser Quick Start
Get started with the Dubizzle Motors parser in 5 minutes. Extract real-time automotive data from the Middle East's leading marketplace.
What You'll Learn
- API setup - Get your API key and configure access
- Basic requests - Make your first data extraction calls
- Search filters - Use advanced search capabilities
- Error handling - Handle common issues and errors
- Best practices - Optimize your data extraction workflow
Prerequisites
:::
info Requirements
- API Key from Carapis Dashboard (required)
- Basic programming knowledge (Python, JavaScript, or cURL)
- Internet connection for API access
- Valid account with active subscription :::
Step 1: Get Your API Key
Sign Up for Carapis
- Visit Carapis Dashboard
- Create a new account or sign in
- Navigate to the Parsers section
- Select Dubizzle Motors parser
- Choose your subscription plan
- Generate your API key
API Key Format
Your Dubizzle Motors API key will look like this:
dubizzle_parser_sk_1234567890abcdef1234567890abcdef
Verify Your API Key
Test Your Key
curl -X GET "https://api.carapis.com/v1/dubizzle/status" \
-H "Authorization: Bearer YOUR_API_KEY"
Expected response:
{
"status": "active",
"parser": "dubizzle",
"plan": "starter",
"requests_remaining": 10000
}
Step 2: Make Your First Request
Basic Vehicle Search
Simple Search Example
import requests
# API configuration
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.carapis.com/v1/dubizzle"
# Search for Toyota Camry in UAE
response = requests.get(f"{BASE_URL}/search",
params={
"make": "Toyota",
"model": "Camry",
"country": "UAE",
"limit": 10
},
headers={"Authorization": f"Bearer {API_KEY}"}
)
if response.status_code == 200:
data = response.json()
print(f"Found {len(data['results'])} vehicles")
for vehicle in data['results']:
print(f"{vehicle['year']} {vehicle['make']} {vehicle['model']} - {vehicle['price']} AED")
else:
print(f"Error: {response.status_code}")
JavaScript Example
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.carapis.com/v1/dubizzle';
// Search for vehicles
async function searchVehicles() {
try {
const response = await fetch(`${BASE_URL}/search?make=Toyota&model=Camry&country=UAE&limit=10`, {
headers: {
Authorization: `Bearer ${API_KEY}`,
},
});
if (response.ok) {
const data = await response.json();
console.log(`Found ${data.results.length} vehicles`);
data.results.forEach((vehicle) => {
console.log(`${vehicle.year} ${vehicle.make} ${vehicle.model} - ${vehicle.price} AED`);
});
} else {
console.error(`Error: ${response.status}`);
}
} catch (error) {
console.error('Network error:', error);
}
}
searchVehicles();
cURL Example
curl -X GET "https://api.carapis.com/v1/dubizzle/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
-G \
-d "make=Toyota" \
-d "model=Camry" \
-d "country=UAE" \
-d "limit=10"
Step 3: Advanced Search Filters
Geographic Filtering
Location-Based Search
# Search in specific cities
params = {
"country": "UAE",
"city": "Dubai", # or "Abu Dhabi", "Sharjah"
"make": "BMW",
"model": "X5",
"year_min": 2020,
"year_max": 2023
}
# Search across multiple countries
params = {
"countries": ["UAE", "Saudi Arabia", "Kuwait"],
"make": "Mercedes",
"price_min": 50000,
"price_max": 200000
}
Price and Year Filters
# Price range search
params = {
"make": "Toyota",
"model": "Land Cruiser",
"price_min": 100000, # AED
"price_max": 300000, # AED
"year_min": 2018,
"year_max": 2023
}
# Budget-friendly search
params = {
"price_max": 50000, # AED
"year_min": 2015,
"condition": "used"
}
Feature-Based Search
# Search by specific features
params = {
"make": "Lexus",
"features": ["leather_seats", "sunroof", "navigation"],
"transmission": "automatic",
"fuel_type": "hybrid"
}
# Search by vehicle type
params = {
"vehicle_type": "SUV",
"seats_min": 7,
"country": "Saudi Arabia"
}
Step 4: Handle Responses
Parse Vehicle Data
Response Structure
# Example response structure
{
"results": [
{
"id": "dubizzle_12345",
"title": "2022 Toyota Camry XSE",
"make": "Toyota",
"model": "Camry",
"year": 2022,
"trim": "XSE",
"price": 85000,
"currency": "AED",
"mileage": 15000,
"location": {
"country": "UAE",
"city": "Dubai",
"area": "Dubai Marina"
},
"specifications": {
"engine": "2.5L 4-Cylinder",
"transmission": "Automatic",
"fuel_type": "Gasoline",
"color": "Pearl White"
},
"features": ["Leather Seats", "Navigation", "Bluetooth"],
"images": ["https://example.com/image1.jpg"],
"seller": {
"name": "Dubai Auto Gallery",
"type": "dealer",
"rating": 4.8
},
"url": "https://dubizzle.com/vehicle/12345"
}
],
"total": 150,
"page": 1,
"limit": 10
}
Error Handling
import requests
import time
def search_vehicles_with_retry(params, max_retries=3):
for attempt in range(max_retries):
try:
response = requests.get(f"{BASE_URL}/search",
params=params,
headers={"Authorization": f"Bearer {API_KEY}"}
)
if response.status_code == 200:
return response.json()
elif response.status_code == 429:
# Rate limit exceeded
wait_time = 2 ** attempt # Exponential backoff
print(f"Rate limited. Waiting {wait_time} seconds...")
time.sleep(wait_time)
elif response.status_code == 401:
print("Invalid API key. Please check your credentials.")
return None
else:
print(f"Error {response.status_code}: {response.text}")
return None
except requests.exceptions.RequestException as e:
print(f"Network error: {e}")
if attempt < max_retries - 1:
time.sleep(1)
return None
Step 5: Best Practices
Optimize Your Requests
Performance Tips
- Use specific filters - Narrow down search criteria
- Implement pagination - Process large datasets efficiently
- Cache results - Store frequently accessed data
- Monitor rate limits - Stay within API limits
- Handle errors gracefully - Implement proper error handling
Rate Limiting
Rate Limits
Plan | Requests/Second | Requests/Minute | Requests/Hour |
---|---|---|---|
Starter | 5 | 100 | 1,000 |
Professional | 10 | 500 | 5,000 |
Enterprise | 50 | 2,000 | 20,000 |
import time
def rate_limited_request(url, params, delay=0.2):
"""Make rate-limited requests"""
response = requests.get(url, params=params, headers={"Authorization": f"Bearer {API_KEY}"})
time.sleep(delay) # Respect rate limits
return response
Data Storage
import json
import sqlite3
from datetime import datetime
def store_vehicle_data(vehicles, database_path="vehicles.db"):
"""Store vehicle data in SQLite database"""
conn = sqlite3.connect(database_path)
cursor = conn.cursor()
# Create table if not exists
cursor.execute('''
CREATE TABLE IF NOT EXISTS vehicles (
id TEXT PRIMARY KEY,
title TEXT,
make TEXT,
model TEXT,
year INTEGER,
price REAL,
currency TEXT,
location TEXT,
created_at TIMESTAMP
)
''')
# Insert vehicles
for vehicle in vehicles:
cursor.execute('''
INSERT OR REPLACE INTO vehicles
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
''', (
vehicle['id'],
vehicle['title'],
vehicle['make'],
vehicle['model'],
vehicle['year'],
vehicle['price'],
vehicle['currency'],
json.dumps(vehicle['location']),
datetime.now()
))
conn.commit()
conn.close()
Step 6: Complete Example
Full Working Script
import requests
import json
import time
from datetime import datetime
class DubizzleParser:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = "https://api.carapis.com/v1/dubizzle"
self.headers = {"Authorization": f"Bearer {api_key}"}
def search_vehicles(self, params, max_pages=5):
"""Search for vehicles with pagination"""
all_vehicles = []
for page in range(1, max_pages + 1):
params['page'] = page
try:
response = requests.get(f"{self.base_url}/search",
params=params, headers=self.headers)
if response.status_code == 200:
data = response.json()
all_vehicles.extend(data['results'])
# Check if we've reached the end
if len(data['results']) < params.get('limit', 10):
break
time.sleep(0.2) # Rate limiting
else:
print(f"Error on page {page}: {response.status_code}")
break
except Exception as e:
print(f"Error on page {page}: {e}")
break
return all_vehicles
def get_vehicle_details(self, vehicle_id):
"""Get detailed information for a specific vehicle"""
try:
response = requests.get(f"{self.base_url}/vehicle/{vehicle_id}",
headers=self.headers)
if response.status_code == 200:
return response.json()
else:
print(f"Error getting vehicle {vehicle_id}: {response.status_code}")
return None
except Exception as e:
print(f"Error getting vehicle {vehicle_id}: {e}")
return None
# Usage example
if __name__ == "__main__":
API_KEY = "YOUR_API_KEY"
parser = DubizzleParser(API_KEY)
# Search for luxury SUVs in Dubai
search_params = {
"make": "BMW",
"model": "X5",
"country": "UAE",
"city": "Dubai",
"year_min": 2020,
"price_min": 200000,
"limit": 20
}
vehicles = parser.search_vehicles(search_params)
print(f"Found {len(vehicles)} vehicles")
# Save results
with open(f"dubizzle_results_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json", 'w') as f:
json.dump(vehicles, f, indent=2)
Troubleshooting
Common Issues
Rate Limiting
If you get a 429 error:
- Reduce request frequency
- Implement exponential backoff
- Consider upgrading your plan
- Use batch requests when possible
Authentication Errors
If you get a 401 error:
- Check your API key is correct
- Verify your subscription is active
- Ensure you're using the right parser endpoint
- Contact support if issues persist
Empty Results
If you get no results:
- Check your search parameters
- Try broader search criteria
- Verify the data exists in the region
- Test with simple queries first
Next Steps
Continue Learning
- API Reference - Complete API documentation
- Market Analysis - Regional insights
- FAQ - Common questions and solutions
- Examples - More code examples
Need Help?
- Documentation - Complete API guide
- Support - Technical assistance
- Community - Connect with other users
- Status - Check service status
You're now ready to extract real-time automotive data from the Middle East's leading marketplace. Start building your automotive data solution with the Dubizzle Motors parser today.