A Public API wrapper written in Python for www.AutoScout24.ch (Swiss car listing website).
This project is still very new, and a lot is missing. (docs, tests, api integrations)
This project is a learning experiment and you are fully responsible for its use.
pip install git+https://github.com/leonardcser/auto24-api
from auto24_api import Auto24API
The Auto24API()
class initializes a chrome driver instance. The context manager allows to automatically quit the driver. However, if the Auto24API()
class needs to be called many times, it is recommended to manually create and dispose the driver with Auto24API().close()
.
from auto24_api.search import Filters, SearchQuery
with Auto24API() as api:
res = api.search_listings(
SearchQuery(
make=[Filters.MAKE.AUDI, Filters.MAKE.BMW, Filters.MAKE.VW],
year_from=2014,
year_to=None,
km_from=None,
km_to=60_000,
price_from=7_500,
price_to=20_000,
hp_from=180,
sorting=Filters.SORTING.HP_DESC,
page_size=60,
)
)
from auto24_api.details import DetailsQuery
with Auto24API() as api:
res = api.listing_details(DetailsQuery(_id=123456, slug="some-car-slug"))
Check out implementation examples here.