create_payload | R Documentation |
A function to create a payload to query the Yahoo Finance API with customizable parameters.
create_payload(sec_type = "equity", query = NULL, size = 25,
offset = 0, sort_field = NULL, sort_type = NULL,
top_operator = "and")
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") |
A list representing the payload to be sent to the Yahoo Finance API with the specified parameters.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.