PHP code example of rainedot / php-nl-market

1. Go to this page and download the library: Download rainedot/php-nl-market 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/ */

    

rainedot / php-nl-market example snippets



$api = new \Rainedot\PhpNlMarket\MarketAPI('YOUR_API_KEY', 1);
echo $api->getBalance();

use \Rainedot\PhpNlMarket\Enums\Product;
echo Product::CSGO;     // "csgo"
echo Product::TF2;      // "tf2"
echo Product::DOTA2;    // "dota2"

use \Rainedot\PhpNlMarket\Enums\Count;
echo Count::MONTHLY;        // 0
echo Count::QUARTERLY;      // 1
echo Count::HALF_YEARLY;    // 2
echo Count::YEARLY;         // 3

$api = new \NeverLose\Market\API('YOUR_API_KEY', 1);
echo $api->getBalance();

$api = new \Rainedot\PhpNlMarket\MarketAPI('YOUR_API_KEY', 1);
var_dump( $api->checkIfUserExists('USERNAME') );

$api = new \Rainedot\PhpNlMarket\MarketAPI('YOUR_API_KEY', 1);
print_r( $api->getProductPrices(\Rainedot\PhpNlMarket\Enums\Product::CSGO) );

$api = new \Rainedot\PhpNlMarket\MarketAPI('YOUR_API_KEY', 1);
$api->giftProduct(1, \Rainedot\PhpNlMarket\Enums\Product::CSGO, \Rainedot\PhpNlMarket\Enums\Count::MONTHLY);

$api = new \Rainedot\PhpNlMarket\MarketAPI('YOUR_API_KEY', 1);
$api->transferBalance(1, 'USERNAME', 1);

$api = new \Rainedot\PhpNlMarket\MarketAPI('YOUR_API_KEY', 1);
$api->giveForFree(1, 'USERNAME', 'item_code');

$api = new \Rainedot\PhpNlMarket\MarketAPI('YOUR_API_KEY', 1);
$api->validateRequest(array $request); // Returns true if request is valid
bash
composer