create_payload {yfscreen} | R Documentation |
Create a Payload for the Yahoo Finance API
Description
A function to create a payload to query the Yahoo Finance API with customizable parameters.
Usage
create_payload(sec_type = "equity", query = NULL, size = 25,
offset = 0, sort_field = NULL, sort_type = NULL,
top_operator = "and")
Arguments
sec_type |
string. Type of security to search (i.e., "equity", "mutualfund", "etf", "index", "future"). |
query |
list. Structured query to filter results created by
the |
size |
integer. Number of results to return. |
offset |
integer. Starting position of the results. |
sort_field |
string. Field to sort the results. |
sort_type |
string. Type of sort to apply (i.e., "asc", "desc"). |
top_operator |
string. Logical operator for the top-level of the query (i.e., "and", "or") |
Value
A list representing the payload to be sent to the Yahoo Finance API with the specified parameters.
Examples
filters <- list(
list("eq", list("region", "us")),
list("btwn", list("intradaymarketcap", 2000000000, 10000000000)),
list("btwn", list("intradaymarketcap", 10000000000, 100000000000)),
list("gt", list("intradaymarketcap", 100000000000)),
list("gt", list("dayvolume", 5000000))
)
query <- create_query(filters)
payload <- create_payload("equity", query)
[Package yfscreen version 0.1.2 Index]