All URIs are relative to https://api.polygon.io, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
lastQuote() | GET /v2/last/nbbo/{stocksTicker} | Last Quote |
lastQuote($stocks_ticker): \OpenAPI\Client\Model\LastQuote200Response
Last Quote
Get the most recent NBBO (Quote) tick for a given stock.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\StockslastquoteApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$stocks_ticker = AAPL; // string | The ticker symbol of the stock/equity.
try {
$result = $apiInstance->lastQuote($stocks_ticker);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StockslastquoteApi->lastQuote: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
stocks_ticker | string | The ticker symbol of the stock/equity. |
\OpenAPI\Client\Model\LastQuote200Response
- Content-Type: Not defined
- Accept:
application/json
,text/csv
[Back to top] [Back to API list] [Back to Model list] [Back to README]