Class NewsApi
java.lang.Object
markets.alpaca.client.openapi.data.api.NewsApi
Generated client for NewsApi operations.
This class is generated from the configured OpenAPI spec. Operation method Javadocs include OAS summaries, descriptions, parameters, return types, response details, and external documentation links when present in the spec.
Operations
news: News articles
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintnews(OffsetDateTime start, OffsetDateTime end, String sort, String symbols, Integer limit, Boolean includeContent, Boolean excludeContentless, String pageToken) News articles Returns the latest news articles across stocks and crypto.okhttp3.CallnewsAsync(OffsetDateTime start, OffsetDateTime end, String sort, String symbols, Integer limit, Boolean includeContent, Boolean excludeContentless, String pageToken, ApiCallback<NewsResp> _callback) News articles (asynchronously) Returns the latest news articles across stocks and crypto.okhttp3.CallnewsCall(OffsetDateTime start, OffsetDateTime end, String sort, String symbols, Integer limit, Boolean includeContent, Boolean excludeContentless, String pageToken, ApiCallback _callback) Build call for newsnewsWithHttpInfo(OffsetDateTime start, OffsetDateTime end, String sort, String symbols, Integer limit, Boolean includeContent, Boolean excludeContentless, String pageToken) News articles Returns the latest news articles across stocks and crypto.voidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex)
-
Constructor Details
-
NewsApi
public NewsApi() -
NewsApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
newsCall
public okhttp3.Call newsCall(@Nullable OffsetDateTime start, @Nullable OffsetDateTime end, @Nullable String sort, @Nullable String symbols, @Nullable Integer limit, @Nullable Boolean includeContent, @Nullable Boolean excludeContentless, @Nullable String pageToken, ApiCallback _callback) throws ApiException Build call for news- Parameters:
start- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the beginning of the current day, but at least 15 minutes ago if the user doesn't have real-time access for the feed. (optional)end- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the current time if the user has a real-time access for the feed, otherwise 15 minutes before the current time. (optional)sort- Sort articles by updated date. (optional, default to desc)symbols- A comma-separated list of symbols for which to query news. (optional)limit- Limit of news items to be returned for a result page. (optional)includeContent- Boolean indicator to include content for news articles (if available). (optional)excludeContentless- Boolean indicator to exclude news articles that do not contain content. (optional)pageToken- The pagination token from which to continue. The value to pass here is returned in specific requests when more data is available, usually because of a response result limit. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 OK - 400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
401 Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key. - 403 The requested resource is forbidden. - 429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on [Slack](https://alpaca.markets/slack) or on the [Community Forum](https://forum.alpaca.markets/). -
-
news
public NewsResp news(@Nullable OffsetDateTime start, @Nullable OffsetDateTime end, @Nullable String sort, @Nullable String symbols, @Nullable Integer limit, @Nullable Boolean includeContent, @Nullable Boolean excludeContentless, @Nullable String pageToken) throws ApiException News articles Returns the latest news articles across stocks and crypto. By default, returns the latest 10 news articles.- Parameters:
start- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the beginning of the current day, but at least 15 minutes ago if the user doesn't have real-time access for the feed. (optional)end- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the current time if the user has a real-time access for the feed, otherwise 15 minutes before the current time. (optional)sort- Sort articles by updated date. (optional, default to desc)symbols- A comma-separated list of symbols for which to query news. (optional)limit- Limit of news items to be returned for a result page. (optional)includeContent- Boolean indicator to include content for news articles (if available). (optional)excludeContentless- Boolean indicator to exclude news articles that do not contain content. (optional)pageToken- The pagination token from which to continue. The value to pass here is returned in specific requests when more data is available, usually because of a response result limit. (optional)- Returns:
- NewsResp
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 OK - 400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
401 Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key. - 403 The requested resource is forbidden. - 429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on [Slack](https://alpaca.markets/slack) or on the [Community Forum](https://forum.alpaca.markets/). -
-
newsWithHttpInfo
public ApiResponse<NewsResp> newsWithHttpInfo(@Nullable OffsetDateTime start, @Nullable OffsetDateTime end, @Nullable String sort, @Nullable String symbols, @Nullable Integer limit, @Nullable Boolean includeContent, @Nullable Boolean excludeContentless, @Nullable String pageToken) throws ApiException News articles Returns the latest news articles across stocks and crypto. By default, returns the latest 10 news articles.- Parameters:
start- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the beginning of the current day, but at least 15 minutes ago if the user doesn't have real-time access for the feed. (optional)end- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the current time if the user has a real-time access for the feed, otherwise 15 minutes before the current time. (optional)sort- Sort articles by updated date. (optional, default to desc)symbols- A comma-separated list of symbols for which to query news. (optional)limit- Limit of news items to be returned for a result page. (optional)includeContent- Boolean indicator to include content for news articles (if available). (optional)excludeContentless- Boolean indicator to exclude news articles that do not contain content. (optional)pageToken- The pagination token from which to continue. The value to pass here is returned in specific requests when more data is available, usually because of a response result limit. (optional)- Returns:
- ApiResponse<NewsResp>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 OK - 400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
401 Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key. - 403 The requested resource is forbidden. - 429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on [Slack](https://alpaca.markets/slack) or on the [Community Forum](https://forum.alpaca.markets/). -
-
newsAsync
public okhttp3.Call newsAsync(@Nullable OffsetDateTime start, @Nullable OffsetDateTime end, @Nullable String sort, @Nullable String symbols, @Nullable Integer limit, @Nullable Boolean includeContent, @Nullable Boolean excludeContentless, @Nullable String pageToken, ApiCallback<NewsResp> _callback) throws ApiException News articles (asynchronously) Returns the latest news articles across stocks and crypto. By default, returns the latest 10 news articles.- Parameters:
start- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the beginning of the current day, but at least 15 minutes ago if the user doesn't have real-time access for the feed. (optional)end- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the current time if the user has a real-time access for the feed, otherwise 15 minutes before the current time. (optional)sort- Sort articles by updated date. (optional, default to desc)symbols- A comma-separated list of symbols for which to query news. (optional)limit- Limit of news items to be returned for a result page. (optional)includeContent- Boolean indicator to include content for news articles (if available). (optional)excludeContentless- Boolean indicator to exclude news articles that do not contain content. (optional)pageToken- The pagination token from which to continue. The value to pass here is returned in specific requests when more data is available, usually because of a response result limit. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 OK - 400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
401 Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key. - 403 The requested resource is forbidden. - 429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on [Slack](https://alpaca.markets/slack) or on the [Community Forum](https://forum.alpaca.markets/). -
-