Skip to main content

🔌 One2Car API Reference

Complete endpoint documentation for extracting real-time automotive data from Thailand's leading marketplace

API Overview
  • Base URL: https://api.carapis.com/v1/parsers/one2car
  • Authentication: Bearer token required
  • Rate Limits: 1,000 requests/day (free), 10,000 requests/day (pro)
  • Response Format: JSON
  • Timezone: Asia/Bangkok (UTC+7)

🔑 Authentication

All API requests require authentication using a Bearer token in the Authorization header:

Authorization: Bearer one2car_parser_sk_your_api_key_here
API Key Format

Your One2Car API key follows this pattern: one2car_parser_sk_ followed by a 32-character hexadecimal string.

📡 Endpoints

Search Vehicles

Search for vehicles with various filters and parameters.

Endpoint: GET /search

Parameters:

ParameterTypeRequiredDescriptionExample
brandstringNoVehicle brand"Toyota", "Honda"
modelstringNoVehicle model"Camry", "Civic"
locationstringNoCity or province"Bangkok", "Chiang Mai"
year_minintegerNoMinimum year2020
year_maxintegerNoMaximum year2024
price_minintegerNoMinimum price (THB)500000
price_maxintegerNoMaximum price (THB)2000000
fuel_typestringNoFuel type"Petrol", "Diesel"
transmissionstringNoTransmission"Automatic", "Manual"
limitintegerNoResults per page (max 100)25
pageintegerNoPage number1

Example Request:

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 "location=Bangkok" \
-d "year_min=2020" \
-d "limit=10"

Example 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"
}
]
}

Get Vehicle Details

Retrieve detailed information about a specific vehicle.

Endpoint: GET /vehicle/\{vehicle_id\}

Parameters:

ParameterTypeRequiredDescription
vehicle_idstringYesUnique vehicle identifier

Example Request:

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"

Example 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 with full service history...",
"features": ["Leather Seats", "Sunroof", "Navigation System", "Bluetooth", "Backup Camera"],
"url": "https://www.one2car.com/listing/12345",
"seller": {
"type": "Dealer",
"name": "Toyota Bangkok",
"phone": "+66-2-123-4567",
"email": "contact@toyotabangkok.com",
"address": "123 Sukhumvit Road, Bangkok 10110",
"website": "https://www.toyotabangkok.com"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:15:00Z"
}
}

Get Brands

Retrieve list of available vehicle brands.

Endpoint: GET /brands

Parameters: None

Example Request:

curl -X GET "https://api.carapis.com/v1/parsers/one2car/brands" \
-H "Authorization: Bearer one2car_parser_sk_your_api_key_here" \
-H "Content-Type: application/json"

Example Response:

{
"success": true,
"brands": [
{
"name": "Toyota",
"count": 15420,
"popular_models": ["Camry", "Corolla", "Fortuner"]
},
{
"name": "Honda",
"count": 12850,
"popular_models": ["Civic", "City", "CR-V"]
},
{
"name": "BMW",
"count": 3250,
"popular_models": ["X5", "3 Series", "5 Series"]
}
]
}

Get Models

Retrieve models for a specific brand.

Endpoint: GET /brands/\{brand\}/models

Parameters:

ParameterTypeRequiredDescription
brandstringYesBrand name (e.g., "Toyota")

Example Request:

curl -X GET "https://api.carapis.com/v1/parsers/one2car/brands/Toyota/models" \
-H "Authorization: Bearer one2car_parser_sk_your_api_key_here" \
-H "Content-Type: application/json"

Example Response:

{
"success": true,
"brand": "Toyota",
"models": [
{
"name": "Camry",
"count": 1250,
"years": [2020, 2021, 2022, 2023, 2024]
},
{
"name": "Corolla",
"count": 980,
"years": [2019, 2020, 2021, 2022, 2023, 2024]
},
{
"name": "Fortuner",
"count": 750,
"years": [2020, 2021, 2022, 2023, 2024]
}
]
}

Get Locations

Retrieve list of available locations.

Endpoint: GET /locations

Parameters: None

Example Request:

curl -X GET "https://api.carapis.com/v1/parsers/one2car/locations" \
-H "Authorization: Bearer one2car_parser_sk_your_api_key_here" \
-H "Content-Type: application/json"

Example Response:

{
"success": true,
"locations": [
{
"name": "Bangkok",
"type": "province",
"count": 45200
},
{
"name": "Chiang Mai",
"type": "province",
"count": 8500
},
{
"name": "Phuket",
"type": "province",
"count": 3200
},
{
"name": "Pattaya",
"type": "city",
"count": 2800
}
]
}

Get Market Statistics

Retrieve market statistics and trends.

Endpoint: GET /statistics

Parameters:

ParameterTypeRequiredDescriptionExample
brandstringNoFilter by brand"Toyota"
locationstringNoFilter by location"Bangkok"
periodstringNoTime period"30d", "90d", "1y"

Example Request:

curl -X GET "https://api.carapis.com/v1/parsers/one2car/statistics?brand=Toyota&location=Bangkok&period=30d" \
-H "Authorization: Bearer one2car_parser_sk_your_api_key_here" \
-H "Content-Type: application/json"

Example Response:

{
"success": true,
"statistics": {
"total_listings": 15420,
"average_price": 1250000,
"price_range": {
"min": 250000,
"max": 8500000
},
"popular_models": [
{
"name": "Camry",
"count": 1250,
"avg_price": 1450000
},
{
"name": "Corolla",
"count": 980,
"avg_price": 850000
}
],
"price_trends": [
{
"date": "2024-01-01",
"avg_price": 1230000,
"listings": 15200
},
{
"date": "2024-01-15",
"avg_price": 1250000,
"listings": 15420
}
]
}
}

📊 Response Codes

Status CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
403Forbidden - Insufficient permissions
404Not Found - Resource not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error

🔧 Error Responses

Authentication Error

{
"success": false,
"error": {
"code": "AUTH_ERROR",
"message": "Invalid API key",
"details": "The provided API key is invalid or expired"
}
}

Validation Error

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid parameters",
"details": {
"price_min": "Must be a positive integer",
"year_max": "Must be between 1990 and 2024"
}
}
}

Rate Limit Error

{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded",
"details": {
"limit": 1000,
"reset_time": "2024-01-21T00:00:00Z"
}
}
}

🚨 Rate Limits

Rate Limit Information
  • Free Plan: 1,000 requests per day
  • Pro Plan: 10,000 requests per day
  • Enterprise: Custom limits available
  • Reset Time: Daily at 00:00 UTC

Rate Limit Headers

The API includes rate limit information in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 850
X-RateLimit-Reset: 1705795200

📝 Code Examples

Python SDK

import requests
from typing import Dict, List, Optional

class One2CarAPI:
def __init__(self, api_key: str):
self.api_key = api_key
self.base_url = "https://api.carapis.com/v1/parsers/one2car"
self.headers = {
"Authorization": f"Bearer \{api_key\}",
"Content-Type": "application/json"
}

def search_vehicles(self, **params) -> Dict:
"""Search for vehicles with filters"""
response = requests.get(f"{self.base_url}/search",
headers=self.headers, params=params)
response.raise_for_status()
return response.json()

def get_vehicle(self, vehicle_id: str) -> Dict:
"""Get detailed vehicle information"""
response = requests.get(f"{self.base_url}/vehicle/\{vehicle_id\}",
headers=self.headers)
response.raise_for_status()
return response.json()

def get_brands(self) -> Dict:
"""Get available brands"""
response = requests.get(f"{self.base_url}/brands",
headers=self.headers)
response.raise_for_status()
return response.json()

def get_models(self, brand: str) -> Dict:
"""Get models for a specific brand"""
response = requests.get(f"{self.base_url}/brands/\{brand\}/models",
headers=self.headers)
response.raise_for_status()
return response.json()

# Usage
api = One2CarAPI("one2car_parser_sk_your_api_key_here")

# Search for Toyota cars
results = api.search_vehicles(brand="Toyota", location="Bangkok", limit=10)

# Get vehicle details
vehicle = api.get_vehicle("12345")

JavaScript SDK

class One2CarAPI {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseUrl = 'https://api.carapis.com/v1/parsers/one2car';
this.headers = {
Authorization: `Bearer $\{apiKey\}`,
'Content-Type': 'application/json',
};
}

async searchVehicles(params = {}) {
const queryString = new URLSearchParams(params).toString();
const response = await fetch(`${this.baseUrl}/search?$\{queryString\}`, {
method: 'GET',
headers: this.headers,
});

if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}

return await response.json();
}

async getVehicle(vehicleId) {
const response = await fetch(`${this.baseUrl}/vehicle/$\{vehicleId\}`, {
method: 'GET',
headers: this.headers,
});

if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}

return await response.json();
}

async getBrands() {
const response = await fetch(`${this.baseUrl}/brands`, {
method: 'GET',
headers: this.headers,
});

if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}

return await response.json();
}

async getModels(brand) {
const response = await fetch(`${this.baseUrl}/brands/$\{brand\}/models`, {
method: 'GET',
headers: this.headers,
});

if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}

return await response.json();
}
}

// Usage
const api = new One2CarAPI('one2car_parser_sk_your_api_key_here');

// Search for Honda cars
api
.searchVehicles({ brand: 'Honda', location: 'Chiang Mai', limit: 10 })
.then((results) => console.log(results))
.catch((error) => console.error(error));

// Get vehicle details
api
.getVehicle('12345')
.then((vehicle) => console.log(vehicle))
.catch((error) => console.error(error));

🔄 Webhooks

Webhook Support

Webhooks are available for real-time data updates. Contact our support team to set up webhook notifications for new listings and price changes.

Webhook Events

EventDescription
vehicle.createdNew vehicle listing added
vehicle.updatedVehicle information updated
vehicle.removedVehicle listing removed
price.changedVehicle price changed

Webhook Payload

{
"event": "vehicle.created",
"timestamp": "2024-01-20T14:30:00Z",
"data": {
"vehicle_id": "12345",
"title": "Toyota Camry 2.5G 2023",
"price": 1250000,
"location": "Bangkok"
}
}

📞 Support

Need Help?

Ready to start? Get your API key and begin extracting One2Car data today!