Package 'NasdaqDataLink'

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

Help Index


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

NasdaqDataLink.api_key

Examples

## Not run: 
data_link_data = nasdaq_data_link.api(path="datasets/NSE/OIL", http="GET")
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 api_key.

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 auth_token.

Value

Returns invisibly the currently set auth_token.

See Also

NasdaqDataLink.api_key

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 base_url.

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

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

NasdaqDataLink.api_key

Examples

## Not run: 
search.results <- NasdaqDataLink.search("oil")

## End(Not run)