Skip to content

Overview

Your vehicles on your website. These endpoints give you the vehicles you are selling: the active adverts of your company’s seller profiles on the marketplaces we read. Nothing else is reachable with them, and no filter can reach anyone else’s adverts.

Set up

  1. Make one API key for the website on the API keys page, with only the Website stock integration (integration.stock). Limit it to your web server’s IP address (allowed_ips), so the key works from nowhere else.
  2. Call from your server, never from the browser. Send the key as Authorization: Bearer <key>. Put it in your server’s configuration; a key in a page’s JavaScript can be read by anyone who opens the page.

Build the pages

  • List: GET /vehicles, newest first, 50 a page (limit up to 200, offset; sort by first_seen_at, price, year or mileage_km). Every vehicle class unless you pass category.
  • Filters: build them from GET /filter-values: it lists only the makes, models, fuels and so on that your stock has, with counts, and the year, price and mileage ranges. Pass the visitor’s current filters to it too: each field’s counts follow the other filters, so a dropdown keeps its choices. GET /count gives the number of results for a set of filters.
  • Labels: the class, fuel, gearbox, body, colour, drive, powertrain, emission class and condition are codes (diesel, black), the same on every marketplace. GET /filter-values gives each value’s label in Slovenian, English or Croatian (lang=sl, en, hr); show a vehicle’s values with those labels too.
  • Detail: GET /vehicles/{vehicle_id}. Link to a vehicle by its vehicle_id: it stays the same when you take an advert down and post the car again, so your links keep working. id is the advert’s own id and changes with a repost; the detail takes it too. A sold or withdrawn vehicle answers 404: show “no longer available”.
  • Description: description_html is ready to put on your page: only paragraphs, line breaks, lists and bold or italic text, with no links, images, styles or scripts.
  • Equipment (equipment, on the detail): the advert’s list, by group (Varnost, Udobje, …), in the marketplace’s own words and language; a group with no name is a list the marketplace does not group. The detail also has interior, inspection_valid_until (YYYY-MM), co2_g_km and consumption_l_100km.
  • Photos and videos (images): everything the advert shows, in its order. A video is a YouTube link (youtube.com or youtu.be): embed it as a video, not as an image. The photos are the marketplace’s own image addresses for now; they will move to our servers later, and the field stays the same.
  • Prices: price is the advertised price, discount_price a reduced price anyone can pay, if there is one, and conditional_price one only on a condition (price_condition, most often financing). A null price means the advert has none: price_note says why (call_for_price, negotiate). has_price=true leaves those out.
  • Every field is described under the responses below (open WebsiteVehicleDetail).

Cache on your server

Your stock changes a few times a day, and every answer carries ETag and Cache-Control: private, max-age=300.

  • Keep each answer for five minutes and serve your visitors from that copy.
  • After that, ask again with If-None-Match: <the ETag>: if nothing changed, the answer is an empty 304 Not Modified and you keep your copy.
  • Don’t call us once per visitor: the key’s rate limit (120 calls a minute) is sized for one server, and a busy page would hit it (429, with Retry-After).

Errors

Every error is {"error": {"code", "message", "detail"}}; code is for your code, message is readable.

  • 401: no key, or not a valid one. 403: the key lacks the integration, or the call came from an address the key does not allow.
  • 404 on a vehicle: sold, withdrawn or not yours. Show “no longer available”.
  • 422: a filter value that does not exist (an unknown make names the nearest ones in detail).
  • 429: too many calls; wait Retry-After seconds.

When something is missing

A car you advertise but don’t see here is usually under a seller profile that is not linked to your company yet: tell us which advert, and we link it.