1. Go to this page and download the library: Download polygon-io/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/ */
polygon-io / api example snippets
ad API key from environment variable
$apiKey = getenv('POLYGON_API_KEY');
// Check if the API key is not empty
if (!$apiKey) {
die('API key is not set in environment variables.');
}
// Configure API key authorization: apiKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('apiKey', $apiKey);