Title: | API Wrapper for Nasdaq Data Link |
---|---|
Description: | Functions for interacting directly with the Nasdaq Data Link API to offer data in a number of formats usable in R, downloading a zip with all data from a Nasdaq Data Link database, and the ability to search. This R package uses the Nasdaq Data Link API. For more information go to <https://docs.data.nasdaq.com/>. For more help on the package itself go to <https://data.nasdaq.com/tools/r>. |
Authors: | Jamie Couture [cre], Eric Vautour [aut], Nasdaq Data Link. [cph] |
Maintainer: | Jamie Couture <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-11-12 05:26:45 UTC |
Source: | https://github.com/nasdaq/data-link-r |
Retrieve metadata from a Nasdaq Data Link series or search results
metaData(x)
metaData(x)
x |
A Nasdaq Data Link time series object or search results with attached meta data. |
Returns a list of meta data about the series or search results.
NasdaqDataLink.api_key
, NasdaqDataLink.search
## Not run: metaData(ts) ## End(Not run)
## Not run: metaData(ts) ## End(Not run)
Executes Nasdaq Data Link API calls
nasdaq_data_link.api( path, http = c("GET", "PUT", "POST", "DELETE"), postdata = NULL, ... )
nasdaq_data_link.api( path, http = c("GET", "PUT", "POST", "DELETE"), postdata = NULL, ... )
path |
Path to api resource. |
http |
Type of http request sent. |
postdata |
A character or raw vector that is sent in a body. |
... |
Named values that are interpretted as Nasdaq Data Link API parameters. Please see https://docs.data.nasdaq.com/. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Nasdaq Data Link API response.
## Not run: data_link_data = nasdaq_data_link.api(path="datasets/NSE/OIL", http="GET") plot(data_link_data[,1]) ## End(Not run)
## Not run: data_link_data = nasdaq_data_link.api(path="datasets/NSE/OIL", http="GET") plot(data_link_data[,1]) ## End(Not run)
Retrieves Data from the Nasdaq Data Link Dataset endpoint and formats
NasdaqDataLink( code, type = c("raw", "ts", "zoo", "xts", "timeSeries"), transform = c("", "diff", "rdiff", "normalize", "cumul", "rdiff_from"), collapse = c("", "daily", "weekly", "monthly", "quarterly", "annual"), order = c("desc", "asc"), meta = FALSE, force_irregular = FALSE, ... )
NasdaqDataLink( code, type = c("raw", "ts", "zoo", "xts", "timeSeries"), transform = c("", "diff", "rdiff", "normalize", "cumul", "rdiff_from"), collapse = c("", "daily", "weekly", "monthly", "quarterly", "annual"), order = c("desc", "asc"), meta = FALSE, force_irregular = FALSE, ... )
code |
Dataset code on Nasdaq Data Link specified as a string or an array of strings. |
type |
Type of data returned specified as string. Can be 'raw', 'ts', 'zoo', 'xts' or 'timeSeries'. |
transform |
Apply Nasdaq Data Link API data transformations. |
collapse |
Collapse frequency of Data. |
order |
Select if data is given to R in ascending or descending formats. Helpful for the rows parameter. |
meta |
Adds meta data as an attribute to the returned Data. |
force_irregular |
When set to TRUE, forces the index of the Data to be of date format yyyy-mm-dd |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. Please see https://docs.data.nasdaq.com/docs/in-depth-usage#get-time-series-metadata for a full list of parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile.
Depending on the type the class is either data.frame, time series, xts, zoo or timeSeries.
This R package uses the Nasdaq Data Link API. For more information go to https://docs.data.nasdaq.com. For more help on the package itself go to https://data.nasdaq.com/tools/r.
## Not run: data_link_data = NasdaqDataLink("NSE/OIL", collapse="monthly", start_date="2013-01-01", type="ts") plot(data_link_data[,1]) ## End(Not run)
## Not run: data_link_data = NasdaqDataLink("NSE/OIL", collapse="monthly", start_date="2013-01-01", type="ts") plot(data_link_data[,1]) ## End(Not run)
Query or set Nasdaq Data Link API key
NasdaqDataLink.api_key(api_key)
NasdaqDataLink.api_key(api_key)
api_key |
Optionally passed parameter to set Nasdaq Data Link |
Returns invisibly the currently set api_key
.
## Not run: NasdaqDataLink.api_key('foobar') ## End(Not run)
## Not run: NasdaqDataLink.api_key('foobar') ## End(Not run)
Deprecated. Alias of NasdaqDataLink.api_key
NasdaqDataLink.auth(auth_token)
NasdaqDataLink.auth(auth_token)
auth_token |
Optionally passed parameter to set Nasdaq Data Link |
Returns invisibly the currently set auth_token
.
## Not run: NasdaqDataLink.auth('foobar') ## End(Not run)
## Not run: NasdaqDataLink.auth('foobar') ## End(Not run)
Query or set Base URL for White-labeled sites
NasdaqDataLink.base_url(base_url)
NasdaqDataLink.base_url(base_url)
base_url |
Optionally passed parameter to set Nasdaq Data Link |
Returns invisibly the currently set base_url
.
## Not run: NasdaqDataLink.base_url('http://localhost') ## End(Not run)
## Not run: NasdaqDataLink.base_url('http://localhost') ## End(Not run)
Downloads a zip with all data from a Nasdaq Data Link database
NasdaqDataLink.database.bulk_download_to_file(database_code, filename, ...)
NasdaqDataLink.database.bulk_download_to_file(database_code, filename, ...)
database_code |
Database code on Nasdaq Data Link specified as a string. |
filename |
Filename (including path) of file to download. |
... |
Additional named values that are interpreted as NasdaqDataLink API parameters. Please see https://docs.data.nasdaq.com/docs/parameters-2 for a full list of parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
The filename of the downloaded file.
## Not run: NasdaqDataLink.database.bulk_download_to_file("NSE", "./NSE.zip") ## End(Not run)
## Not run: NasdaqDataLink.database.bulk_download_to_file("NSE", "./NSE.zip") ## End(Not run)
Returns the bulk download url
NasdaqDataLink.database.bulk_download_url(database_code, ...)
NasdaqDataLink.database.bulk_download_url(database_code, ...)
database_code |
Database code on Nasdaq Data Link specified as a string. |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. Please see https://docs.data.nasdaq.com/docs/parameters-2 for a full list of parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns the download url.
## Not run: url = NasdaqDataLink.database.download_url("NSE", download_type="partial") ## End(Not run)
## Not run: url = NasdaqDataLink.database.download_url("NSE", download_type="partial") ## End(Not run)
Retrieves Data from the Nasdaq Data Link Dataset endpoint
NasdaqDataLink.dataset.get(code, params)
NasdaqDataLink.dataset.get(code, params)
code |
Dataset code on Nasdaq Data Link specified as a string. |
params |
A list of parameters to be passed to the Nasdaq Data Link API. Please see https://docs.data.nasdaq.com/docs/in-depth-usage#get-time-series-metadata for a full list of parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns a data.frame of the requested data
NasdaqDataLink.api_key
, NasdaqDataLink
## Not run: data_link_data = NasdaqDataLink.dataset.get("NSE/OIL", list(rows=5)) plot(data_link_data[,1]) ## End(Not run)
## Not run: data_link_data = NasdaqDataLink.dataset.get("NSE/OIL", list(rows=5)) plot(data_link_data[,1]) ## End(Not run)
Retrieves Data from the Nasdaq Data Link Datatable endpoint
NasdaqDataLink.datatable(datatable_code, paginate = FALSE, ...)
NasdaqDataLink.datatable(datatable_code, paginate = FALSE, ...)
datatable_code |
Datatable code on Nasdaq Data Link specified as a string. |
paginate |
When set to TRUE, fetches up to 1,000,000 rows of data |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns a data.frame.
## Not run: NasdaqDataLink.datatable('ZACKS/FC', paginate=TRUE) ## End(Not run)
## Not run: NasdaqDataLink.datatable('ZACKS/FC', paginate=TRUE) ## End(Not run)
Downloads a zip with all data requested from a Nasdaq Data Link database
NasdaqDataLink.datatable.bulk_download_to_file(datatable_code, filename, ...)
NasdaqDataLink.datatable.bulk_download_to_file(datatable_code, filename, ...)
datatable_code |
Datatable code on Nasdaq Data Link specified as a string. |
filename |
Filename (including path) of file to download. |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns a data.frame.
## Not run: NasdaqDataLink.datatable.bulk_download_to_file('ZACKS/EE') ## End(Not run)
## Not run: NasdaqDataLink.datatable.bulk_download_to_file('ZACKS/EE') ## End(Not run)
Generates and returns a bulk download url
NasdaqDataLink.datatable.bulk_download_url(datatable_code, ...)
NasdaqDataLink.datatable.bulk_download_url(datatable_code, ...)
datatable_code |
Datatable code on Nasdaq Data Link specified as a string. |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. Please see https://docs.data.nasdaq.com/docs/parameters-1 for a full list of parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns the download url.
## Not run: url = NasdaqDataLink.datatable.bulk_download_url("ZACKS/EE", ticker="AAPL") ## End(Not run)
## Not run: url = NasdaqDataLink.datatable.bulk_download_url("ZACKS/EE", ticker="AAPL") ## End(Not run)
Retrieves Point In Time Data from the Nasdaq Data Link PIT endpoint. As of date is used to see the table as it was at a specific point in time in the past.
NasdaqDataLink.pit.asofdate(datatable_code, start_date, paginate = FALSE, ...)
NasdaqDataLink.pit.asofdate(datatable_code, start_date, paginate = FALSE, ...)
datatable_code |
Datatable code on Nasdaq Data Link specified as a string. |
start_date |
Lower date as a string. |
paginate |
When set to TRUE, fetches up to 1,000,000 rows of data |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. |
Set your api_key
with Nasdaq Data Link.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns a data.frame.
## Not run: NasdaqDataLink.pit.asofdate('RSM/MSB', '2020-06-11', paginate=TRUE) ## End(Not run)
## Not run: NasdaqDataLink.pit.asofdate('RSM/MSB', '2020-06-11', paginate=TRUE) ## End(Not run)
Retrieves Point In Time Data from the Nasdaq Data Link PIT endpoint. Between start and end will show all rows that were visible at any point between two specified points in time. It works inclusively, a row visible exactly at start or exactly at end will be shown too.
NasdaqDataLink.pit.between( datatable_code, start_date, end_date, paginate = FALSE, ... )
NasdaqDataLink.pit.between( datatable_code, start_date, end_date, paginate = FALSE, ... )
datatable_code |
Datatable code on Nasdaq Data Link specified as a string. |
start_date |
Lower date as a string. |
end_date |
Upper date as a string. |
paginate |
When set to TRUE, fetches up to 1,000,000 rows of data |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns a data.frame.
## Not run: NasdaqDataLink.pit.between('RSM/MSB', '2020-06-11', '2020-06-12', paginate=TRUE) ## End(Not run)
## Not run: NasdaqDataLink.pit.between('RSM/MSB', '2020-06-11', '2020-06-12', paginate=TRUE) ## End(Not run)
Retrieves Point In Time Data from the Nasdaq Data Link PIT endpoint. From start to end will also show all rows that were visible at any point between two specified points in time, including start, but excluding end.
NasdaqDataLink.pit.fromto( datatable_code, start_date, end_date, paginate = FALSE, ... )
NasdaqDataLink.pit.fromto( datatable_code, start_date, end_date, paginate = FALSE, ... )
datatable_code |
Datatable code on Nasdaq Data Link specified as a string. |
start_date |
Lower date as a string. |
end_date |
Upper date as a string. |
paginate |
When set to TRUE, fetches up to 1,000,000 rows of data |
... |
Additional named values that are interpreted as Nasdaq Data Link API parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Returns a data.frame.
## Not run: NasdaqDataLink.pit.fromto('RSM/MSB', '2020-06-11', '2020-06-12', paginate=TRUE) ## End(Not run)
## Not run: NasdaqDataLink.pit.fromto('RSM/MSB', '2020-06-11', '2020-06-12', paginate=TRUE) ## End(Not run)
Search the Nasdaq Data Link database
NasdaqDataLink.search(query, silent = FALSE, per_page = 10, ...)
NasdaqDataLink.search(query, silent = FALSE, per_page = 10, ...)
query |
Search terms |
silent |
Prints the results when FALSE. |
per_page |
Number of results returned per page. |
... |
Additional named values that are interpretted as Nasdaq Data Link API parameters. |
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
For instructions on finding your authentication token go to https://data.nasdaq.com/account/profile
Search results returned as a data.frame.
## Not run: search.results <- NasdaqDataLink.search("oil") ## End(Not run)
## Not run: search.results <- NasdaqDataLink.search("oil") ## End(Not run)