{
  "openapi": "3.1.0",
  "info": {
    "title": "AutosXchange public data API",
    "version": "1.0.0",
    "description": "Read-only market intel aggregates (CC BY 4.0, attribution \"Source: AutosXchange\") and the MCP endpoint. Listing data belongs to the dealers. Rate limited per client; CSV capped at 2,000 rows per request; results beyond the first 5,000 rows of a query are not served publicly.",
    "contact": {
      "url": "https://autos-xchange.com/api/docs"
    },
    "license": {
      "name": "CC BY 4.0 (aggregates)",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://autos-xchange.com"
    }
  ],
  "paths": {
    "/api/intel-public": {
      "get": {
        "summary": "Intel aggregates",
        "parameters": [
          {
            "name": "view",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "status",
                "vinhist",
                "vin",
                "market",
                "changes",
                "movers",
                "dealer",
                "geo",
                "leaders",
                "trends",
                "trend",
                "trends-feed",
                "alerts",
                "compare",
                "geos",
                "sold",
                "added",
                "inventory",
                "activity",
                "actions",
                "heat"
              ]
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "rss"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "per",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 10,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid input or paging limit"
          },
          "404": {
            "description": "Not tracked"
          },
          "429": {
            "description": "Rate limited (see Retry-After)"
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "summary": "MCP Streamable HTTP endpoint (JSON-RPC 2.0)",
        "description": "Protocol versions 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26. Tools: search_listings, get_listing, vin_history, market_stats, price_changes, compare_dealers, dealer_profile.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "202": {
            "description": "Notification accepted"
          },
          "400": {
            "description": "Invalid request / header mismatch / unsupported version"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/inventory.json": {
      "get": {
        "summary": "Inventory totals and a 50-row preview (the full feed is for AutosXchange services only)",
        "parameters": [
          {
            "name": "summary",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Totals + preview"
          },
          "401": {
            "description": "Bulk formats need service credentials"
          }
        }
      }
    }
  }
}