API_DOCUMENTATION // v1

API Reference

Integrate tire wear analysis into your applications with our REST API.

Quick Start

Get started with a single API call

curl -X POST https://scantire.com/api/v1/analyze \
  -H "Content-Type: multipart/form-data" \
  -F "image=@tire-photo.jpg"

Authentication

During beta, anonymous requests are allowed with rate limits. For higher limits, authenticate via cookie or API key.

Cookie Auth

Login via web interface. Token stored in auth-token cookie.

API Key
Coming Soon

Header: X-API-Key: your_key

Endpoints

POST
/api/v1/analyze

Analyze a tire image and get wear classification

Request

# Content-Type: multipart/form-data

{
  "image": File (JPEG/PNG, max 10MB)
}

Response (200 OK)

{
  "success": true,
  "data": {
    "scanId": "clx123abc...",
    "result": {
      "wear": {
        "level": "good",        // new|good|medium|worn|critical
        "label": "Good Condition",
        "description": "Tire showing normal wear patterns",
        "color": "#84cc16"
      },
      "confidence": 0.847,      // 0.0 - 1.0
      "estimatedDepthMm": 5.2,  // Tread depth in mm
      "processingTimeMs": 234,
      "modelVersion": "resnet18-v1-beta"
    }
  }
}

Error Response (4xx/5xx)

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Daily scan limit reached"
  }
}
GET
/api/v1/scans

Get scan history for authenticated user

Authentication required

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 10, max: 50)

Response (200 OK)

{
  "success": true,
  "data": {
    "scans": [
      {
        "id": "clx123abc...",
        "wearLevel": "good",
        "confidence": 0.847,
        "estimatedDepthMm": 5.2,
        "processingTimeMs": 234,
        "createdAt": "2024-01-15T10:30:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 42,
      "totalPages": 5
    }
  }
}

Rate Limits

User TypeLimitPeriod
Anonymous (IP-based)3 scansper day
Free Account10 scansper month
Pro AccountUnlimited
API Key1,000 requestsper month

Wear Classification Classes

5-class tire wear classification system

LevelDepthColorStatus
new≥7.0mm #22c55eExcellent
good5.0-6.9mm #84cc16Good
medium3.0-4.9mm #eab308Fair
worn1.6-2.9mm #f97316Replace Soon
critical<1.6mm #ef4444Unsafe