Skip to main content

AutoTrader Parser Quick Start

Get started with AutoTrader parser in 5 minutes and extract comprehensive UK automotive data from the UK's largest marketplace.

What You'll Learn
  • Get your API key and set up authentication
  • Make your first API call to search UK vehicles
  • Handle responses and extract vehicle data
  • Implement error handling for production use
  • Scale your integration for business applications

Quick Start

🚀 Prerequisites

Before you begin, ensure you have:

Requirements
RequirementDescriptionHow to Get
API KeyAutoTrader parser accessSign up at Carapis Dashboard
Programming LanguageJavaScript, Python, or any HTTP clientYour preferred language
Basic HTTP KnowledgeUnderstanding of REST APIsNot required but helpful
UK Market FocusUnderstanding of UK automotive marketOptional for business context

📋 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 API Keys section
  4. Generate a new API key for AutoTrader parser
API Key Format

Your API key will look like this: autotrader_parser_sk_1234567890abcdef1234567890abcdef

  • Prefix: autotrader_parser_sk_
  • Length: 64 characters
  • Format: Hexadecimal string
  • Scope: AutoTrader parser access only

Verify Your API Key

curl -X GET "https://api.carapis.com/v1/parsers/autotrader/status" \
-H "Authorization: Bearer YOUR_API_KEY"

Expected response:

{
"success": true,
"data": {
"status": "active",
"parser": "autotrader",
"plan": "free"
}
}

🔧 Step 2: Your First API Call

Start with a simple search to find vehicles in the UK market:

const axios = require('axios');

const API_KEY = 'autotrader_parser_sk_1234567890abcdef1234567890abcdef';
const BASE_URL = 'https://api.carapis.com/v1/parsers/autotrader';

async function searchVehicles() {
try {
const response = await axios.post(
`${BASE_URL}/search`,
{
query: 'BMW 3 Series 2020',
max_price: 35000,
fuel_type: 'diesel',
location: 'London',
},
{
headers: {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
},
);

console.log(`Found ${response.data.data.listings.length} vehicles`);
return response.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
throw error;
}
}

// Usage
searchVehicles().then((data) => {
console.log('First vehicle:', data.data.listings[0]);
});
import requests

API_KEY = 'autotrader_parser_sk_1234567890abcdef1234567890abcdef'
BASE_URL = 'https://api.carapis.com/v1/parsers/autotrader'

def search_vehicles():
headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}

data = {
'query': 'BMW 3 Series 2020',
'max_price': 35000,
'fuel_type': 'diesel',
'location': 'London'
}

try:
response = requests.post(f'{BASE_URL}/search', json=data, headers=headers)
response.raise_for_status()

result = response.json()
print(f"Found {len(result['data']['listings'])} vehicles")
return result
except requests.exceptions.RequestException as e:
print(f'Error: {e}')
return None

# Usage
result = search_vehicles()
if result:
print('First vehicle:', result['data']['listings'][0])
curl -X POST "https://api.carapis.com/v1/parsers/autotrader/search" \
-H "Authorization: Bearer autotrader_parser_sk_1234567890abcdef1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"query": "BMW 3 Series 2020",
"max_price": 35000,
"fuel_type": "diesel",
"location": "London"
}'

📊 Step 3: Understanding the Response

Response Structure

Your API call returns comprehensive vehicle data:

{
"success": true,
"data": {
"listings": [
{
"id": "123456789",
"title": "BMW 320d M Sport",
"price": {
"amount": 32000,
"currency": "GBP",
"formatted": "£32,000"
},
"specifications": {
"year": 2020,
"mileage": 45000,
"fuel_type": "Diesel",
"transmission": "Automatic",
"engine_size": "2.0L",
"power": "190 hp"
},
"location": {
"city": "London",
"region": "Greater London",
"country": "United Kingdom"
},
"seller": {
"name": "BMW Approved Used",
"type": "dealer",
"rating": 4.9
},
"features": ["Navigation", "Leather Seats", "M Sport Package"],
"url": "https://www.autotrader.co.uk/...",
"extracted_at": "2024-01-15T10:30:00Z"
}
],
"total_count": 650,
"search_metadata": {
"query": "BMW 3 Series 2020",
"filters_applied": {
"max_price": 35000,
"fuel_type": "diesel"
}
}
}
}

Key Data Fields

Response Fields
FieldDescriptionExampleUse Case
idUnique vehicle identifier"123456789"Database storage
titleVehicle title/name"BMW 320d M Sport"Display purposes
price.amountNumeric price value32000Price calculations
price.formattedFormatted price string"£32,000"User display
specificationsTechnical detailsEngine, transmission, etc.Vehicle analysis
locationGeographic informationCity, region, countryGeographic analysis
sellerDealer informationName, rating, typeDealer analysis
featuresVehicle featuresArray of featuresFeature analysis
urlOriginal listing URLAutoTrader URLDirect access
extracted_atData extraction timestampISO timestampData freshness

🔍 Step 4: Advanced Search Options

Comprehensive Search Parameters

Expand your search with advanced filtering options:

// Advanced search with multiple filters
const advancedSearch = {
query: 'BMW X5',
year_from: 2018,
year_to: 2023,
price_min: 25000,
price_max: 60000,
fuel_type: 'diesel',
transmission: 'automatic',
body_type: 'suv',
location: 'Manchester',
mileage_max: 50000,
limit: 50,
};

const response = await axios.post(`${BASE_URL}/search`, advancedSearch, {
headers: { Authorization: `Bearer ${API_KEY}` },
});
# Advanced search with multiple filters
advanced_search = {
'query': 'BMW X5',
'year_from': 2018,
'year_to': 2023,
'price_min': 25000,
'price_max': 60000,
'fuel_type': 'diesel',
'transmission': 'automatic',
'body_type': 'suv',
'location': 'Manchester',
'mileage_max': 50000,
'limit': 50
}

response = requests.post(f'{BASE_URL}/search', json=advanced_search, headers=headers)

Search Parameters Reference

Available Parameters
ParameterTypeDescriptionExample
querystringSearch query (make, model, keywords)"BMW X5", "Mercedes C-Class"
year_fromnumberMinimum year2018
year_tonumberMaximum year2023
price_minnumberMinimum price (GBP)25000
price_maxnumberMaximum price (GBP)60000
fuel_typestringFuel type"diesel", "petrol", "hybrid", "electric"
transmissionstringTransmission type"automatic", "manual"
body_typestringBody type"suv", "saloon", "hatchback", "estate"
locationstringCity or region"London", "Manchester", "Birmingham"
mileage_maxnumberMaximum mileage (miles)50000
limitnumberResults per page (1-100)50
pagenumberPage number1

⚡ Step 5: Production-Ready Implementation

Error Handling

Implement robust error handling for production use:

async function safeSearch(searchParams) {
try {
const response = await axios.post(`${BASE_URL}/search`, searchParams, {
headers: { Authorization: `Bearer ${API_KEY}` },
});
return { success: true, data: response.data };
} catch (error) {
if (error.response?.status === 429) {
// Rate limit exceeded - wait and retry
await new Promise((resolve) => setTimeout(resolve, 60000));
return safeSearch(searchParams);
}

return {
success: false,
error: error.response?.data || error.message,
};
}
}
import time

def safe_search(search_params):
try:
response = requests.post(f'{BASE_URL}/search', json=search_params, headers=headers)
response.raise_for_status()
return {'success': True, 'data': response.json()}
except requests.exceptions.HTTPError as e:
if e.response.status_code == 429:
# Rate limit exceeded - wait and retry
time.sleep(60)
return safe_search(search_params)

return {
'success': False,
'error': e.response.json() if e.response.content else str(e)
}
except Exception as e:
return {
'success': False,
'error': str(e)
}

Batch Processing

Process multiple searches efficiently:

// Process multiple searches efficiently
async function batchSearch(queries) {
const promises = queries.map((query) =>
axios.post(`${BASE_URL}/search`, query, {
headers: { Authorization: `Bearer ${API_KEY}` },
}),
);

const results = await Promise.all(promises);
return results.map((r) => r.data);
}

// Usage
const queries = [
{ query: 'BMW X5', country: 'GB' },
{ query: 'Audi Q7', country: 'GB' },
{ query: 'Mercedes GLE', country: 'GB' },
];

const results = await batchSearch(queries);
import asyncio
import aiohttp

async def batch_search(queries):
async with aiohttp.ClientSession() as session:
tasks = []
for query in queries:
task = session.post(
f'{BASE_URL}/search',
json=query,
headers=headers
)
tasks.append(task)

responses = await asyncio.gather(*tasks)
return [await r.json() for r in responses]

# Usage
queries = [
{'query': 'BMW X5', 'country': 'GB'},
{'query': 'Audi Q7', 'country': 'GB'},
{'query': 'Mercedes GLE', 'country': 'GB'}
]

results = await batch_search(queries)

Configuration Management

Set up proper configuration for different environments:

// Configuration for different environments
const config = {
development: {
baseUrl: 'https://api.carapis.com/v1/parsers/autotrader',
timeout: 30000,
retries: 3,
},
production: {
baseUrl: 'https://api.carapis.com/v1/parsers/autotrader',
timeout: 60000,
retries: 5,
},
};

const currentConfig = config[process.env.NODE_ENV || 'development'];
import os

# Configuration for different environments
config = {
'development': {
'base_url': 'https://api.carapis.com/v1/parsers/autotrader',
'timeout': 30,
'retries': 3
},
'production': {
'base_url': 'https://api.carapis.com/v1/parsers/autotrader',
'timeout': 60,
'retries': 5
}
}

current_config = config[os.getenv('ENVIRONMENT', 'development')]

📈 Step 6: Performance Optimization

Rate Limiting

Respect API rate limits for optimal performance:

Rate Limits
PlanRequests per MinuteRequests per HourBest Practices
Free10100Testing and evaluation
Basic601,000Small applications
Pro30010,000Production applications
EnterpriseCustomCustomHigh-volume applications

Caching Strategy

Implement intelligent caching for better performance:

// Simple caching implementation
const cache = new Map();
const CACHE_DURATION = 15 * 60 * 1000; // 15 minutes

async function cachedSearch(searchParams) {
const cacheKey = JSON.stringify(searchParams);
const cached = cache.get(cacheKey);

if (cached && Date.now() - cached.timestamp < CACHE_DURATION) {
return cached.data;
}

const result = await safeSearch(searchParams);
cache.set(cacheKey, {
data: result,
timestamp: Date.now(),
});

return result;
}
import time
from functools import lru_cache

# Simple caching implementation
cache = {}
CACHE_DURATION = 15 * 60 # 15 minutes

def cached_search(search_params):
cache_key = str(search_params)
cached = cache.get(cache_key)

if cached and time.time() - cached['timestamp'] < CACHE_DURATION:
return cached['data']

result = safe_search(search_params)
cache[cache_key] = {
'data': result,
'timestamp': time.time()
}

return result

🔧 Step 7: Monitoring & Logging

Performance Monitoring

Track API performance and usage:

// Performance monitoring
async function monitoredSearch(searchParams) {
const startTime = Date.now();

try {
const result = await safeSearch(searchParams);
const duration = Date.now() - startTime;

console.log('Search completed', {
duration,
resultCount: result.data?.data?.listings?.length || 0,
query: searchParams.query,
});

return result;
} catch (error) {
const duration = Date.now() - startTime;
console.error('Search failed', {
duration,
error: error.message,
query: searchParams.query,
});
throw error;
}
}
import time
import logging

# Performance monitoring
def monitored_search(search_params):
start_time = time.time()

try:
result = safe_search(search_params)
duration = time.time() - start_time

logging.info('Search completed', {
'duration': duration,
'result_count': len(result.get('data', {}).get('listings', [])),
'query': search_params.get('query')
})

return result
except Exception as e:
duration = time.time() - start_time
logging.error('Search failed', {
'duration': duration,
'error': str(e),
'query': search_params.get('query')
})
raise

🚀 Next Steps

Ready to Scale?
  1. API Reference - Complete endpoint documentation
  2. Market Analysis - UK market insights
  3. FAQ - Common questions and solutions
  4. Features - Advanced capabilities
Pro Tips
  • Start with simple searches and gradually add complexity
  • Implement proper error handling for production reliability
  • Use caching to optimize performance and reduce costs
  • Monitor your usage to stay within rate limits
  • Test with different UK regions for comprehensive coverage
Need Help?

You're now ready to extract comprehensive UK automotive data with AutoTrader parser. Start building your automotive data applications today!

Get Your API Key →