All URIs are relative to https://api.polygon.io, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
tradesOptions() | GET /v3/trades/{optionsTicker} | Trades |
tradesOptions($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort): \OpenAPI\Client\Model\TradesOptions200Response
Trades
Get trades for an options ticker symbol in a given time range.
<?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\OptionstradesApi(
// 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
);
$options_ticker = O:TSLA210903C00700000; // string | The options ticker symbol to get trades for.
$timestamp = 'timestamp_example'; // string | Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.
$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp.
$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp.
$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp.
$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp.
$order = asc; // string | Order results based on the `sort` field.
$limit = 10; // int | Limit the number of results returned, default is 10 and max is 50000.
$sort = timestamp; // string | Sort field used for ordering.
try {
$result = $apiInstance->tradesOptions($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OptionstradesApi->tradesOptions: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
options_ticker | string | The options ticker symbol to get trades for. | |
timestamp | string | Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. | [optional] |
timestamp_gte | string | Range by timestamp. | [optional] |
timestamp_gt | string | Range by timestamp. | [optional] |
timestamp_lte | string | Range by timestamp. | [optional] |
timestamp_lt | string | Range by timestamp. | [optional] |
order | string | Order results based on the `sort` field. | [optional] [default to 'desc'] |
limit | int | Limit the number of results returned, default is 10 and max is 50000. | [optional] [default to 10] |
sort | string | Sort field used for ordering. | [optional] [default to 'timestamp'] |
\OpenAPI\Client\Model\TradesOptions200Response
- Content-Type: Not defined
- Accept:
application/json
,text/csv
[Back to top] [Back to API list] [Back to Model list] [Back to README]