---
title: "Typeahead search over variant names"
method: GET
path: "/search"
tags: ["utilities"]
---

# Typeahead search over variant names

`GET /search`

## Request

- Base URL: `https://api.cars-data.com/v1`
- URL: `https://api.cars-data.com/v1/search`
- Auth: one of:
  - API key in header `X-Api-Key`
  - HTTP bearer
  - none

Trigram matching on brand, model and display name. In the demo tier this is a substring match over the 40 rows, in the Worker — there is no catalogue behind it to walk.

## Query parameters

- `q` string, required
- `locale` 'ar' | 'bg' | 'cs' | 'da' | 'de' | 'el' | 'en' | 'es' | 'fr' | 'hr' | 'hu' | 'it' | 'no' | 'pl' | 'pt' | 'ro' | 'sk' | 'sr' | 'sv' | 'tr'
- `cursor` string
- `limit` integer

## Headers

- `PAYMENT-SIGNATURE` string

## Response `200`

OK. Paid with x402, it also carries `PAYMENT-RESPONSE`.

- SearchResultEnvelope
  - `data` SearchResult[]
    - `brand_slug` string
    - `display_name` string
    - `generation_id` string
    - `model_slug` string
    - `variant_id` string
    - `year_from` integer, nullable
    - `year_to` integer, nullable
  - `links` Links
    - `next` string, nullable: Opaque cursor for the next page; absent when the page was not full.
  - `meta` Meta
    - `last_synced_at` string, date-time, required
    - `locale` string
    - `units` 'metric' | 'imperial'

## Other responses

- `400`: RFC 9457 problem document.
- `401`: No key, or a key we do not know. `WWW-Authenticate: Bearer` on the MCP surface. The MCP server needs no key at all; a REST demo key is one click away. On the two x402 routes a request with no key gets `402` instead, with the price.
- `402`: No key and no valid payment. The price and how to pay are in the `PAYMENT-REQUIRED` header; the body says the same in words. A request that sent a key never gets this — it gets `401`/`403` instead.
- `403`: The key is revoked or not yet active, or — on a demo key — the path is outside the demo tier. The detail says which, and carries the upgrade path.
- `429`: A limit on **your** key: per-minute, per-day or per-month. The detail names which. Distinct from `503`, which is a failure on our side.

---

[API](https://skmtc.dev/cars-data/apis/cars-data-com-api.md) · [All operations](https://skmtc.dev/cars-data/apis/cars-data-com-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cars-data/apis/cars-data-com-api/revisions/4aeb6b2b5c5f?raw)
