PHP code example of marekskopal / trading212

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

    

marekskopal / trading212 example snippets


use MarekSkopal\Trading212\Trading212;
use MarekSkopal\Trading212\Config\Config;

// Create Trading212 instance
$trading212 = new Trading212(new Config('<yourApiKey>'));

// Get exchange list
$response = $trading212->getInstrumentsMetadata()->exchangeList();