Skip to content

What changed between two moments

GET
/v1/catalog/compare
curl --request GET \
--url 'https://api.avtopodatki.si/v1/catalog/compare?steps=false&sort=change&offset=0&with_total=true' \
--header 'Authorization: Bearer <token>'

The net change of every variant between two updates, or over a period.

Each variant is compared as it stood at the start (from, or period before the end) and at the end (to, or now), so a price that went up and back is no change. An update stands for the moment it finished.

counts and the two averages apply every filter except kind, so tabs per kind can show their numbers while one is open.

Requires the catalog.changes permission.

steps
Steps

true: add every logged change in between to each row.

boolean

true: add every logged change in between to each row.

from
From

Start update id. Excludes period.

Any of:
integer
>= 1

Start update id. Excludes period.

to
To

End update id; default: now.

Any of:
integer
>= 1

End update id; default: now.

period
Period

Instead of from: how far before the end to start, in days, e.g. 7d, 30d, 90d. Default 30d.

Any of:
string

Instead of from: how far before the end to start, in days, e.g. 7d, 30d, 90d. Default 30d.

brand_id
Brand Id

Repeat to match several.

Any of:
Array<integer>

Repeat to match several.

brand
Brand

Brand name, case-insensitive. Repeat to match several.

Any of:
Array<string>

Brand name, case-insensitive. Repeat to match several.

kind
Kind

added, withdrawn, price_up, price_down. Repeatable.

Any of:
Array<string>

added, withdrawn, price_up, price_down. Repeatable.

body_style
Body Style

Body, the market API’s values (suv, …). Repeatable.

Any of:
Array<string>
Allowed values: sedan hatchback wagon suv coupe convertible van minivan pickup microcar panel_van minibus chassis_cab dropside curtainsider box refrigerated tipper hooklift swap_body tractor_unit car_transporter tow_truck crane platform tanker concrete_mixer refuse timber livestock special city_bus intercity_bus coach scooter maxi_scooter naked touring sport enduro motocross supermoto trial cruiser moped minibike quad utv three_wheeler snowmobile ebike kick_scooter other

Body, the market API’s values (suv, …). Repeatable.

fuel_type
Fuel Type

Fuel, the market API’s values (petrol, …). Repeatable.

Any of:
Array<string>
Allowed values: petrol diesel electric hybrid plugin_hybrid lpg cng hydrogen other

Fuel, the market API’s values (petrol, …). Repeatable.

q
Q

Substring of variant, model or brand.

Any of:
string
>= 1 characters <= 80 characters

Substring of variant, model or brand.

price_min
Price Min

On the end price (the start price if withdrawn).

Any of:
integer

On the end price (the start price if withdrawn).

price_max
Price Max

On the same price as price_min.

Any of:
integer

On the same price as price_min.

min_pct
Min Pct

Only price changes of at least this many percent, either way. Added and withdrawn variants are kept.

Any of:
number

Only price changes of at least this many percent, either way. Added and withdrawn variants are kept.

sort
Sort

change (default: largest % first, either way), or pct, delta, price, name, with - for descending.

string
default: change

change (default: largest % first, either way), or pct, delta, price, name, with - for descending.

limit
Limit

Results per page.

Any of:
integer
>= 1

Results per page.

offset
Offset

Results to skip.

integer
0

Results to skip.

with_total
With Total

Include the total count. Set false for faster responses.

boolean
default: true

Include the total count. Set false for faster responses.

Successful Response

Media typeapplication/json
CompareOut
object
items
required
Items
Array<object>
CompareRow

One variant’s net change between the two ends.

object
variant_id
required
Variant Id
integer
model_id
required
Model Id
integer
brand_id
required
Brand Id
integer
brand_name
required
Brand Name
string
model_name
required
Model Name
string
variant_name
required
Variant Name
string
body_style
Body Style

The market API’s body values.

Any of:
string
site_body_type
Site Body Type

The catalogue’s own word.

Any of:
string
fuel_type
Fuel Type

petrol, diesel, … as on listings.

Any of:
string
site_fuel_type
Site Fuel Type

The catalogue’s own word.

Any of:
string
kind
required
Kind

added (on sale at the end, not at the start), withdrawn (the reverse), price_up or price_down (on sale at both ends).

string
Allowed values: added withdrawn price_up price_down
old_price
Old Price

At the start; null if new.

Any of:
string
new_price
New Price

At the end.

Any of:
string
delta
Delta

EUR, for price changes only.

Any of:
string
pct
Pct

Percent of the start price.

Any of:
string
steps
Steps

Every logged change in between, with steps=true.

Any of:
Array<object>
CompareStep

One logged change between the two ends.

object
recorded_at
required
Recorded At
string format: date-time
update_id
Update Id

The update that logged it.

Any of:
integer
change_type
required
CatalogChangeType

What changed: price or availability.

string
Allowed values: price availability
old_price
Old Price
Any of:
string
price
Price
Any of:
string
old_available
Old Available
Any of:
boolean
available
Available
Any of:
boolean
total
Total

Total number of results, or null when with_total=false.

Any of:
integer
limit
required
Limit
integer
offset
required
Offset
integer
from_id
From Id

The start update, if one was given.

Any of:
integer
to_id
To Id

The end update, if one was given.

Any of:
integer
from_at
required
From At

The start: the catalogue as it stood then.

string format: date-time
to_at
required
To At

The end.

string format: date-time
counts
required
UpdateCounts

Rows per kind, under every filter except kind, for the tabs.

object
added
Added

Variants that went on sale: new ones and ones back on sale.

integer
0
withdrawn
Withdrawn

Variants no longer on sale.

integer
0
price_up
Price Up

Price rises.

integer
0
price_down
Price Down

Price reductions.

integer
0
avg_up_pct
Avg Up Pct

Mean rise among price_up.

Any of:
string
avg_down_pct
Avg Down Pct

Mean fall among price_down (negative).

Any of:
string

Example

{
"items": [
{
"kind": "added",
"steps": [
{
"change_type": "price"
}
]
}
],
"counts": {
"added": 0,
"withdrawn": 0,
"price_up": 0,
"price_down": 0
}
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}