Getting started

Conventions

Last updated:

Encoding, response shape, null semantics, and the stability contract.

Every /v2 group follows the same conventions. Learn them once and the reference pages only have to tell you what an operation returns.

Request encoding

Repeatable filters repeat the parameter. No commas and no custom delimiters. A filter that takes many values takes the parameter many times. This example, like every query string on this page, is generated by the contract's own URL codec:

GET /v2/listings/search?make=make:tesla&make=make:rivian

Ranges are dotted. {field}.min and {field}.max, either side optional:

GET /v2/listings/search?year.min=2022&price.min=20000&price.max=60000

Spec filters address the catalog directly. spec.{attributeId} filters on any canonical spec attribute. Numeric attributes take .min/.max, and availability attributes take repeated values:

GET /v2/listings/search?spec.fuelEconomyCombined.min=35&spec.heatedSeatsFront=standard

Unknown spec keys return 400 unknown_spec_attributes naming the bad keys, the same way unknown refs do.

Refs in paths vs queries

A ref's slashes are part of the key (model-year:honda/cr-v/2026), so position matters:

  • In a URL path, encode slashes as %2F: https://api.cardog.app/v2/entities/model-year:honda%2Fcr-v%2F2026
  • In a query string, pass the ref raw: ?make=make:tesla

Every links block the API emits is already encoded correctly, which is one more reason to follow links instead of assembling paths.

A ref is domain:slug: make:tesla, model:mini/hardtop, model-year:honda/cr-v/2026. In a URL path, encode the slashes as %2F; in a query string, pass the ref raw. Ref filters repeat the parameter (?make=make:tesla&make=make:rivian). Browse domains and members with GET /v2/entities, and look up any ref with GET /v2/entities/{ref}. The full grammar, and the npm package that validates it offline, is in Ref grammar.

Query with refs

Refs work across every group: listings, quotes, specs, recalls. Not every parameter is a ref, though, and the distinction matters:

  • Ref parameters name a node in the graph: make, model, and the path segment on quotes, specs, and recalls. They take a full {domain}:{key} string and reject anything else with a 400 that names the bad value.
  • Scalar parameters are ordinary filters: year.min, year.max, price.max, limit. They take numbers.

On listings, a make is a ref and a year is a range, so make=make:tesla and year.min=2022 in the same query is normal. Listings filters accept make and model refs only. There is no model-year= filter, because a model year on this surface is a year range. To query a single model year as a node, use the groups that take one in the path (quotes, specs, recalls, safety), as below.

# Listings: make is a ref, year is a range
curl "https://api.cardog.app/v2/listings/search?make=make:tesla&year.min=2022&limit=5" \
  -H "x-api-key: $CARDOG_API_KEY" \
  -H "Cardog-Version: 2026-10-26"

# Live market quote for an instrument
curl "https://api.cardog.app/v2/quotes/model-year:honda%2Fcr-v%2F2026" \
  -H "x-api-key: $CARDOG_API_KEY" \
  -H "Cardog-Version: 2026-10-26"

# Recalls scoped to an entity. make:, model:, and model-year: all work
curl "https://api.cardog.app/v2/recalls/entity/model-year:honda%2Fcr-v%2F2026" \
  -H "x-api-key: $CARDOG_API_KEY" \
  -H "Cardog-Version: 2026-10-26"

Response conventions

  • camelCase keys everywhere. No snake_case in any response.
  • Dates are ISO 8601 strings (2026-07-23T12:00:00Z, or YYYY-MM-DD for date-grain fields like tape bars).
  • Pagination is an object, not headers. Paged responses carry a pagination block with page, limit. Page size is capped per endpoint, and the cap is in the reference.
  • Every response carries links, a map from relation name to a server-relative path for related resources (an entity's quotes, recalls, listings, specs). Follow them instead of constructing URLs.
  • null means not derivable. A null fuelType on a VIN decode means the registry cannot support that claim for this VIN. It is a statement about coverage, and the API never substitutes a guess where it cannot verify.
  • A failed resolution returns nothing. When GET /v2/vin/{vin} answers "valid": false, every identity field in that response is null and every ref is null, including the nano and squish grains. We do not fill the gap from adjacent records, because a plausible-looking join key is worse than an empty one: you would store it.
  • Derived and observed never share a field. A fact we resolved ourselves and a fact we saw on a listing are different facts, and the payload keeps them apart. A VIN identity's trim is the catalogue trim the VIN's own pattern resolves to, tagged by trimAuthorityTier. The words a seller wrote on a listing ride in observedTrim with their own authorityTier and asOf. Price on the first and display the second.

Request ids and retries

  • Every response carries X-Request-Id. It is the id recorded on any credit debit for that request, and every v2 error envelope carries the same value as requestId. Quote it when you dispute a charge or report a failure and we can find the exact debit.
  • Metered POSTs honour Idempotency-Key: POST /v2/vin/batch and POST /v2/chassis/image. Send any string up to 255 characters, one per logical call. A retry with the same key and the same body within 24 hours returns the first response again and debits nothing, even if your credits have since run out: X-Credits-Rate is 0, Idempotent-Replayed is true, and X-Idempotent-Original-Request-Id is the id of the request that was billed. A replay carries no other X-Credits-* header. The same key with a different body, path or query string is a different request and runs fresh. Other routes ignore the header.
  • What is stored. Only a 2xx that was billed, including a batch whose rows partly failed: to decode the failed rows again, send them in a new call with a new key. An error, or an answer that cost nothing, is never replayed, so that call can be retried with the same key.
  • Billed once per key and body in 24 hours. A retry sent while the first call is still running, or within about a minute of it, can run again instead of replaying. It returns a fresh answer without Idempotent-Replayed, and it is not billed again. Its X-Credits-* headers are set before the retry is recognised, so they show the call's usual rate and source, but your balance is not reduced a second time. If the first call used the last of a free allowance, such a retry can be refused with 402 insufficient_credits; send it again with the same key once the first call has returned, and it replays.
  • Keys are scoped to the API key that sent them. The same key sent with another API key is another request.

Versioning and stability

Within a version, the v2 contract changes additively: new fields, new endpoints, new enum members, new error codes. Nothing a version has shipped is renamed, removed, or changed in type. A change like that ships as a new dated version, and the one you pinned keeps answering (see Versioning).

  • Open sets stay open. Error codes (17 well-known today), authority keys, and bar sources can gain members. Dispatch on the members you know and fall back gracefully. New members are not a breaking change.
  • Refs are permanent. The ref grammar is versioned (GRAMMAR_VERSION = 1, exported by the registry itself), and a ref, once issued, keeps its meaning for the life of the platform.
  • v1 is legacy. It keeps working for existing integrations, but new work should target /v2 only. The version switcher in these docs marks v1 accordingly.

The machine-readable contract is GET https://api.cardog.app/v2/openapi.json. These docs, including this page, are generated from it and from the same source modules the server imports.

Batch semantics

Batch endpoints accept the whole batch and resolve each item on its own. One malformed item fails its own row with the standard error envelope, in the position it was sent, and never the whole batch:

curl -X POST "https://api.cardog.app/v2/vin/batch" \
  -H "x-api-key: $CARDOG_API_KEY" \
  -H "Cardog-Version: 2026-10-26" \
  -H "content-type: application/json" \
  -d '{"vins":["2T3R1RFV7MW180266","NOTAVIN"]}'

Example

2 keys
"response": {
"results": [
0: {3 items},
1: {3 items}
],
"meta": {
"requested": 2,
"decoded": 1,
"failed": 1
}
}

results preserves request order and meta carries the counts. A batch takes up to 1,000 VINs and is metered per VIN decoded. Failed rows cost nothing. See Credits.