Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 2.04 KB

StockslasttradeApi.md

File metadata and controls

70 lines (47 loc) · 2.04 KB

OpenAPI\Client\StockslasttradeApi

All URIs are relative to https://api.polygon.io, except if the operation defines another base path.

Method HTTP request Description
lastTrade() GET /v2/last/trade/{stocksTicker} Last Trade

lastTrade()

lastTrade($stocks_ticker): \OpenAPI\Client\Model\LastTradeOptions200Response

Last Trade

Get the most recent trade for a given stock.

Example

<?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\StockslasttradeApi(
    // 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->lastTrade($stocks_ticker);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling StockslasttradeApi->lastTrade: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
stocks_ticker string The ticker symbol of the stock/equity.

Return type

\OpenAPI\Client\Model\LastTradeOptions200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]