PHP code example of jwprogrammer / allegro-scraper

1. Go to this page and download the library: Download jwprogrammer/allegro-scraper 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/ */

    

jwprogrammer / allegro-scraper example snippets




$allegro = new \AllegroScraper\AllegroScraper();

$result = $allegro->search([
    'page' => 1,
    'query' => 'Led halogen lampa',
    'category' => 'czesci-samochodowe-620',
    'order' => 'pd'
]);
if ($result->success) {
    $result->totalCount;
    foreach ($result->products as $product) {
        $product->id;
        $product->url;
        $product->title;
        $product->price;
        $product->price_with_delivery;
        $product->mainThumbnail;
        $product->mainImage;
    }
}

$allegro = new \AllegroScraper\AllegroScraper();

$result = $allegro->details([
    'product_id' => 11437180475
]);

print_r($result); //ALL INFORMATION about this product

$product->id;
$product->title;
$product->url;
$product->active;
$product->availableQuantity;
$product->price;
$product->price_with_delivery;
$product->seller;
$product->rating;
$product->buyers;
$product->delivery_options;
$product->currency;
$product->category_path;
$product->specifications;
$product->images;
$product->description;
$product->reviews;
$product->compatibility;