Skip to content

Latest commit

 

History

History
94 lines (71 loc) · 4.75 KB

ReferencenewsApi.md

File metadata and controls

94 lines (71 loc) · 4.75 KB

OpenAPI\Client\ReferencenewsApi

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

Method HTTP request Description
listNews() GET /v2/reference/news Ticker News

listNews()

listNews($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListNews200Response

Ticker News

Get the most recent news articles relating to a stock ticker symbol, including a summary of the article and a link to the original source.

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\ReferencenewsApi(
    // 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
);
$ticker = 'ticker_example'; // string | Return results that contain this ticker.
$published_utc = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Return results published on, before, or after this date.
$ticker_gte = 'ticker_gte_example'; // string | Search by ticker.
$ticker_gt = 'ticker_gt_example'; // string | Search by ticker.
$ticker_lte = 'ticker_lte_example'; // string | Search by ticker.
$ticker_lt = 'ticker_lt_example'; // string | Search by ticker.
$published_utc_gte = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc.
$published_utc_gt = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc.
$published_utc_lte = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc.
$published_utc_lt = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc.
$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 1000.
$sort = published_utc; // string | Sort field used for ordering.

try {
    $result = $apiInstance->listNews($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ReferencenewsApi->listNews: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
ticker string Return results that contain this ticker. [optional]
published_utc ListNewsPublishedUtcParameter Return results published on, before, or after this date. [optional]
ticker_gte string Search by ticker. [optional]
ticker_gt string Search by ticker. [optional]
ticker_lte string Search by ticker. [optional]
ticker_lt string Search by ticker. [optional]
published_utc_gte ListNewsPublishedUtcParameter Search by published_utc. [optional]
published_utc_gt ListNewsPublishedUtcParameter Search by published_utc. [optional]
published_utc_lte ListNewsPublishedUtcParameter Search by published_utc. [optional]
published_utc_lt ListNewsPublishedUtcParameter Search by published_utc. [optional]
order string Order results based on the `sort` field. [optional]
limit int Limit the number of results returned, default is 10 and max is 1000. [optional] [default to 10]
sort string Sort field used for ordering. [optional] [default to 'published_utc']

Return type

\OpenAPI\Client\Model\ListNews200Response

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]