Skip to main content

OLX Autos Parser Quick Start

Get started with the OLX Autos parser in 5 minutes. Extract real-time automotive data from the world's leading global marketplace.

What You'll Learn
  • API setup - Get your API key and configure access
  • Basic requests - Make your first data extraction calls
  • Global search - Use advanced search across multiple countries
  • Multi-language support - Handle different languages and currencies
  • Best practices - Optimize your global data extraction workflow

Prerequisites

:::

Quick Start

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

  1. Visit Carapis Dashboard
  2. Create a new account or sign in
  3. Navigate to the Parsers section
  4. Select OLX Autos parser
  5. Choose your subscription plan
  6. Generate your API key
API Key Format

Your OLX Autos API key will look like this: olx_parser_sk_1234567890abcdef1234567890abcdef

Verify Your API Key

Test Your Key
curl -X GET "https://api.carapis.com/v1/olx/status" \
-H "Authorization: Bearer YOUR_API_KEY"

Expected response:

{
"status": "active",
"parser": "olx",
"plan": "starter",
"requests_remaining": 10000
}

Step 2: Make Your First Request

Simple Search Example
import requests

# API configuration
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.carapis.com/v1/olx"

# Search for Toyota Camry in India
response = requests.get(f"{BASE_URL}/search",
params={
"make": "Toyota",
"model": "Camry",
"country": "IN",
"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']} {vehicle['currency']}")
else:
print(f"Error: {response.status_code}")

JavaScript Example

const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.carapis.com/v1/olx';

// Search for vehicles
async function searchVehicles() {
try {
const response = await fetch(`${BASE_URL}/search?make=Toyota&model=Camry&country=IN&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} ${vehicle.currency}`);
});
} else {
console.error(`Error: ${response.status}`);
}
} catch (error) {
console.error('Network error:', error);
}
}

searchVehicles();

cURL Example

curl -X GET "https://api.carapis.com/v1/olx/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
-G \
-d "make=Toyota" \
-d "model=Camry" \
-d "country=IN" \
-d "limit=10"

Step 3: Advanced Search Filters

Geographic Filtering

Country-Specific Search
# Search in India
params = {
"country": "IN",
"city": "Mumbai", # Optional: specific city
"make": "Maruti"
}

# Search in Indonesia
params = {
"country": "ID",
"city": "Jakarta",
"make": "Toyota"
}

# Search in Brazil
params = {
"country": "BR",
"city": "São Paulo",
"make": "Fiat"
}

# Search across multiple countries
params = {
"countries": ["IN", "ID", "BR"], # India, Indonesia, Brazil
"make": "Honda"
}

Price and Year Filters

# Price range search (in local currency)
params = {
"make": "Toyota",
"model": "Innova",
"country": "IN",
"price_min": 500000, # INR
"price_max": 1500000, # INR
"year_min": 2018,
"year_max": 2023
}

# Budget-friendly search
params = {
"country": "ID",
"price_max": 200000000, # IDR
"year_min": 2015,
"condition": "used"
}

Language and Currency Support

# Search with language preference
params = {
"make": "Honda",
"country": "IN",
"language": "hi", # Hindi
"limit": 20
}

# Search with currency specification
params = {
"make": "Fiat",
"country": "BR",
"currency": "BRL", # Brazilian Real
"price_min": 50000
}

Step 4: Handle Responses

Parse Vehicle Data

Response Structure
# Example response structure
{
"results": [
{
"id": "olx_12345",
"title": "2022 Toyota Camry XSE",
"make": "Toyota",
"model": "Camry",
"year": 2022,
"trim": "XSE",
"price": 2500000,
"currency": "INR",
"mileage": 15000,
"location": {
"country": "IN",
"city": "Mumbai",
"area": "Bandra West"
},
"specifications": {
"engine": "2.5L 4-Cylinder",
"transmission": "Automatic",
"fuel_type": "Petrol",
"color": "Pearl White"
},
"features": ["Leather Seats", "Navigation", "Bluetooth"],
"images": ["https://example.com/image1.jpg"],
"seller": {
"name": "Mumbai Auto Gallery",
"type": "dealer",
"rating": 4.8
},
"url": "https://olx.in/vehicle/12345",
"language": "en"
}
],
"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: Multi-Country Data Extraction

# Search across multiple emerging markets
countries = ["IN", "ID", "BR", "PK", "PH", "TH"]

for country in countries:
params = {
"make": "Toyota",
"model": "Innova",
"country": country,
"limit": 20
}

data = search_vehicles_with_retry(params)
if data:
print(f"Found {len(data['results'])} vehicles in {country}")
# Process data for each country

Currency Conversion

import requests

def get_exchange_rates():
"""Get current exchange rates for comparison"""
response = requests.get("https://api.exchangerate-api.com/v4/latest/USD")
if response.status_code == 200:
return response.json()["rates"]
return None

def compare_prices_across_markets(vehicles_data):
"""Compare vehicle prices across different markets"""
rates = get_exchange_rates()
if not rates:
return

for vehicle in vehicles_data:
price_usd = vehicle['price'] / rates.get(vehicle['currency'], 1)
print(f"{vehicle['make']} {vehicle['model']} - {vehicle['price']} {vehicle['currency']} (${price_usd:.2f})")

Step 6: Best Practices

Optimize Your Requests

Performance Tips
  1. Use specific filters - Narrow down search criteria
  2. Implement pagination - Process large datasets efficiently
  3. Cache results - Store frequently accessed data
  4. Monitor rate limits - Stay within API limits
  5. Handle errors gracefully - Implement proper error handling
  6. Use language filters - Target specific language content

Rate Limiting

Rate Limits
PlanRequests/SecondRequests/MinuteRequests/Hour
Starter51001,000
Professional105005,000
Enterprise502,00020,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,
country TEXT,
language 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'],
vehicle['location']['country'],
vehicle.get('language', 'en'),
datetime.now()
))

conn.commit()
conn.close()

Step 7: Complete Example

Full Working Script

import requests
import json
import time
from datetime import datetime

class OLXParser:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = "https://api.carapis.com/v1/olx"
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

def search_global_markets(self, make, model, countries):
"""Search for vehicles across multiple countries"""
global_results = {}

for country in countries:
params = {
"make": make,
"model": model,
"country": country,
"limit": 50
}

vehicles = self.search_vehicles(params)
global_results[country] = vehicles
print(f"Found {len(vehicles)} vehicles in {country}")

time.sleep(1) # Rate limiting between countries

return global_results

# Usage example
if __name__ == "__main__":
API_KEY = "YOUR_API_KEY"
parser = OLXParser(API_KEY)

# Search for Honda City across emerging markets
countries = ["IN", "ID", "BR", "PK", "PH"]
results = parser.search_global_markets("Honda", "City", countries)

# Save results
with open(f"olx_results_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json", 'w') as f:
json.dump(results, f, indent=2)

print("Data extraction completed!")

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
  • Check language settings

Language and Currency Issues

Language Handling
  • Use language codes - 'en', 'hi', 'id', 'pt', etc.
  • Handle encoding - Ensure UTF-8 encoding
  • Currency conversion - Convert prices for comparison
  • Local formatting - Respect local number formats

Next Steps

Continue Learning
  1. API Reference - Complete API documentation
  2. Market Analysis - Global insights
  3. FAQ - Common questions and solutions
  4. Examples - More code examples
Need Help?

You're now ready to extract real-time automotive data from the world's leading global marketplace. Start building your global automotive data solution with the OLX Autos parser today.

View API Reference →