Title: | API Wrapper for Nasdaq Data Link |
Version: | 1.0.0 |
Date: | 2022-06-17 |
Maintainer: | Jamie Couture <jamie.couture@nasdaq.com> |
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. |
Imports: | httr (≥ 0.6.1), zoo, jsonlite (≥ 0.9.14), methods |
Suggests: | testthat (≥ 0.10.0), roxygen2, timeSeries |
Depends: | R (≥ 3.5.0), xts |
License: | MIT + file LICENSE |
URL: | https://github.com/nasdaq/data-link-r |
BugReports: | https://github.com/nasdaq/data-link-r/issues |
RoxygenNote: | 7.1.1 |
NeedsCompilation: | no |
Packaged: | 2022-06-20 18:11:33 UTC; erivau |
Author: | Jamie Couture [cre], Eric Vautour [aut], Nasdaq Data Link. [cph] |
Repository: | CRAN |
Date/Publication: | 2022-06-22 07:50:05 UTC |
Retrieves Data from the Nasdaq Data Link Dataset endpoint and formats
Description
Retrieves Data from the Nasdaq Data Link Dataset endpoint and formats
Usage
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,
...
)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile.
Value
Depending on the type the class is either data.frame, time series, xts, zoo or timeSeries.
References
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.
See Also
Examples
## 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
Description
Query or set Nasdaq Data Link API key
Usage
NasdaqDataLink.api_key(api_key)
Arguments
api_key |
Optionally passed parameter to set Nasdaq Data Link |
Value
Returns invisibly the currently set api_key
.
Examples
## Not run:
NasdaqDataLink.api_key('foobar')
## End(Not run)
Query or set Nasdaq Data Link API token
Description
Deprecated. Alias of NasdaqDataLink.api_key
Usage
NasdaqDataLink.auth(auth_token)
Arguments
auth_token |
Optionally passed parameter to set Nasdaq Data Link |
Value
Returns invisibly the currently set auth_token
.
See Also
Examples
## Not run:
NasdaqDataLink.auth('foobar')
## End(Not run)
Query or set Base URL for White-labeled sites
Description
Query or set Base URL for White-labeled sites
Usage
NasdaqDataLink.base_url(base_url)
Arguments
base_url |
Optionally passed parameter to set Nasdaq Data Link |
Value
Returns invisibly the currently set base_url
.
Examples
## Not run:
NasdaqDataLink.base_url('http://localhost')
## End(Not run)
Downloads a zip with all data from a Nasdaq Data Link database
Description
Downloads a zip with all data from a Nasdaq Data Link database
Usage
NasdaqDataLink.database.bulk_download_to_file(database_code, filename, ...)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
The filename of the downloaded file.
See Also
Examples
## Not run:
NasdaqDataLink.database.bulk_download_to_file("NSE", "./NSE.zip")
## End(Not run)
Returns the bulk download url
Description
Returns the bulk download url
Usage
NasdaqDataLink.database.bulk_download_url(database_code, ...)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Returns the download url.
See Also
Examples
## Not run:
url = NasdaqDataLink.database.download_url("NSE", download_type="partial")
## End(Not run)
Retrieves Data from the Nasdaq Data Link Dataset endpoint
Description
Retrieves Data from the Nasdaq Data Link Dataset endpoint
Usage
NasdaqDataLink.dataset.get(code, params)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Returns a data.frame of the requested data
See Also
NasdaqDataLink.api_key
, NasdaqDataLink
Examples
## 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
Description
Retrieves Data from the Nasdaq Data Link Datatable endpoint
Usage
NasdaqDataLink.datatable(datatable_code, paginate = FALSE, ...)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Returns a data.frame.
See Also
Examples
## Not run:
NasdaqDataLink.datatable('ZACKS/FC', paginate=TRUE)
## End(Not run)
Downloads a zip with all data requested from a Nasdaq Data Link database
Description
Downloads a zip with all data requested from a Nasdaq Data Link database
Usage
NasdaqDataLink.datatable.bulk_download_to_file(datatable_code, filename, ...)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Returns a data.frame.
See Also
Examples
## Not run:
NasdaqDataLink.datatable.bulk_download_to_file('ZACKS/EE')
## End(Not run)
Generates and returns a bulk download url
Description
Generates and returns a bulk download url
Usage
NasdaqDataLink.datatable.bulk_download_url(datatable_code, ...)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Returns the download url.
See Also
Examples
## 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.
Description
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.
Usage
NasdaqDataLink.pit.asofdate(datatable_code, start_date, paginate = FALSE, ...)
Arguments
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. |
Details
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
Value
Returns a data.frame.
See Also
Examples
## 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.
Description
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.
Usage
NasdaqDataLink.pit.between(
datatable_code,
start_date,
end_date,
paginate = FALSE,
...
)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Returns a data.frame.
See Also
Examples
## 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.
Description
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.
Usage
NasdaqDataLink.pit.fromto(
datatable_code,
start_date,
end_date,
paginate = FALSE,
...
)
Arguments
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. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Returns a data.frame.
See Also
Examples
## Not run:
NasdaqDataLink.pit.fromto('RSM/MSB', '2020-06-11', '2020-06-12', paginate=TRUE)
## End(Not run)
Search the Nasdaq Data Link database
Description
Search the Nasdaq Data Link database
Usage
NasdaqDataLink.search(query, silent = FALSE, per_page = 10, ...)
Arguments
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. |
Details
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
Value
Search results returned as a data.frame.
See Also
Examples
## Not run:
search.results <- NasdaqDataLink.search("oil")
## End(Not run)
Retrieve metadata from a Nasdaq Data Link series or search results
Description
Retrieve metadata from a Nasdaq Data Link series or search results
Usage
metaData(x)
Arguments
x |
A Nasdaq Data Link time series object or search results with attached meta data. |
Value
Returns a list of meta data about the series or search results.
See Also
NasdaqDataLink.api_key
, NasdaqDataLink.search
Examples
## Not run:
metaData(ts)
## End(Not run)
Executes Nasdaq Data Link API calls
Description
Executes Nasdaq Data Link API calls
Usage
nasdaq_data_link.api(
path,
http = c("GET", "PUT", "POST", "DELETE"),
postdata = NULL,
...
)
Arguments
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/. |
Details
Set your api_key
with NasdaqDataLink.api_key
function. For instructions on finding your api key go to https://data.nasdaq.com/account/profile
Value
Nasdaq Data Link API response.
See Also
Examples
## Not run:
data_link_data = nasdaq_data_link.api(path="datasets/NSE/OIL", http="GET")
plot(data_link_data[,1])
## End(Not run)