{"openapi":"3.1.0","info":{"title":"Dealer Nebula API","version":"1.0.0","summary":"Read-only JSON access to a dealership's live inventory.","description":"Read your dealership's live inventory from your own website, dashboard or tool. Every call is a `GET`, every answer is JSON, and nothing here can change anything.\n\n**Server side only.** The API never sends CORS headers, so a browser page cannot call it, and a key must never be put in a web page. Call it from your server, then cache.\n\n## Authentication\n\nAn owner or admin creates a key on the Developers tab at https://app.dealernebula.com (after a password sign-in in the last 15 minutes). Send it on every request:\n\n```\nAuthorization: Bearer dnp_...\n```\n\nA key reads one store, never returns what you paid for a vehicle (no cost, gross or invoice fields, on any route), and expires after 90 or 365 days. A store can hold 10 live keys. A key stops for good when its creator is turned off, leaves the store, loses the owner or admin role, changes their password or signs out everywhere. It pauses (403) while the store's AI switch is off or billing is unpaid.\n\n## Requests\n\n- Only `GET` and `HEAD` are accepted (anything else is `405` with `Allow: GET, HEAD`). `HEAD` runs the full request and counts against the limits.\n- A trailing slash is a `404` (`/vehicles/` is not `/vehicles`).\n- Query parameters must be known and given once: an unknown or repeated parameter is a `400` that names it. Do not add cache-busting parameters such as `?_=123`.\n- Numbers are plain (`limit=50`), booleans are `true` or `false`, and a list is comma-separated (`dealership_public_ids=ab12cd34,ef56gh78`).\n\n## Dealership ids\n\nA dealership is identified by an 8-character `dealership_public_id` (lowercase letters and digits). `GET /dealerships` calls the same value `public_id`; every other route calls it `dealership_public_id`.\n\n## Pagination\n\n`GET /vehicles` returns up to `limit` rows (1 to 200, default 50) and a `next_cursor`. Pass it back as `cursor` with the same filters and sort to get the next page; `next_cursor` is `null` on the last page. The cursor is opaque (do not parse or build one). Pages are offsets into the current list, so if a feed refresh lands between two page requests a unit can be skipped or repeated: take the whole list in one quick run, and de-duplicate on `vehicle_ref`. Rows tie-break on `vehicle_ref`, so a sort is stable within one feed. There is no sort direction parameter (each sort name has its direction) and no `updated_since` filter.\n\n## Freshness\n\nInventory arrives from the dealership's inventory provider, about once a day. Every inventory answer carries `inventory_as_of`: for each dealership, the time of the last processed feed and a `stale` flag. A feed is `ok` when a file arrived in the last 26 hours and none failed in the last 7 days, `stale` after 26 hours without a file, `problem` after 72 hours or when a file failed in the last 7 days, and `setting_up` before the first file.\n\n## Errors\n\nOur errors are JSON: `{\"error\": {\"code\": \"bad_input\", \"message\": \"...\"}}`. Match on `code`, not the message.\n\n| Status | `code` | Meaning |\n|---|---|---|\n| 400 | `bad_input` | An unknown, repeated or invalid query parameter (the message names the parameter), or a request the data can't answer. Don't retry unchanged. |\n| 401 | `unauthorized` | The key is missing, malformed, unknown, revoked, expired or its creator no longer qualifies. One message for every reason, with a `WWW-Authenticate: Bearer` header. Don't retry. |\n| 403 | `no_access` | The key can't read any dealership right now (for example the store's AI switch is off). An owner or admin can check at app.dealernebula.com. |\n| 403 | `not_entitled` | Dealer Nebula isn't active for the dealership (billing). |\n| 404 | `not_found` | Unknown route, or a vehicle that isn't in the key's store (another store's id reads the same as a missing one). |\n| 405 | `method_not_allowed` | Not `GET` or `HEAD`. |\n| 429 | `rate_limited` | Over a limit. Wait `Retry-After` seconds. |\n| 503 | `unavailable` | Try again after `Retry-After` seconds (5 or 30). |\n\n**There are two kinds of 429.** Ours is JSON with `code: rate_limited` and a `Retry-After` header. The hosting platform's edge limit (per IP address, below) answers a `429` whose body is **not** our JSON, so check the status before parsing, and treat a non-JSON 429 as the same advice: slow down and wait.\n\n## Rate limits\n\n- **Per key:** 60 calls a minute and 2,000 a day.\n- **Per person:** 60 calls a minute across all of the key creator's keys and AI apps (the key shares that allowance with the creator's own Claude, ChatGPT or Gemini use).\n- **Per store:** about 10,000 calls a day across everything.\n- **Per IP address, at the edge:** 60 requests a minute on `/api/v1` (fixed window), then the platform's own `429`.\n- **Rejected keys:** an address that sends many rejected keys is limited (`429`, JSON, `Retry-After`) before the key is even read.\n\nThere are no `X-RateLimit-*` headers; only `Retry-After` on our own `429` and `503`. Never call the API once per site visitor: sync on a schedule, keep the result on your server, and serve visitors from your copy. A nightly or hourly sync of `GET /vehicles` fits comfortably in the daily budget.\n\n## Caching\n\nEvery data answer is `Cache-Control: no-store` with no `ETag` or `Last-Modified`, so the API does not help you cache; do it yourself. Answers are `application/json` with `X-Content-Type-Options: nosniff`.\n\n## Text fields\n\nText that a dealership typed (`trim`, `features`, `description`, `listing_url`, `exterior_color` and so on) is untrusted free text. It is cleaned of control characters, and `![` and `](` are altered so it can't make a Markdown link or image, but it can contain anything else: escape it before putting it in HTML.\n\n## Gotchas\n\n- `odometer` is a formatted string such as `\"12,345 mi\"` (unit `mi`, `km` or `hours`), not a number.\n- `price` is a number in US dollars, or `null` (a feed may also send `0`): treat both as \"no advertised price\".\n- List rows carry `photo_count` but no photo URLs, features or description. Those are on `GET /vehicles/{id}` (at most 10 photos and 30 features).\n- `vehicle_ref` is the stable id for a unit, and the only one for a unit with no VIN.\n- `condition` is `new` or `used`; a certified pre-owned unit is `used` with `certified: true`.\n- Units that leave the feed are kept. `GET /vehicles/{id}` returns one by VIN, stock number or `vehicle_ref` however long ago it left (`listing_status` `left_feed_recently`, with `removed_at`); `GET /vehicles?listing_status=left_feed_recently` lists the ones that left in the last 90 days.\n\nResponses can gain fields over time. Ignore fields you don't know.","contact":{"name":"Dealer Nebula support","email":"support@dealernebula.com"}},"servers":[{"url":"https://mcp.dealernebula.com/api/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Account","description":"Who the key is and what it can read."},{"name":"Inventory","description":"Vehicles and inventory totals for the key's store."},{"name":"Feed","description":"How current the inventory is, and the ads catalogs it feeds."},{"name":"Documentation","description":"This file."}],"paths":{"/me":{"get":{"operationId":"getMe","tags":["Account"],"summary":"The key and the store it reads","description":"A connectivity check: the key's name, display prefix and dates, the account id, and the dealerships the key can read. Takes no parameters.","responses":{"200":{"description":"The key's details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"},"example":{"key":{"name":"Sales dashboard","prefix":"dnp_k3j9x2","created_at":"2026-10-14T12:00:00Z","expires_at":"2027-10-14T12:00:00Z"},"account":{"id":"dnu_example0001"},"dealerships":[{"dealership_public_id":"ab12cd34","name":"Example Motors"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"405":{"$ref":"#/components/responses/MethodNotAllowed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/dealerships":{"get":{"operationId":"listDealerships","tags":["Account"],"summary":"The key's dealerships, with counts and feed state","description":"Location, website, brands, inventory provider, in-stock counts and feed state for each dealership the key reads. Takes no parameters. The `public_id` here is the `dealership_public_id` of every other route.","responses":{"200":{"description":"The dealerships.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealershipList"},"example":{"dealerships":[{"public_id":"ab12cd34","name":"Example Motors","city":"Springfield","state":"IL","website":"https://www.example-motors.test/","brands":["Jeep","Ram"],"inventory_providers":["Example Provider"],"in_stock":144,"new":60,"used":84,"certified":12,"last_inventory_update_at":"2026-11-01T09:15:00.000Z","last_file_received_at":"2026-11-01T09:10:00.000Z","feed_state":"ok","pct_units_with_feed_in_stock_date":100,"partner_connections":[{"provider":"CarGurus","active":true,"shared_with_ai":true,"last_sync_at":"2026-11-01T06:00:00.000Z","last_sync_status":"ok"}],"coverage":"Advertised inventory from Example Provider; units not in the feed (recon, in transit, wholesale-bound, unpublished) are not counted."}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"405":{"$ref":"#/components/responses/MethodNotAllowed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/vehicles":{"get":{"operationId":"listVehicles","tags":["Inventory"],"summary":"Search and page through vehicles","description":"Vehicles in stock, by default, sorted by days in stock (oldest first). Narrow with the filters, change the order with `sort`, and page with `limit` and `cursor`. Each filter is optional and they combine with AND. Rows are the `detailed` shape unless `response_format=concise`. The response shows the total number of matches and the page.\n\nFor photos, features, the dealer description and price history, call `GET /vehicles/{id}` per unit.","parameters":[{"$ref":"#/components/parameters/dealership_public_ids"},{"$ref":"#/components/parameters/listing_status"},{"$ref":"#/components/parameters/condition"},{"$ref":"#/components/parameters/vehicle_type"},{"$ref":"#/components/parameters/make"},{"$ref":"#/components/parameters/model"},{"$ref":"#/components/parameters/trim"},{"$ref":"#/components/parameters/body_style"},{"$ref":"#/components/parameters/color"},{"$ref":"#/components/parameters/fuel_type"},{"$ref":"#/components/parameters/drivetrain"},{"$ref":"#/components/parameters/engine"},{"$ref":"#/components/parameters/transmission"},{"$ref":"#/components/parameters/year_min"},{"$ref":"#/components/parameters/year_max"},{"$ref":"#/components/parameters/price_min"},{"$ref":"#/components/parameters/price_max"},{"$ref":"#/components/parameters/odometer_max"},{"$ref":"#/components/parameters/days_in_stock_min"},{"$ref":"#/components/parameters/days_in_stock_max"},{"$ref":"#/components/parameters/has_photos"},{"$ref":"#/components/parameters/one_owner"},{"$ref":"#/components/parameters/no_accidents"},{"$ref":"#/components/parameters/text"},{"name":"sort","in":"query","required":false,"description":"Order of the rows. Each name carries its direction; there is no separate direction parameter. Units with no advertised price sort last for both price sorts. Ties break on `vehicle_ref`.","schema":{"type":"string","enum":["days_in_stock_desc","price_asc","price_desc","year_desc","odometer_asc","newest_arrivals","price_changes_desc"],"default":"days_in_stock_desc"}},{"name":"limit","in":"query","required":false,"description":"Rows per page.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"description":"The `next_cursor` of the previous page, unchanged. Use it with the same filters and sort.","schema":{"type":"string","maxLength":200}},{"name":"response_format","in":"query","required":false,"description":"`concise` leaves out the `body_style` to `history_source` block of fields (see `VehicleDetailedFields`); `detailed` includes it.","schema":{"type":"string","enum":["concise","detailed"],"default":"detailed"}}],"responses":{"200":{"description":"One page of vehicles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleList"},"example":{"total_matches":144,"returned":1,"next_cursor":"eyJvIjoxfQ","inventory_as_of":[{"dealership_public_id":"ab12cd34","inventory_as_of":"2026-11-01T09:15:00.000Z","stale":false}],"vehicles":[{"dealership_public_id":"ab12cd34","vin":"1C4HJXDG0PW000001","stock_number":"J101","vehicle_ref":"v_0a1b2c3d4e","year":2023,"make":"Jeep","model":"Wrangler","trim":"Sahara","condition":"used","certified":false,"price":38995,"msrp":null,"odometer":"12,345 mi","days_in_stock":61,"days_in_stock_basis":"feed_date","exterior_color":"Bright White","photo_count":24,"sale_status":"available","listing_status":"in_stock","listing_url":"https://www.example-motors.test/inventory/J101","body_style":"SUV","drivetrain":"4WD","engine":"3.6L V6","transmission":"8-Speed Automatic","interior_color":"Black","retail_price":null,"last_price_change_at":"2026-10-20T14:00:00.000Z","previous_price":39995,"history_one_owner":true,"history_accidents":false,"history_source":"per the inventory feed"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"405":{"$ref":"#/components/responses/MethodNotAllowed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/vehicles/{id}":{"get":{"operationId":"getVehicle","tags":["Inventory"],"summary":"One vehicle, in full","description":"The full record for one unit: specs, up to 30 features, up to 10 photo URLs, price history, the dealership's listing status, history flags from the feed and, where the store has them, the latest CarGurus and Cars.com figures. The dealer description is included only with `include_description=true`.\n\n`{id}` is one of: the `vehicle_ref` (`v_` and 10 hex characters), a full 17-character VIN, or a stock number (up to 40 characters, URL-encoded). A 17-character value that matches no VIN is then tried as a stock number. A unit that left the feed is still returned, however long ago it left, with `removed_at` and a `status_note`. A unit that isn't in the key's store is a `404`.\n\nIf an id matches more than one unit (the same VIN listed twice), the answer is `{\"status\": \"multiple_matches\", \"candidates\": [...]}` with up to 10 list-style rows instead of `vehicle` (a row for a unit that left the feed also has `last_seen_at`, `removed_at` and `days_in_stock_at_removal`); repeat the call with the `stock_number` of the one you want. These rows leave out `vehicle_ref` for a unit that has a VIN.","parameters":[{"name":"id","in":"path","required":true,"description":"A `vehicle_ref`, a full VIN or a stock number.","schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"include_description","in":"query","required":false,"description":"Include the dealer's description (up to 2,000 characters).","schema":{"type":"boolean","default":false}},{"name":"include_price_history","in":"query","required":false,"description":"Include `price_history` (the newest 20 events).","schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"The vehicle.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleResponse"},"example":{"vehicle":{"dealership_public_id":"ab12cd34","vin":"1C4HJXDG0PW000001","stock_number":"J101","vehicle_ref":"v_0a1b2c3d4e","year":2023,"make":"Jeep","model":"Wrangler","trim":"Sahara","condition":"used","certified":false,"price":38995,"msrp":null,"odometer":"12,345 mi","days_in_stock":61,"days_in_stock_basis":"feed_date","exterior_color":"Bright White","photo_count":24,"sale_status":"available","listing_status":"in_stock","listing_url":"https://www.example-motors.test/inventory/J101","dealership_name":"Example Motors","series":null,"model_number":null,"body_style":"SUV","vehicle_type":"automotive","retail_price":null,"currency":"USD","fuel_type":"gasoline","drivetrain":"4WD","engine":"3.6L V6","transmission":"8-Speed Automatic","interior_color":"Black","displacement_cc":null,"powersports_category":null,"features":["Heated seats","Navigation"],"photos":["https://images.example-motors.test/J101/1.jpg"],"history":{"one_owner":true,"accidents_reported":false,"source":"per the inventory feed"},"date_in_stock":"2026-08-31","first_seen_at":"2026-09-01T09:00:00.000Z","last_seen_at":"2026-11-01T09:15:00.000Z","removed_at":null,"price_history":[{"from":39995,"to":38995,"at":"2026-10-20T14:00:00.000Z"}],"marketplaces":{"cargurus":{"window":"2026-10-04 to 2026-11-01","search_views":420,"detail_views":61,"leads":3,"synced":"2026-11-01"},"carscom":null}},"inventory_as_of":[{"dealership_public_id":"ab12cd34","inventory_as_of":"2026-11-01T09:15:00.000Z","stale":false}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"405":{"$ref":"#/components/responses/MethodNotAllowed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/inventory/summary":{"get":{"operationId":"getInventorySummary","tags":["Inventory"],"summary":"Totals and groups for the matching inventory","description":"Counts, advertised price totals and averages, and days in stock for the vehicles that match the filters (the same filters as `GET /vehicles`), optionally broken into up to 50 groups. Prices are advertised prices only.","parameters":[{"$ref":"#/components/parameters/dealership_public_ids"},{"$ref":"#/components/parameters/listing_status"},{"$ref":"#/components/parameters/condition"},{"$ref":"#/components/parameters/vehicle_type"},{"$ref":"#/components/parameters/make"},{"$ref":"#/components/parameters/model"},{"$ref":"#/components/parameters/trim"},{"$ref":"#/components/parameters/body_style"},{"$ref":"#/components/parameters/color"},{"$ref":"#/components/parameters/fuel_type"},{"$ref":"#/components/parameters/drivetrain"},{"$ref":"#/components/parameters/engine"},{"$ref":"#/components/parameters/transmission"},{"$ref":"#/components/parameters/year_min"},{"$ref":"#/components/parameters/year_max"},{"$ref":"#/components/parameters/price_min"},{"$ref":"#/components/parameters/price_max"},{"$ref":"#/components/parameters/odometer_max"},{"$ref":"#/components/parameters/days_in_stock_min"},{"$ref":"#/components/parameters/days_in_stock_max"},{"$ref":"#/components/parameters/has_photos"},{"$ref":"#/components/parameters/one_owner"},{"$ref":"#/components/parameters/no_accidents"},{"$ref":"#/components/parameters/text"},{"name":"group_by","in":"query","required":false,"description":"Break the totals into groups. `none` (the default) returns only `totals` and an empty `groups`. `age_bucket` groups are `0-30`, `31-60`, `61-90`, `91-120` and `120+` days; `price_band` groups run from `under $10k` up in steps, plus `no price`. Groups are sorted by count, except those two, which run in order.","schema":{"type":"string","enum":["none","make","model","body_style","condition","vehicle_type","age_bucket","price_band","dealership"],"default":"none"}}],"responses":{"200":{"description":"The totals and groups.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventorySummary"},"example":{"totals":{"count":144,"priced":143,"total_list_value":5120450,"avg_price":35807.34,"median_price":33995,"avg_days_in_stock":48.2,"avg_odometer":21034.5},"group_by":"condition","groups":[{"key":"used","count":84,"priced":84,"total_list_value":2603300,"avg_price":30991.67,"median_price":29995,"avg_days_in_stock":55.1,"avg_odometer":35120.4},{"key":"new","count":60,"priced":59,"total_list_value":2517150,"avg_price":42663.56,"median_price":41995,"avg_days_in_stock":38.4,"avg_odometer":14.2}],"listing_status":"in_stock","inventory_as_of":[{"dealership_public_id":"ab12cd34","inventory_as_of":"2026-11-01T09:15:00.000Z","stale":false}],"notes":["total_list_value and prices are advertised prices, not cost."]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"405":{"$ref":"#/components/responses/MethodNotAllowed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/feed/status":{"get":{"operationId":"getFeedStatus","tags":["Feed"],"summary":"Is the inventory feed current, and what reached the ads catalogs","description":"Per dealership, when the inventory feed last updated, the last file received, problem files in the last 7 days and the feed state; and per ads catalog (Google, Meta), whether it is active, when the platform last fetched it, how many vehicles it delivered and how many the feed held back and why. Reads stored status only. Google or Meta may also reject units for their own reasons.","parameters":[{"$ref":"#/components/parameters/dealership_public_ids"}],"responses":{"200":{"description":"The feed and catalog status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedStatus"},"example":{"dealerships":[{"dealership_public_id":"ab12cd34","name":"Example Motors","feed_state":"ok","last_inventory_update_at":"2026-11-01T09:15:00.000Z","last_file_received_at":"2026-11-01T09:10:00.000Z","problem_files_7d":0,"in_stock":144}],"catalogs":[{"dealership_public_id":"ab12cd34","platform":"Google","active":true,"last_fetched_at":"2026-11-01T10:00:00.000Z","hours_since_fetch":3,"last_fetch_status":"ok","items_delivered":141,"held_back":[{"reason":"no_photo","count":3,"explanation":"no photo (the catalog requires one)"}],"held_back_total":3,"modified":[]}],"inventory_as_of":[{"dealership_public_id":"ab12cd34","inventory_as_of":"2026-11-01T09:15:00.000Z","stale":false}],"notes":["Google or Meta may also reject units for their own reasons; check Merchant Center or Commerce Manager."]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"405":{"$ref":"#/components/responses/MethodNotAllowed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/openapi.json":{"get":{"operationId":"getOpenApi","tags":["Documentation"],"summary":"This OpenAPI document","description":"This file, as JSON. Public: no key needed.","security":[],"responses":{"200":{"description":"The OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"dnp_ API key","description":"An API key created by a store owner or admin on the Developers tab at https://app.dealernebula.com. Send `Authorization: Bearer dnp_...`."}},"parameters":{"dealership_public_ids":{"name":"dealership_public_ids","in":"query","required":false,"description":"Limit to these dealerships (their `public_id`s from `GET /dealerships`), comma-separated, at most 10. Default: every dealership the key can read. An id the key can't read is a `404`.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","pattern":"^[0-9a-z]{8}$"},"minItems":1,"maxItems":10}},"listing_status":{"name":"listing_status","in":"query","required":false,"description":"`in_stock` (the default) is what is in the latest feed. `missing_from_latest_feed` is absent from the last file. `left_feed_recently` lists the units that left the feed in the last 90 days (usually sold or transferred; not a confirmed sale); a unit that left earlier is still returned by `GET /vehicles/{id}`.","schema":{"type":"string","enum":["in_stock","missing_from_latest_feed","left_feed_recently"],"default":"in_stock"}},"condition":{"name":"condition","in":"query","required":false,"description":"`new`; `used` (includes certified pre-owned); or `certified` (certified pre-owned only).","schema":{"type":"string","enum":["new","used","certified"]}},"vehicle_type":{"name":"vehicle_type","in":"query","required":false,"description":"Exact value, one of: automotive, motorcycle, atv, utv, snowmobile, personal_watercraft, boat, rv, trailer, heavy_truck, equipment, other.","schema":{"type":"string","maxLength":30}},"make":{"name":"make","in":"query","required":false,"description":"Matches the start of the make, ignoring case and punctuation. Common short names work: `chevy`, `vw`, `mercedes`.","schema":{"type":"string","maxLength":40}},"model":{"name":"model","in":"query","required":false,"description":"Matches the start of the model, ignoring case and punctuation: `F150` matches `F-150` and `F-150 Lightning`. A leading make works (`Ram 1500` is make Ram, model 1500). When no unit has the full name, its leading words match (`Wrangler Unlimited` matches `Wrangler`).","schema":{"type":"string","maxLength":60}},"trim":{"name":"trim","in":"query","required":false,"description":"Matches anywhere in the trim.","schema":{"type":"string","maxLength":60}},"body_style":{"name":"body_style","in":"query","required":false,"description":"`suv`, `pickup` (or `truck`), `van`, `minivan`, `chassis` (chassis cabs and cutaways), `sedan`, `coupe` and similar words match by class and also by the feed's text. Other words match the feed's text (pickups are stored by cab, such as `Crew Cab`).","schema":{"type":"string","maxLength":40}},"color":{"name":"color","in":"query","required":false,"description":"Matches anywhere in the exterior color.","schema":{"type":"string","maxLength":30}},"fuel_type":{"name":"fuel_type","in":"query","required":false,"description":"`gasoline`, `diesel`, `hybrid` (also matches plug-in hybrids), `plug-in hybrid` (or `phev`), `electric` (battery-electric only). `diesel` also matches a unit whose engine text says diesel (or a Ram or Ford 6.7L) that has no fuel type or is fed as gasoline, and `gasoline` leaves those out.","schema":{"type":"string","maxLength":20}},"drivetrain":{"name":"drivetrain","in":"query","required":false,"description":"From the dealer-entered drivetrain text (unconfirmed). Units with no drivetrain text are left out.","schema":{"type":"string","enum":["awd","4wd","fwd","rwd","awd_or_4wd"]}},"engine":{"name":"engine","in":"query","required":false,"description":"Matches anywhere in the dealer-entered engine text (unconfirmed), such as `V8` or `6.7`.","schema":{"type":"string","maxLength":40}},"transmission":{"name":"transmission","in":"query","required":false,"description":"Matches anywhere in the dealer-entered transmission text (unconfirmed), such as `manual`.","schema":{"type":"string","maxLength":40}},"year_min":{"name":"year_min","in":"query","required":false,"description":"Model year, inclusive.","schema":{"type":"integer","minimum":1900,"maximum":2100}},"year_max":{"name":"year_max","in":"query","required":false,"description":"Model year, inclusive.","schema":{"type":"integer","minimum":1900,"maximum":2100}},"price_min":{"name":"price_min","in":"query","required":false,"description":"Advertised price in US dollars, inclusive. Units with no advertised price are left out.","schema":{"type":"number","minimum":0}},"price_max":{"name":"price_max","in":"query","required":false,"description":"Advertised price in US dollars, inclusive. Units with no advertised price are left out.","schema":{"type":"number","minimum":0}},"odometer_max":{"name":"odometer_max","in":"query","required":false,"description":"Inclusive, in the unit's own odometer unit (miles for cars). Units with no odometer are left out.","schema":{"type":"number","minimum":0}},"days_in_stock_min":{"name":"days_in_stock_min","in":"query","required":false,"description":"Inclusive: `60` means 60 days or more.","schema":{"type":"integer","minimum":0,"maximum":3650}},"days_in_stock_max":{"name":"days_in_stock_max","in":"query","required":false,"description":"Inclusive.","schema":{"type":"integer","minimum":0,"maximum":3650}},"has_photos":{"name":"has_photos","in":"query","required":false,"description":"`true`: at least one photo. `false`: none.","schema":{"type":"boolean"}},"one_owner":{"name":"one_owner","in":"query","required":false,"description":"`true`: only units the inventory feed flags as one-owner.","schema":{"type":"boolean"}},"no_accidents":{"name":"no_accidents","in":"query","required":false,"description":"`true`: only units the inventory feed flags as having no accidents reported.","schema":{"type":"boolean"}},"text":{"name":"text","in":"query","required":false,"description":"A full or partial VIN (6 or more characters including a digit), a stock number, or keywords (all must match), each matched at the start of a word of year, make, model, trim, color, body style, drivetrain, engine or fuel type: `red` does not match `Laredo`, `f150` matches `F-150`, `4x4` matches `4WD` and `grey` matches `Gray`. `suv`, `truck`, `van` and `minivan` match the body class, `new`, `used` and `certified` the condition, and `diesel`, `hybrid` and `electric` the fuel. A VIN-like word that no unit's VIN or stock number has (such as `2500HD`) is read as a keyword.","schema":{"type":"string","maxLength":80}}},"responses":{"BadRequest":{"description":"`bad_input`: an unknown, repeated or invalid query parameter (the message names the parameter, never its value), or a request the data can't answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"bad_input","message":"Unknown query parameter foo."}}}}},"Unauthorized":{"description":"`unauthorized`: the key is missing, malformed, unknown, revoked, expired or its creator no longer qualifies. One message for every reason. Sent with `WWW-Authenticate: Bearer realm=\"Dealer Nebula API\"`.","headers":{"WWW-Authenticate":{"description":"`Bearer realm=\"Dealer Nebula API\"`, with `error=\"invalid_token\"` when a key was sent.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"API key rejected."}}}}},"Forbidden":{"description":"`no_access` (the key can't read any dealership right now, for example the store's AI switch is off) or `not_entitled` (Dealer Nebula isn't active for the dealership).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"no_access","message":"This API key can't read any dealership right now. Your dealership's owner or admin can check its settings at app.dealernebula.com."}}}}},"NotFound":{"description":"`not_found`: an unknown route, or a vehicle or dealership that isn't in the key's store (another store's id reads the same as a missing one).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Not found."}}}}},"MethodNotAllowed":{"description":"`method_not_allowed`: only `GET` and `HEAD` are accepted.","headers":{"Allow":{"description":"`GET, HEAD`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Use GET."}}}}},"RateLimited":{"description":"Over a limit. There are two kinds of 429. Ours is JSON (`code: rate_limited`) with `Retry-After`. The hosting platform's per-IP edge limit (60 requests a minute) answers a 429 whose body is NOT our JSON, and carries no `Retry-After` you can rely on: check the status before parsing the body, and wait a minute.","headers":{"Retry-After":{"description":"Seconds to wait. Sent with our JSON 429, not reliably with the edge's.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests for this API key. Try again in 30 seconds."}}},"text/plain":{"schema":{"type":"string"},"description":"The edge limit's body. Do not parse it as JSON."}}},"Unavailable":{"description":"`unavailable`: Dealer Nebula couldn't complete the request. Retry after `Retry-After` seconds (5 or 30), backing off if it repeats.","headers":{"Retry-After":{"description":"Seconds to wait (5 or 30).","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unavailable","message":"Dealer Nebula couldn't complete this request. Try again shortly."}}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["bad_input","unauthorized","no_access","not_entitled","not_found","method_not_allowed","rate_limited","unavailable"],"description":"Stable, machine-readable. Match on this."},"message":{"type":"string","description":"For people. The wording can change."}}}}},"Timestamp":{"type":["string","null"],"format":"date-time","description":"ISO 8601 in UTC with milliseconds, such as `2026-11-01T09:15:00.000Z`; `null` when unknown."},"DealershipPublicId":{"type":"string","pattern":"^[0-9a-z]{8}$","description":"The dealership's 8-character public id."},"InventoryAsOf":{"type":"array","description":"Freshness, one entry per dealership in the answer.","items":{"type":"object","required":["dealership_public_id","inventory_as_of","stale"],"properties":{"dealership_public_id":{"$ref":"#/components/schemas/DealershipPublicId"},"inventory_as_of":{"$ref":"#/components/schemas/Timestamp","description":"When the last feed was processed; `null` before the first."},"stale":{"type":"boolean","description":"`true` unless the feed state is `ok` (see the Freshness section)."}}}},"FeedState":{"type":"string","enum":["ok","stale","problem","setting_up"],"description":"`ok`: a file arrived in the last 26 hours and none failed in 7 days. `stale`: no file for over 26 hours. `problem`: a file failed in the last 7 days, or none arrived for 72 hours or more. `setting_up`: no file received yet."},"Me":{"type":"object","required":["key","account","dealerships"],"properties":{"key":{"type":"object","properties":{"name":{"type":["string","null"],"description":"The name given when the key was created."},"prefix":{"type":["string","null"],"description":"The first characters of the key (`dnp_` and 6 more), safe to show."},"created_at":{"$ref":"#/components/schemas/Timestamp"},"expires_at":{"$ref":"#/components/schemas/Timestamp"}}},"account":{"type":"object","properties":{"id":{"type":["string","null"],"description":"The key creator's account id."}}},"dealerships":{"type":"array","items":{"type":"object","properties":{"dealership_public_id":{"$ref":"#/components/schemas/DealershipPublicId"},"name":{"type":"string"}}}}}},"DealershipList":{"type":"object","required":["dealerships"],"properties":{"dealerships":{"type":"array","items":{"$ref":"#/components/schemas/Dealership"}}}},"Dealership":{"type":"object","properties":{"public_id":{"$ref":"#/components/schemas/DealershipPublicId","description":"Called `dealership_public_id` everywhere else."},"name":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"website":{"type":["string","null"],"format":"uri","description":"https URL, or `null`."},"brands":{"type":"array","items":{"type":"string"},"description":"Franchise brands."},"inventory_providers":{"type":"array","items":{"type":"string"},"description":"The inventory provider(s) the feed comes from."},"in_stock":{"type":"integer","description":"Units in the latest feed."},"new":{"type":"integer","description":"New units in stock."},"used":{"type":"integer","description":"Used units in stock, certified ones included."},"certified":{"type":"integer","description":"Certified pre-owned units in stock (a subset of `used`)."},"last_inventory_update_at":{"$ref":"#/components/schemas/Timestamp","description":"When the last feed was processed."},"last_file_received_at":{"$ref":"#/components/schemas/Timestamp","description":"When the last file arrived. Later than `last_inventory_update_at` means a file hasn't been processed yet."},"feed_state":{"$ref":"#/components/schemas/FeedState"},"pct_units_with_feed_in_stock_date":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"Percent of in-stock units whose feed supplies its own in-stock date. The rest count days in stock from when Dealer Nebula first saw them (`days_in_stock_basis` `first_seen`)."},"partner_connections":{"type":"array","description":"CarGurus and Cars.com connections.","items":{"type":"object","properties":{"provider":{"type":"string","enum":["CarGurus","Cars.com"]},"active":{"type":["boolean","null"]},"shared_with_ai":{"type":["boolean","null"]},"last_sync_at":{"$ref":"#/components/schemas/Timestamp"},"last_sync_status":{"type":["string","null"]}}}},"coverage":{"type":"string","description":"A sentence on what the counts include."}}},"VehicleList":{"type":"object","required":["total_matches","returned","next_cursor","inventory_as_of","vehicles"],"properties":{"total_matches":{"type":"integer","description":"How many vehicles match the filters, across all pages."},"returned":{"type":"integer","description":"Rows on this page."},"next_cursor":{"type":["string","null"],"description":"Pass as `cursor` for the next page. `null` on the last page."},"inventory_as_of":{"$ref":"#/components/schemas/InventoryAsOf"},"vehicles":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Vehicle"},{"$ref":"#/components/schemas/VehicleDetailedFields"}]},"description":"Rows of `Vehicle`; with `response_format=detailed` (the default) they also carry the `VehicleDetailedFields`."}}},"Vehicle":{"type":"object","description":"A list row (also the base of the full record).","properties":{"dealership_public_id":{"$ref":"#/components/schemas/DealershipPublicId"},"vin":{"type":["string","null"],"description":"The VIN. `null` for units without one (some powersports, trailers)."},"stock_number":{"type":["string","null"],"description":"The dealership's stock number."},"vehicle_ref":{"type":"string","pattern":"^v_[0-9a-f]{10}$","description":"Dealer Nebula's stable id for the unit. Always present on list rows and the full record. Use it in `GET /vehicles/{id}`."},"year":{"type":["integer","null"]},"make":{"type":["string","null"]},"model":{"type":["string","null"]},"trim":{"type":["string","null"]},"condition":{"type":"string","enum":["new","used"],"description":"A certified pre-owned unit is `used` with `certified: true`."},"certified":{"type":"boolean","description":"Certified pre-owned."},"price":{"type":["number","null"],"description":"Advertised price in US dollars, no formatting. `null` (or `0`) means no advertised price."},"msrp":{"type":["number","null"],"description":"MSRP in US dollars when the feed has it."},"odometer":{"type":["string","null"],"description":"A formatted STRING, not a number: `\"12,345 mi\"`. The unit is `mi`, `km` or `hours`. `null` when the feed has none."},"days_in_stock":{"type":["integer","null"],"description":"Whole days in stock. For a unit that left the feed, the days up to its removal."},"days_in_stock_basis":{"type":"string","enum":["feed_date","first_seen"],"description":"`feed_date`: counted from the in-stock date in the dealership's feed. `first_seen`: counted from the day Dealer Nebula first saw the unit."},"exterior_color":{"type":["string","null"]},"photo_count":{"type":"integer","minimum":0,"description":"How many photos the listing has. The URLs are only on `GET /vehicles/{id}`."},"sale_status":{"type":["string","null"],"enum":["available","deal_pending","sold",null],"description":"As the feed reports it. A unit shown `sold` may still be in the feed until the next file."},"listing_status":{"type":"string","enum":["in_stock","missing_from_latest_feed","left_feed_recently"],"description":"`in_stock`: in the latest feed. `missing_from_latest_feed`: not in the last file (may be back in the next). `left_feed_recently`: no longer in the feed (usually sold or transferred; not a confirmed sale). In a list it left in the last 90 days; from `GET /vehicles/{id}` it may have left at any time (see `removed_at`)."},"listing_url":{"type":["string","null"],"format":"uri","description":"The vehicle page on the dealership's website (https only), when the feed gives one."}}},"VehicleDetailedFields":{"type":"object","description":"The extra fields on list rows unless `response_format=concise`.","properties":{"body_style":{"type":["string","null"]},"drivetrain":{"type":["string","null"],"description":"Dealer-entered text, such as `4WD`."},"engine":{"type":["string","null"],"description":"Dealer-entered text."},"transmission":{"type":["string","null"],"description":"Dealer-entered text."},"interior_color":{"type":["string","null"]},"retail_price":{"type":["number","null"],"description":"The feed's retail price (often a higher strike-through price), when the feed sends one. It can equal the advertised `price`."},"last_price_change_at":{"$ref":"#/components/schemas/Timestamp"},"previous_price":{"type":["number","null"],"description":"The price before the last change."},"history_one_owner":{"type":["boolean","null"],"description":"Per the inventory feed."},"history_accidents":{"type":["boolean","null"],"description":"`true`: the feed reports accidents. Per the inventory feed."},"history_source":{"type":"string","description":"Always `per the inventory feed`: these flags are the feed's, not a history report."}}},"VehicleResponse":{"oneOf":[{"type":"object","required":["vehicle","inventory_as_of"],"properties":{"vehicle":{"$ref":"#/components/schemas/VehicleFull"},"inventory_as_of":{"$ref":"#/components/schemas/InventoryAsOf"}}},{"type":"object","description":"More than one unit matched the id.","required":["status","candidates"],"properties":{"status":{"type":"string","const":"multiple_matches"},"candidates":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/Vehicle"}}}}]},"VehicleFull":{"description":"The full record: every `Vehicle` field, plus the fields below. Unlike list rows, history is nested (`history`), not flat (`history_*`), and the price change is in `price_history`.","allOf":[{"$ref":"#/components/schemas/Vehicle"},{"type":"object","properties":{"dealership_name":{"type":["string","null"]},"series":{"type":["string","null"]},"model_number":{"type":["string","null"]},"body_style":{"type":["string","null"]},"vehicle_type":{"type":"string","enum":["automotive","motorcycle","atv","utv","snowmobile","personal_watercraft","boat","rv","trailer","heavy_truck","equipment","other"]},"retail_price":{"type":["number","null"]},"currency":{"type":["string","null"],"description":"The price currency, such as `USD`."},"fuel_type":{"type":["string","null"],"enum":["gasoline","diesel","electric","hybrid","plug_in_hybrid","flex_fuel","other",null]},"drivetrain":{"type":["string","null"]},"engine":{"type":["string","null"]},"transmission":{"type":["string","null"]},"interior_color":{"type":["string","null"]},"displacement_cc":{"type":["integer","null"],"description":"Engine displacement for powersports units."},"powersports_category":{"type":["string","null"]},"features":{"type":"array","maxItems":30,"items":{"type":"string"},"description":"The first 30 feature strings from the feed."},"photos":{"type":"array","maxItems":10,"items":{"type":"string","format":"uri"},"description":"Up to 10 https photo URLs, in the dealership's order. `photo_count` can be higher."},"history":{"type":"object","properties":{"one_owner":{"type":["boolean","null"]},"accidents_reported":{"type":["boolean","null"]},"source":{"type":"string","description":"Always `per the inventory feed`."}}},"date_in_stock":{"type":["string","null"],"format":"date","description":"The in-stock date from the feed, `YYYY-MM-DD`."},"first_seen_at":{"$ref":"#/components/schemas/Timestamp","description":"When Dealer Nebula first saw the unit."},"last_seen_at":{"$ref":"#/components/schemas/Timestamp","description":"When the unit was last in a feed."},"removed_at":{"$ref":"#/components/schemas/Timestamp","description":"When it left the feed; `null` while it is listed."},"status_note":{"type":"string","description":"Only for a unit that left the feed: that it is no longer in stock, the date it was last seen (US Central) and its days in stock then."},"price_history":{"type":"array","maxItems":20,"description":"Price changes, newest first, up to 20. Empty with `include_price_history=false`. A first price has `from: null`.","items":{"type":"object","properties":{"from":{"type":["number","null"]},"to":{"type":["number","null"]},"at":{"$ref":"#/components/schemas/Timestamp"}}}},"marketplaces":{"type":"object","description":"The latest CarGurus and Cars.com figures for the unit (a daily sync, not live), or `null` for a marketplace the store hasn't connected or that has no figures for it.","properties":{"cargurus":{"type":["object","null"],"properties":{"window":{"type":"string","description":"`YYYY-MM-DD to YYYY-MM-DD`."},"search_views":{"type":["integer","null"]},"detail_views":{"type":["integer","null"]},"leads":{"type":["integer","null"]},"synced":{"type":["string","null"],"format":"date"}}},"carscom":{"type":["object","null"],"properties":{"window":{"type":"string"},"price_badge":{"type":"string","description":"The Cars.com price badge, or `none`."},"good_cutoff":{"type":["number","null"]},"great_cutoff":{"type":["number","null"]},"listing_price":{"type":["number","null"]},"search_views":{"type":["integer","null"]},"detail_views":{"type":["integer","null"]},"contacts":{"type":["integer","null"]},"days_on_market":{"type":["integer","null"]},"synced":{"type":["string","null"],"format":"date"}}}}},"description":{"type":"object","description":"Only with `include_description=true`, and only when the feed has one.","properties":{"text":{"type":"string","maxLength":2000,"description":"The dealer's text, cleaned and cut at 2,000 characters. Untrusted: escape it."},"source":{"type":"string","description":"Always `dealer-provided text`."}}}}}]},"SummaryMetrics":{"type":"object","properties":{"count":{"type":"integer","description":"Units."},"priced":{"type":"integer","description":"Units with an advertised price; the price figures cover only these."},"total_list_value":{"type":["number","null"],"description":"Sum of advertised prices, US dollars."},"avg_price":{"type":["number","null"]},"median_price":{"type":["number","null"]},"avg_days_in_stock":{"type":["number","null"]},"avg_odometer":{"type":["number","null"],"description":"A plain number (not the string `odometer` is elsewhere) averaged over units that have one; it mixes `mi`, `km` and `hours` units, so use it with a car-only filter such as `vehicle_type=automotive`."}}},"InventorySummary":{"type":"object","required":["totals","group_by","groups","listing_status","inventory_as_of"],"properties":{"totals":{"$ref":"#/components/schemas/SummaryMetrics"},"group_by":{"type":"string","enum":["none","make","model","body_style","condition","vehicle_type","age_bucket","price_band","dealership"]},"groups":{"type":"array","maxItems":50,"description":"Empty when `group_by` is `none`. At most 50.","items":{"allOf":[{"type":"object","properties":{"key":{"type":"string","description":"The group: a make, a body style, `used`, `0-30`, `$10k-20k`, a dealership name and so on. `unknown` when the field is empty."}}},{"$ref":"#/components/schemas/SummaryMetrics"}]}},"listing_status":{"type":"string","enum":["in_stock","missing_from_latest_feed","left_feed_recently"]},"inventory_as_of":{"$ref":"#/components/schemas/InventoryAsOf"},"notes":{"type":"array","items":{"type":"string"}}}},"FeedStatus":{"type":"object","required":["dealerships","catalogs","inventory_as_of"],"properties":{"dealerships":{"type":"array","items":{"type":"object","properties":{"dealership_public_id":{"$ref":"#/components/schemas/DealershipPublicId"},"name":{"type":["string","null"]},"feed_state":{"$ref":"#/components/schemas/FeedState"},"last_inventory_update_at":{"$ref":"#/components/schemas/Timestamp"},"last_file_received_at":{"$ref":"#/components/schemas/Timestamp"},"problem_files_7d":{"type":"integer","description":"Files that failed in the last 7 days."},"in_stock":{"type":"integer"}}}},"catalogs":{"type":"array","description":"One entry per ads catalog (Google, Meta) set up for a dealership. Empty if none is.","items":{"type":"object","properties":{"dealership_public_id":{"$ref":"#/components/schemas/DealershipPublicId"},"platform":{"type":"string","description":"`Google`, `Meta` or `Microsoft`."},"active":{"type":"boolean"},"last_fetched_at":{"$ref":"#/components/schemas/Timestamp","description":"When the platform last fetched the catalog."},"hours_since_fetch":{"type":["integer","null"]},"last_fetch_status":{"type":["string","null"]},"items_delivered":{"type":["integer","null"],"description":"Vehicles in the last fetch."},"held_back":{"type":"array","description":"Units the feed kept out of the catalog, by reason. One unit can have more than one reason.","items":{"type":"object","properties":{"reason":{"type":"string","description":"A code such as `no_photo`, `no_url`, `no_mileage` or `new_without_msrp`."},"count":{"type":"integer"},"explanation":{"type":"string"}}}},"held_back_total":{"type":"integer"},"modified":{"type":"array","description":"Units sent with a change (for example a shortened description).","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer"},"explanation":{"type":"string"}}}}}}},"inventory_as_of":{"$ref":"#/components/schemas/InventoryAsOf"},"notes":{"type":"array","items":{"type":"string"}}}}}}}