PHP code example of allyans3 / dmarket-api

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

    

allyans3 / dmarket-api example snippets


$response = $api->getGamesList();

$proxy = [
    CURLOPT_PROXY => '81.201.60.130:80',
    CURLOPT_PROXYTYPE => CURLPROXY_HTTP,
    CURLOPT_TIMEOUT => 9,
    CURLOPT_CONNECTTIMEOUT => 6,
    CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
    ...
];

$response = $api->getMarketItems('csgo', $options, $proxy);