Autocasion API: looking up one listing
Getting a vehicle's full detail from this API follows a short path once you have its canonical URL:
- Copy the vehicle's own address from the Autocasion site, the full canonical URL rather than any shortened form of it.
- Send that address as
body.idtoautocasion-listing. - Read the cash price and financing figure as two separate values, and the description, vehicle detail and equipment as three further separate values.
- Check for a seller entry, since one is included only when it is on record for that vehicle.
Sending the canonical URL rather than a numeric identifier matters at the first step: autocasion-listing has no alternate input for a shortened id.
Searching Autocasion listings for one brand, page by page
Working through a brand's current listings on autocasion-search means repeating the same call with one input changing each time:
- Send
body.queryset tobmworaudi, whichever brand you are searching. - Leave
body.pageout on the first call, which reads page 1 by default. - Read the matching total and
next_pageon the response, then send the samebody.queryagain withbody.pageraised by one. - Stop raising
body.pageoncenext_pageshows none follows, or once the clamp status marks the page as past that brand's results.
body.page accepts any whole number from 1 to 100 at each step, so this loop never needs to send a value outside that range even on a brand with far fewer actual listings than 100 pages' worth.
Switching brands without losing your place
Because body.query takes only bmw or audi, moving from one brand to the other is a change to that single input rather than a second input alongside it. The matching total and the current body.page both belong to whichever brand body.query last named, so a page number worth keeping for a BMW search is not necessarily meaningful once the same call is sent again with body.query set to audi. A tracker built on autocasion-search is simplest when it stores the matching total and the last body.page reached separately for each of the two brands, rather than as one shared pair of values.
Combining a search with full listing detail
Finding a vehicle through autocasion-search and then reading its full detail through autocasion-listing takes one extra step in between the two calls:
- Send
body.query, andbody.pageif needed, toautocasion-searchfor the brand you are searching. - Open the vehicle that interests you on the Autocasion site and copy its own canonical URL from there.
- Send that URL as
body.idtoautocasion-listingfor its cash price, financing figure, description, vehicle detail, equipment and seller.
autocasion-search and autocasion-listing share no input name between them: the brand slug that drives the first call plays no part in the second, since body.id alone drives the lookup once a vehicle's own URL is in hand.
Telling a clamped page apart from an out-of-range one
body.page only takes whole numbers from 1 to 100 in the first place, so a number outside that range never reaches the point of searching a brand's results at all. The clamp status is a separate, later signal: it applies to a body.page value that is perfectly in range but runs past the matching results autocasion-search actually has for that brand once the search gets there. Treating a clamped page the same as an out-of-range one loses the difference between a brand search that simply ran out of listings and one sent a page number the input never accepts to begin with.
Autocasion Spain vehicle listings in brief
In Spain, a vehículo de ocasión is a nearly new car with one owner and low mileage, a narrower term than the broader coche de segunda mano used for an older, more worn second-hand car. Autocasión's marketplace spans both ends of that range, since its joint venture with AutoScout24's Spanish unit lists used and new cars and motorbikes together for dealers and financing companies rather than treating ocasión and segunda mano stock as two separate markets.
[
{
"body": {
"query": "bmw",
"page": 1
}
},
{
"body": {
"id": "https://www.autocasion.com/coches-segunda-mano/bmw-serie-1-ocasion/116d-8-ref20399160"
}
}
]{
"body": {
"query": "audi",
"page": 2
}
}Server-side request template
This server-side template shows authentication and request identity using the first operation of this API. Choose the operation for your use case and check its current availability and price on the API page. After a timeout, resend the unchanged request with the same Idempotency-Key.
The gateway request is always POST.
Use a JSON object with the documented path, query, headers and body locations; omit unused locations. input.headers is JSON data for the operation, not browser request headers. Do not put credentials here. Keep body arrays, scalar values and null as documented; omission is different from null.
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autocasion/autocasion-listing' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"id":"https://www.autocasion.com/coches-segunda-mano/bmw-serie-1-ocasion/116d-8-ref20399160"}}'Integration checklist
- The API key is stored in a server-side secret manager and never sent to a browser.
- Each request carries its own Idempotency-Key, kept until the request has a final answer.
- The integration reads ok and error.code and handles each error code as the error table describes.
- An uncertain POST is inspected using its original identity, never blindly repeated with a new one.
- The operation’s current availability and price have been checked on its API page.
Autocasion Vehicle Listings API overview and prices · Read the API reference · Try it in the playground