require 'vendor/autoload.php';
use \Ceic\Api\Configuration;
use \Ceic\Api\Apis\SeriesApi;
use \Ceic\Api\Models\QueryEntities\SeriesApiQueryEntity;
$accessToken = "ENTER YOUR API KEY HERE";
$exampleSeriesId = array("EXAMPLE SERIES ID");
$config = Configuration::getDefaultConfiguration()
$config->addDefaultHeader("Authorization", $accessToken);
Configuration::setDefaultConfiguration($config);
$seriesApi = new SeriesApi();
$seriesQueryEntity = new SeriesApiQueryEntity()
$seriesQueryEntity->setId($exampleSeriesId);
$seriesQueryEntity->setToken($accessToken);
$seriesResult = $seriesApi->getSeriesQuery($seriesQueryEntity);
$seriesMetadataResult = $seriesApi->getSeriesMetadataQuery($seriesQueryEntity);
$seriesTimePointsResult = $seriesApi->getSeriesTimePointsQuery($seriesQueryEntity);
// Access series data result
$series = $seriesResult->getData()[0];
$seriesMetadata = $series->getMetadata();
$seriesTimePoints = $series->getTimePoints();
// Access series metadata result
$seriesMetadata = $seriesMetadataResult->getData()[0]->getMetadata();
$seriesId = $seriesMetadata->getId();
$seriesFrequency = $seriesMetadata->getFrequency();
$seriesStartDate = $seriesMetadata->getStartDate();
// Access series time points data result
$seriesTimePoints = $seriesTimePointsResult->getData()[0]->getTimePoints();
$firstTimePointDate = $seriesTimePoints[0]->getDate();
$firstTimePointValue = $seriesTimePoints[0]->getValue();
$secondTimePointDate = $seriesTimePoints[1]->getDate();
$secondTimePointValue = $seriesTimePoints[1]->getValue();