PHP code example of pdir / immobilienscout-api
1. Go to this page and download the library: Download pdir/immobilienscout-api library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pdir / immobilienscout-api example snippets
// store keys in .env file or use credentials array
$credentials = [
'consumerKey' => 'IS24_CONSUMER_KEY',
'consumerSecret' => 'IS24_CONSUMER_SECRET',
'tokenKey' => 'IS24_TOKEN_KEY',
'tokenSecret' => 'IS24_TOKEN_SECRET',
];
$api = new \Pdir\Immoscout\Api();
or
$api = new \Pdir\Immoscout\Api($credentials);
// get all real estates with details
$estates = $api->getAllRealEstates(true);
// get only active real estates with details
$estates = $api->getAllRealEstates(true, false, true);
// get real estate by id
$estate = $api->getRealEstate('1234567890');
// get attachments by id
$attachments = $api->getAttachments('1234567890');
// get contact by id
$contact = $api->getContact('1234567890');