🚀 One2Car Parser Quick Start
Get real-time automotive data from Thailand's leading car marketplace in under 5 minutes
- Real-time One2Car data - Live listings from Thailand's #1 car marketplace
- Complete vehicle details - Price, specs, images, seller info, location data
- Thai market insights - Local pricing, popular models, market trends
- Anti-detection technology - Reliable data extraction without blocks
- Multiple output formats - JSON, CSV, Excel for your workflow
📋 Prerequisites
Before you begin, ensure you have:
- Carapis API Key - Get your free key here
- Basic programming knowledge - Python, JavaScript, or cURL
- Internet connection - For API access
:::
info One2Car Market Overview One2Car is Thailand's largest automotive marketplace with over 100,000+ active listings covering Bangkok, Chiang Mai, Phuket, and all major Thai cities. The platform features both new and used vehicles from dealerships and private sellers. :::
🔑 Authentication Setup
1. Get Your API Key
# Sign up at Carapis Dashboard
curl -X POST "https://api.carapis.com/auth/register" \
-H "Content-Type: application/json" \
-d '{
"email": "your-email@example.com",
"password": "your-secure-password"
}'
2. Retrieve Your API Key
# Login and get your API key
curl -X POST "https://api.carapis.com/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "your-email@example.com",
"password": "your-secure-password"
}'
Your One2Car API key will look like: one2car_parser_sk_1234567890abcdef1234567890abcdef
🚗 Basic Usage Examples
Python Example
import requests
import json
# Configuration
API_KEY = "one2car_parser_sk_your_api_key_here"
BASE_URL = "https://api.carapis.com/v1/parsers/one2car"
# Search for Toyota cars in Bangkok
def search_toyota_bangkok():
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
params = {
"brand": "Toyota",
"location": "Bangkok",
"limit": 10
}
response = requests.get(f"{BASE_URL}/search", headers=headers, params=params)
if response.status_code == 200:
data = response.json()
print(f"Found {len(data['results'])} Toyota listings in Bangkok")
return data
else:
print(f"Error: {response.status_code} - {response.text}")
# Get detailed vehicle information
def get_vehicle_details(vehicle_id):
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.get(f"{BASE_URL}/vehicle/{vehicle_id}", headers=headers)
if response.status_code == 200:
vehicle = response.json()
print(f"Vehicle: {vehicle['title']}")
print(f"Price: {vehicle['price']} THB")
print(f"Year: {vehicle['year']}")
print(f"Location: {vehicle['location']}")
return vehicle
else:
print(f"Error: {response.status_code} - {response.text}")
# Example usage
if __name__ == "__main__":
# Search for Toyota cars
results = search_toyota_bangkok()
# Get details of first result
if results and results['results']:
first_vehicle = results['results'][0]
get_vehicle_details(first_vehicle['id'])
JavaScript Example
// Configuration
const API_KEY = 'one2car_parser_sk_your_api_key_here';
const BASE_URL = 'https://api.carapis.com/v1/parsers/one2car';
// Search for Honda cars in Chiang Mai
async function searchHondaChiangMai() {
const headers = {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
};
const params = new URLSearchParams({
brand: 'Honda',
location: 'Chiang Mai',
limit: '10',
});
try {
const response = await fetch(`${BASE_URL}/search?${params}`, {
method: 'GET',
headers: headers,
});
if (response.ok) {
const data = await response.json();
console.log(`Found ${data.results.length} Honda listings in Chiang Mai`);
return data;
} else {
console.error(`Error: ${response.status} - ${response.statusText}`);
}
} catch (error) {
console.error('Network error:', error);
}
}
// Get vehicle details
async function getVehicleDetails(vehicleId) {
const headers = {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
};
try {
const response = await fetch(`${BASE_URL}/vehicle/${vehicleId}`, {
method: 'GET',
headers: headers,
});
if (response.ok) {
const vehicle = await response.json();
console.log(`Vehicle: ${vehicle.title}`);
console.log(`Price: ${vehicle.price} THB`);
console.log(`Year: ${vehicle.year}`);
console.log(`Location: ${vehicle.location}`);
return vehicle;
} else {
console.error(`Error: ${response.status} - ${response.statusText}`);
}
} catch (error) {
console.error('Network error:', error);
}
}
// Example usage
searchHondaChiangMai().then((results) => {
if (results && results.results.length > 0) {
getVehicleDetails(results.results[0].id);
}
});
cURL Examples
# Search for BMW cars in Phuket
curl -X GET "https://api.carapis.com/v1/parsers/one2car/search" \
-H "Authorization: Bearer one2car_parser_sk_your_api_key_here" \
-H "Content-Type: application/json" \
-G \
-d "brand=BMW" \
-d "location=Phuket" \
-d "limit=5"
# Get specific vehicle details
curl -X GET "https://api.carapis.com/v1/parsers/one2car/vehicle/12345" \
-H "Authorization: Bearer one2car_parser_sk_your_api_key_here" \
-H "Content-Type: application/json"
# Search with multiple filters
curl -X GET "https://api.carapis.com/v1/parsers/one2car/search" \
-H "Authorization: Bearer one2car_parser_sk_your_api_key_here" \
-H "Content-Type: application/json" \
-G \
-d "brand=Toyota" \
-d "model=Camry" \
-d "year_min=2020" \
-d "price_max=1500000" \
-d "location=Bangkok"
🔍 Search Parameters
Parameter | Type | Description | Example |
---|---|---|---|
brand | string | Vehicle brand | "Toyota", "Honda", "BMW" |
model | string | Vehicle model | "Camry", "Civic", "X5" |
location | string | City or province | "Bangkok", "Chiang Mai" |
year_min | integer | Minimum year | 2020 |
year_max | integer | Maximum year | 2024 |
price_min | integer | Minimum price (THB) | 500000 |
price_max | integer | Maximum price (THB) | 2000000 |
fuel_type | string | Fuel type | "Petrol", "Diesel", "Hybrid" |
transmission | string | Transmission type | "Automatic", "Manual" |
limit | integer | Results per page | 10, 25, 50 |
page | integer | Page number | 1, 2, 3 |
📊 Response Format
Search Response
{
"success": true,
"total_results": 1250,
"page": 1,
"limit": 10,
"results": [
{
"id": "12345",
"title": "Toyota Camry 2.5G 2023",
"brand": "Toyota",
"model": "Camry",
"year": 2023,
"price": 1250000,
"currency": "THB",
"location": "Bangkok",
"mileage": 15000,
"fuel_type": "Petrol",
"transmission": "Automatic",
"color": "White",
"images": ["https://example.com/image1.jpg"],
"url": "https://www.one2car.com/listing/12345",
"seller_type": "Dealer",
"seller_name": "Toyota Bangkok",
"created_at": "2024-01-15T10:30:00Z"
}
]
}
Vehicle Details Response
{
"success": true,
"vehicle": {
"id": "12345",
"title": "Toyota Camry 2.5G 2023",
"brand": "Toyota",
"model": "Camry",
"variant": "2.5G",
"year": 2023,
"price": 1250000,
"currency": "THB",
"location": "Bangkok",
"province": "Bangkok",
"mileage": 15000,
"fuel_type": "Petrol",
"transmission": "Automatic",
"color": "White",
"engine_size": "2.5L",
"power": "200 HP",
"doors": 4,
"seats": 5,
"images": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
"description": "Excellent condition Toyota Camry...",
"features": ["Leather Seats", "Sunroof", "Navigation"],
"url": "https://www.one2car.com/listing/12345",
"seller": {
"type": "Dealer",
"name": "Toyota Bangkok",
"phone": "+66-2-123-4567",
"address": "123 Sukhumvit Road, Bangkok"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:15:00Z"
}
}
⚡ Advanced Usage
Batch Processing
import asyncio
import aiohttp
import json
async def batch_vehicle_details(vehicle_ids, api_key):
async with aiohttp.ClientSession() as session:
tasks = []
for vehicle_id in vehicle_ids:
task = get_vehicle_async(session, vehicle_id, api_key)
tasks.append(task)
results = await asyncio.gather(*tasks, return_exceptions=True)
return results
async def get_vehicle_async(session, vehicle_id, api_key):
headers = {"Authorization": f"Bearer {api_key}"}
url = f"https://api.carapis.com/v1/parsers/one2car/vehicle/{vehicle_id}"
async with session.get(url, headers=headers) as response:
if response.status == 200:
return await response.json()
else:
return {"error": f"Failed to fetch vehicle {vehicle_id}"}
# Usage
vehicle_ids = ["12345", "12346", "12347", "12348", "12349"]
results = asyncio.run(batch_vehicle_details(vehicle_ids, API_KEY))
Error Handling
import requests
from requests.exceptions import RequestException
import time
def robust_api_call(url, headers, max_retries=3):
for attempt in range(max_retries):
try:
response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
return response.json()
except RequestException as e:
if attempt == max_retries - 1:
raise e
time.sleep(2 ** attempt) # Exponential backoff
except Exception as e:
print(f"Unexpected error: {e}")
if attempt == max_retries - 1:
raise e
time.sleep(1)
🚨 Rate Limits & Best Practices
- Free Plan: 1,000 requests/day
- Pro Plan: 10,000 requests/day
- Enterprise: Custom limits
- Use pagination - Process results in batches of 25-50
- Implement caching - Store results to avoid duplicate requests
- Handle errors gracefully - Implement retry logic with exponential backoff
- Monitor usage - Track API calls to stay within limits
- Use filters - Narrow searches to reduce response time
🔧 Troubleshooting
Common Issues
Error: 401 Unauthorized
Solution: Verify your API key is correct and active
Error: 429 Too Many Requests
Solution: Implement rate limiting or upgrade your plan
Error: 400 Bad Request
Solution: Check parameter names and values in documentation
📈 Next Steps
- View API Reference - Complete endpoint documentation
- Market Analysis - Understand Thai automotive trends
- Integration Examples - Advanced use cases
- FAQ - Common questions and solutions
Need help? Contact our support team or check our comprehensive documentation.