PHP code example of leijman / fmp-api-sdk

1. Go to this page and download the library: Download leijman/fmp-api-sdk 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/ */

    

leijman / fmp-api-sdk example snippets


$guzzle = new Client([
    'base_uri' => $baseUrl,
    'headers' => [
        'Accept' => 'application/json',
        'Content-Type' => 'application/json'
    ],
    'query' => ['apikey' => $apiKey]
]);

$client = new \Leijman\FmpApiSdk\Client($guzzle);

use \Leijman\FmpApiSdk\CompanyValuation\Quote;

$endpoint = new Quote($client);
$response = $endpoint->setSymbol('AAPL')->get();

print_r($response);

php artisan vendor:publish --provider="Leijman\FmpApiSdk\FmpServiceProvider"

use Leijman\FmpApiSdk\Facades\CompanyValuation\StockScreener;

StockScreener::setIsActivelyTrading(true)
    ->setExchange('NYSE,NASDAQ,EURONEXT')
    ->get();