PHP code example of stonksant / polygon-api

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

    

stonksant / polygon-api example snippets



olygonIO\rest\Rest;

$rest = new Rest('your api key')

print_r($rest->forex->realtimeCurrencyConverion->get('USD', 'EUR', 10));



olygonIO;

$client = new PolygonIO('your apiKey');

$client->websockets->forex(
    'C.USD',
    function($data) {
        // your handler function
    }
)