indielab/autoscout24

There is no license information available for the latest version (1.2.0) of this package.

AutoScout24 PHP API.

1.2.0 2024-04-01 09:19 UTC

This package is auto-updated.

Last update: 2024-04-01 09:19:22 UTC


README

DANGER: The AutoScout24 Endpoint is only available if they whiteliste your provided IP Address, this makes it very hard to develop local - as you can imagine. An incredible bad solution for such a big company, just saying. Maybe try to use another car sharing platform which provides a more modern technology approach!

AutoScout24 PHP REST API CLIENT

Latest Stable Version Total Downloads License

A very easy to use library to work with the AutoScout24 REST Api.

Examples

Before using the library you have to obtain your cuid and memberid from the AutoScout24 Support.

Getting Data

// setup client object
$client = new Client($cuid, $memberId);

// generate query object
$query = new VehicleQuery();
$query->setClient($client);
foreach ($cars->find() as $car) {
    $car->getTypeNameFull();
}

The above code is equal with the following short notation:

$client = new Client($cuid, $memberId);
$cars = (new VehicleQuery())->setClient($client)->find();
foreach ($cars as $car) {
    $car->getId();
}

In order to generate a response without pagination use:

$client = new Client($cuid, $memberId);
$cars = (new VehicleQuery())->setClient($client)->findAll();

Find a car by its id:

$client = new Client($cuid, $memberId);
$car = (new VehicleQuery())->setClient($client)->findOne($carId);

Filter and Sorting:

$client = new Client($cuid, $memberId);
$cars = (new VehicleQuery())->setClient($client)->setVehicleSorting('price_desc')->find();

See the VehiceQuery class for all filter and sorting methods like:

  • setVehicleSorting()
  • setVehicleTypeId()
  • setYearTo()
  • setEquipment()
  • setPage()
  • setItemsPerPage()
  • setMake()
  • setModel()

Meta Data

$client = new Clien($cuid, $memberId);
$data = (new MetaQuery())->setClient($client)->findPkw();

foreach ($data as $meta) {
    var_dump($meta->getParameterName(), $meta->getDescription());
}

filter by a type

$meta = (new MetaQuery())->setClient($this->client)->findPkw()->filter('sort');