รับคีย์ API ทดสอบ

คีย์ API ทดสอบจะถูกส่งไปยังอีเมลของคุณ

How to Get Started

1

Fill the Form

ใส่ชื่อโปรเจค อีเมล และ URL เว็บไซต์ที่คุณวางแผนจะใช้ API ของเรา หากยังไม่มีเว็บไซต์ - ปล่อยว่างไว้

2

Get Your API Key

คีย์ API สาธิตของคุณจะถูกส่งไปยังอีเมลของคุณ

3

Make First Request

ใช้ตัวอย่างโค้ดเพื่อทดสอบ endpoints ที่ปรับให้เหมาะสมกับ AI: /trims/{id}/full สำหรับข้อมูลรถยนต์ที่สมบูรณ์หรือ /search/vehicles สำหรับการค้นหาด้วยภาษาธรรมชาติ

4

Build Your App

รวมข้อมูลยานพาหนะเข้ากับแอปพลิเคชันหรือเว็บไซต์ของคุณโดยใช้เอกสารและ SDK ของเรา

5

ลองการค้นหาด้วย AI

ทดสอบการค้นหาภาษาธรรมชาติของเรา: อธิบายรถยนต์ด้วยข้อความธรรมดาและรับผลลัพธ์ที่เกี่ยวข้องพร้อมข้อมูลจำเพาะหลัก — เหมาะสำหรับแชทบอทและผู้ช่วย AI

Quick Start Code Example

คัดลอกโค้ดนี้และแทนที่ YOUR_API_KEY ด้วยคีย์ทดสอบของคุณ ตัวอย่างแสดง endpoints แบบรวม (/full) และการค้นหาอัจฉริยะ — ปรับให้เหมาะสมกับแอปพลิเคชัน AI/LLM

const API_KEY = 'YOUR_API_KEY';

// One request replaces 6 separate API calls!
// Get full trim data: breadcrumbs + specs + equipments
const response = await fetch(
  'https://v3.api.car2db.com/trims/263119/full',
  {
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Referer': 'https://yourwebsite.com'
    }
  }
);

const data = await response.json();
const trim = data.trim || data; // Handle both /full and regular response

// All data in one response:
console.log(trim.name);                    // → "2.5 AT"
console.log(trim.breadcrumbs?.make?.name);  // → "Toyota"
console.log(trim.breadcrumbs?.model?.name); // → "Camry"

// Key specs optimized for LLMs:
console.log(trim.keySpecifications?.engineVolume);  // → 2496
console.log(trim.keySpecifications?.power);         // → 200
console.log(trim.keySpecifications?.transmission);  // → "Automatic"

// All specifications grouped by category:
trim.specifications?.forEach(group => {
  console.log(group.category.name);  // → "Engine", "Transmission", etc
  group.items.forEach(spec => {
    console.log(`${spec.name}: ${spec.value}`);
  });
});
import requests

API_KEY = 'YOUR_API_KEY'

# Natural language search - find vehicles by description
headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Referer': 'https://yourwebsite.com'
}

response = requests.get(
    'https://v3.api.car2db.com/search/vehicles',
    headers=headers,
    params={'q': 'Toyota Camry 2.5 automatic'}
)

if response.status_code == 200:
    results = response.json()
    
    # Results grouped by models with relevance score
    for model in results.get('results', []):
        print(f"{model['model']['name']} ({model['matchingTrimsCount']} trims)")
        
        for trim in model.get('matchingTrims', []):
            print(f"  {trim['name']} ({trim['yearBegin']}-{trim['yearEnd']})")
            print(f"  Relevance: {trim['relevanceScore']}")
            
            # Key specs included in search results:
            specs = trim.get('keySpecifications', {})
            print(f"  Engine: {specs.get('engineVolume')}L {specs.get('power')}hp")
            print(f"  Transmission: {specs.get('transmission')}")
else:
    print(f"Error: {response.status_code}")
<?php
$apiKey = 'YOUR_API_KEY';

// Get trim with full context: breadcrumbs + key specs
// Replace 263119 with a real trim ID
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://v3.api.car2db.com/trims/263119/full');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer {$apiKey}",
    "Referer: https://yourwebsite.com"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$data = json_decode($response, true);
$trim = $data['trim'] ?? $data; // Handle both formats

if (isset($trim['breadcrumbs'])) {
    // Breadcrumbs provide full navigation context:
    $breadcrumbs = $trim['breadcrumbs'];
    echo "{$breadcrumbs['make']['name']} ";        // → "Toyota"
    echo "{$breadcrumbs['model']['name']} ";       // → "Camry"
    echo "{$breadcrumbs['generation']['name']} ";  // → "XV70"
    echo "{$trim['name']}\n";                      // → "2.5 AT"
    
    // Key specifications optimized for AI/LLM:
    $specs = $trim['keySpecifications'] ?? [];
    echo "Engine: {$specs['engineVolume']} cm\n";    // → "2496 cm"
    echo "Power: {$specs['power']}hp\n";           // → "200hp"
    echo "Drive: {$specs['drive']}\n";             // → "Front"
}
API_KEY="YOUR_API_KEY"

# Get equipment with ALL options grouped by category
curl -X GET "https://v3.api.car2db.com/equipments/54321/full" \
     -H "Authorization: Bearer $API_KEY" \
     -H "Referer: https://yourwebsite.com"

# Response includes complete equipment data in one request:
{
  "equipment": {
    "id": 54321,
    "name": "Prestige",
    "breadcrumbs": {
      "make": { "id": 10, "name": "Toyota" },
      "model": { "id": 120, "name": "Camry" }
    }
  },
  "options": {
    "Safety": [
      { "name": "Airbags", "value": "8" },
      { "name": "ABS", "value": "Standard" }
    ],
    "Comfort": [
      { "name": "Climate Control", "value": "Dual-zone" },
      { "name": "Heated Seats", "value": "Front & Rear" }
    ],
    "Multimedia": [
      { "name": "Display", "value": "10.1 inch touchscreen" }
    ]
  }
}
# Zero-code AI Integration
# Connect Claude Desktop, Cursor, VS Code to Car2DB API

## Claude Desktop Configuration
# File: claude_desktop_config.json
{
  "mcpServers": {
    "car2db": {
      "command": "npx",
      "args": ["-y", "@car2db/mcp-server"],
      "env": {
        "CAR2DB_API_KEY": "your_api_key_here",
        "CAR2DB_LANGUAGE": "en-US"
      }
    }
  }
}

## GitHub Copilot / VS Code Configuration
# File: .vscode/mcp.json
{
  "mcpServers": {
    "car2db": {
      "command": "npx",
      "args": ["-y", "@car2db/mcp-server"],
      "env": {
        "CAR2DB_API_KEY": "your_api_key_here",
        "CAR2DB_LANGUAGE": "en-US"
      }
    }
  }
}

# Now ask AI: "Find specifications for Toyota Camry 2.5"
# AI will automatically use Car2DB API via MCP Server!

ตัวอย่าง 40+ รายการพร้อมใช้งานบน GitHub

ดูตัวอย่าง GitHub

ความแตกต่างระหว่าง API สาธิตและ API เต็มรูปแบบ

Feature API สาธิต API เต็มรูปแบบ
ข้อมูล 2 manufacturers 109K+ ยานพาหนะ
Endpoints แบบรวม (/full)
การค้นหาอัจฉริยะ (/search/vehicles)
Breadcrumbs และ Key Specs
Data Updates Static snapshot Monthly updates
Uptime SLA ไม่มี SLA 99.9%
Use Case Testing & evaluation Production apps
Price FREE มีค่าใช้จ่าย

Frequently Asked Questions

What data is included in the demo API?

The demo API includes complete specifications for 2 manufacturers (e.g., Audi and BMW) with all available models, generations, series, and trims. You get access to 80 technical specifications per vehicle, just like the full API.

How long is the demo API key valid?

Your demo API key is valid for 1 year.

Can I use the demo API in production?

No, demo API keys are intended for testing and evaluation only. The limited data (2 manufacturers) and rate limits make them unsuitable for production use. Upgrade to a full API plan for production deployment.

How do I upgrade to the full API?

Simply visit our pricing page and choose the API Subscription plan. Your demo API key will be upgraded to a full production key immediately after payment.

Is my demo API key the same format as production keys?

ใช่ คีย์เดโมใช้กลไกการตรวจสอบสิทธิ์เดียวกันและจุดสิ้นสุด API เดียวกันกับคีย์ที่เสียค่าใช้จ่าย ทำให้ง่ายต่อการอัปเกรดโดยไม่ต้องเปลี่ยนโค้ดของคุณ

Can I request additional manufacturers for testing?

Demo keys are limited to the 2 pre-selected manufacturers. Other vehicle models can be seen on the interactive demo.

ฉันสามารถทดสอบ endpoints แบบรวมใหม่ด้วยคีย์ทดลองได้หรือไม่?

Demo API รวมคุณสมบัติใหม่ทั้งหมด: endpoints แบบรวม /trims/{id}/full และ /equipments/{id}/full, breadcrumbs และ keySpecifications คุณสามารถทดสอบโครงสร้างการตอบสนองที่เหมาะสมสำหรับ AI ได้อย่างสมบูรณ์

ฉันสามารถทดสอบการค้นหายานพาหนะด้วยคีย์ทดลองได้หรือไม่?

ได้ endpoint /search/vehicles พร้อมใช้งานกับ demo API ลองคำค้นหาภาษาธรรมดา เช่น "Audi A4 2.0" หรือ "BMW X5 diesel" เพื่อทดสอบฟังก์ชันการค้นหาที่ขับเคลื่อนโดย AI

Car2DB Support