-
Notifications
You must be signed in to change notification settings - Fork 0
[en] Install
The installation is very simple. You should use composer for it. All modern frameworks already use composer. If you did not, please install Composer first.
After that, you can install the package via command line tool like Terminal on Mac. Just navigate to the root folder of your project and do:
composer require pixelairport/scout-connect
.
Now you can use the package. If you are not using a framework, which loads composer packages, you should load the autoload.php
from the vendor directory.
require_once '../vendor/autoload.php';
Now you can load your real estate objects:
use Pixelairport\ScoutConnect\ImmoScout\User;
/**
* Get your keys from immobilienscout24
*/
$key = 'MEIN_IS_KEY';
$secret = 'MEIN_IS_SECRET';
$access_token = 'abc123-ab12-ab12-ab12-123456abcdef';
$token_secret = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789123456789123456789123456789123456789=';
// Connect
$is24 = new User($key, $secret, $access_token, $token_secret);
// Get all my objects
$offers = $is24->findOffers();
// Show objects
print_r($offers['data']);
The code above returns 20 objects, because 20 is the default value for pagesize. Here are some code examples to get all your objects.
// Show objects 21-40
$offers = $is24->findOffers(['pagenumber'=>2]);
// Show the first 5 Objekte
$offers = $is24->findOffers(['pagesize'=>5]);
// Show the objects 11-15
$offers = $is24->findOffers(['pagesize'=>5, 'pagenumber'=>3]);
One of the biggest problems is, that people use wrong auth data. Please first go to https://rest.immobilienscout24.de/restapi/security/registration and create a key and secret. After that the access_token and token_secret is still missing. You will get these from the IS24 Playground:
- Go to https://playground.immobilienscout24.de/rest/playground
- Choose "Use a own consumer key and secret" on the left and put in our key and secret. Click the button to submit.
- Unter this, there is a box called "Request Helper Frame". Click on the button in the box to get your request token.
- Go down to "oAuth-Frame" box.
- Click "Request Token".
- Click "Authorize"
- Now you see data in Field "Access Token" and "Secret Token". This is the data you need for $access_token and $token_secret.