Skip to content

Instantly share code, notes, and snippets.

@devbanana
Created February 2, 2020 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devbanana/2726853ea256b09fba25c9b755446981 to your computer and use it in GitHub Desktop.
Save devbanana/2726853ea256b09fba25c9b755446981 to your computer and use it in GitHub Desktop.
Fetch quote data from IEX.
<?php
require_once 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'https://cloud.iexapis.com/stable/',
]);
$response = $client->get('stock/AAPL/quote', [
'query' => [
'token' => $_ENV['IEXKEY'],
],
]);
echo $response->getBody() . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment