| Title: | Investment Data Access and Preparation Toolkit |
| Version: | 0.1.8 |
| Author: | Oliver Zhou [aut, cre] |
| Maintainer: | Oliver Zhou <oliver.yxzhou@gmail.com> |
| Description: | A toolkit for loading, transforming, and managing structured investment-related data. Includes functions for retrieving macroeconomic and public financial series, regulatory filings, futures positioning, energy and fiscal data, market open-high-low-close-volume data, fund holdings, narrative feeds, and crypto derivatives from multiple providers. It detects time-series gaps and synchronizes local '.rds' data stores with sidecar metadata for analysis and trading workflows. It also generates structured dataset descriptions for large language model (LLM)-based analyst agents that produce R code for analysis and visualization. |
| License: | MIT + file LICENSE |
| URL: | https://github.com/OliverLDS/investdatar |
| BugReports: | https://github.com/OliverLDS/investdatar/issues |
| Encoding: | UTF-8 |
| Language: | en-US |
| Depends: | R (≥ 4.1.0) |
| Imports: | data.table, jsonlite, curl, httr, xml2, yaml |
| Suggests: | binxr, okxr, quantmod, testthat (≥ 3.0.0), xts, waldo, wbstats, withr, zoo |
| Config/testthat/edition: | 3 |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-12-03 01:11:12 UTC; runner |
| Repository: | CRAN |
| Date/Publication: | 2026-12-03 03:30:02 UTC |
Add Or Update One FRED Registry Entry
Description
Add Or Update One FRED Registry Entry
Usage
add_fred_registry_series(
series_id,
main_group = NULL,
registry_path = get_fred_registry_file_path(),
config = NULL
)
Arguments
series_id |
FRED series identifier. |
main_group |
Optional grouping label. If |
registry_path |
Optional registry JSON path. |
config |
Optional FRED API config. |
Value
The added or updated row as a data.table.
Add Or Update One iShares Registry Entry
Description
Add Or Update One iShares Registry Entry
Usage
add_ishare_registry_ticker(
ticker,
type = NULL,
registry_path = get_ishare_registry_file_path()
)
Arguments
ticker |
ETF ticker. |
type |
Optional ticker type. If |
registry_path |
Optional registry JSON path. |
Value
The added or updated row as a data.table.
Add Or Update An SEC Registry Company
Description
Add Or Update An SEC Registry Company
Usage
add_sec_registry_company(
ticker,
cik = NULL,
company_name = NULL,
forms = c("10-K", "10-Q", "8-K"),
concepts = NULL,
active = TRUE,
registry_path = get_sec_registry_file_path(),
config = NULL
)
Arguments
ticker |
Security ticker. |
cik |
Optional CIK; resolved from the SEC ticker mapping when omitted. |
company_name |
Optional company name. |
forms |
Optional filing forms retained by submissions sync. |
concepts |
Optional XBRL concepts retained by Company Facts sync. |
active |
Logical registry flag. |
registry_path |
Optional registry path. |
config |
Optional SEC configuration. |
Value
The stored registry row.
Add Or Update One World Bank Registry Entry
Description
Add Or Update One World Bank Registry Entry
Usage
add_wbstats_registry_series(
indicator,
country = NULL,
freq = "Y",
main_group = NA_character_,
label = NA_character_,
notes = NA_character_,
active = TRUE,
registry_path = get_wbstats_registry_file_path()
)
Arguments
indicator |
World Bank indicator code. |
country |
Country or aggregate code. |
freq |
Frequency code. |
main_group |
Optional grouping label. |
label |
Optional display label. |
notes |
Optional free-text notes. |
active |
Logical flag stored in the registry. |
registry_path |
Optional registry JSON path. |
Value
The added or updated row as a data.table.
Audit CSI 300 Cache Integrity Against Eastmoney
Description
Read the local Yahoo Finance cache for 000300.SS, compare its common daily
coverage with a fresh Eastmoney request, and write versioned JSON and CSV
audit artifacts. This function is read-only with respect to cached OHLC and
metadata files: it does not synchronize, repair, or overwrite market data.
Usage
audit_csi300_cache_integrity(
local_path = NULL,
output_dir = NULL,
from = NULL,
to = NULL,
close_tolerance = 0.01,
baostock_corroboration = NULL
)
Arguments
local_path |
Yahoo Finance cache directory. Defaults to the configured Yahoo Finance data path. |
output_dir |
Directory for audit artifacts. Defaults to
|
from |
Optional inclusive start date for cached rows under review. |
to |
Optional inclusive end date for cached rows under review. |
close_tolerance |
Non-negative absolute close-price tolerance in index points after both closes are normalized to Eastmoney's published two-decimal quote precision. Rows strictly above this value are discrepancies. |
baostock_corroboration |
Optional named list of independently obtained BaoStock comparison evidence. It is recorded only as corroboration. |
Details
baostock_corroboration is optional external evidence recorded verbatim in
the JSON report. It never triggers a BaoStock request and does not add a
BaoStock runtime dependency.
Value
A list containing an audit summary, discrepancy data.table, and
JSON and CSV artifact paths.
Audit Recent Yahoo Finance Cache Overlaps
Description
Compare completed daily rows in catalog-backed Yahoo Finance caches with a
fresh Yahoo overlap. The audit writes versioned JSON and CSV artifacts only;
it never synchronizes, repairs, or modifies a cache. Registry symbols without
catalog metadata produce explicit skipped_missing_catalog_metadata findings.
Usage
audit_yahoofinance_recent_overlap(
registry = get_yahoofinance_registry(),
local_path = NULL,
output_dir = NULL,
overlap_days = 35L,
as_of = Sys.time(),
fallback_corroboration = c("on_issue", "none", "all"),
require_catalog_metadata = TRUE,
max_attempts = 3L,
retry_delay_seconds = 1
)
Arguments
registry |
Yahoo Finance registry table. Defaults to the configured runtime registry. |
local_path |
Yahoo Finance cache directory. Defaults to the configured Yahoo Finance data path. |
output_dir |
Audit artifact directory. Defaults to
|
overlap_days |
Number of recent calendar days to inspect. Defaults to
|
as_of |
UTC time used to exclude the current market-calendar date.
For |
fallback_corroboration |
One of |
require_catalog_metadata |
When |
max_attempts |
Maximum Yahoo attempts per catalog-backed instrument. |
retry_delay_seconds |
Initial retry delay in seconds. |
Value
A list with summary, findings, and JSON/CSV artifact_paths.
Bootstrap Yahoo Finance Runtime Registry
Description
Create an absent runtime registry from the tracked package seed. Existing registries are never overwritten; they are validated and an actionable error is raised if required fallback declarations have drifted.
Usage
bootstrap_yahoofinance_registry(
registry_path = get_yahoofinance_registry_file_path(),
seed_path = get_yahoofinance_seed_registry_path()
)
Arguments
registry_path |
Runtime registry JSON path. |
seed_path |
Package seed registry JSON path. |
Value
Invisibly returns the runtime registry path.
Describe AlphaVantage Data
Description
Fetches AlphaVantage daily OHLCV data and creates a compact narrative for the resulting standardized market table.
Usage
describe_alphavantage_data(symbol, mode = c("compact", "full"), config = NULL)
Arguments
symbol |
Market symbol. |
mode |
Output size passed to AlphaVantage. |
config |
Optional AlphaVantage API configuration. |
Value
Character scalar narrative.
Describe Local BEA Data
Description
Describe Local BEA Data
Usage
describe_bea_data(series_id, local_path = NULL)
Arguments
series_id |
Registered series identifier. |
local_path |
Optional BEA storage directory. |
Value
Character scalar narrative.
Describe Binance Data
Description
Fetches Binance OHLCV data and creates a compact narrative for the resulting standardized market table.
Usage
describe_binance_data(
symbol = "ETHUSDT",
interval = "1m",
start_time = NULL,
end_time = NULL,
limit = 1500L,
tz = "UTC",
paginate = TRUE
)
Arguments
symbol |
Trading pair symbol. |
interval |
Candlestick interval. |
start_time |
Optional start time. |
end_time |
Optional end time. |
limit |
Page size. Binance futures allows up to 1500. |
tz |
Time zone applied to returned timestamps. |
paginate |
Logical. Request multiple pages when needed. |
Value
Character scalar narrative.
Describe Local BLS Data
Description
Describe Local BLS Data
Usage
describe_bls_data(series_id, local_path = NULL)
Arguments
series_id |
BLS series identifier. |
local_path |
Optional BLS storage directory. |
Value
Character scalar narrative.
Describe Local Census Data
Description
Describe Local Census Data
Usage
describe_census_data(series_id, local_path = NULL)
Arguments
series_id |
Registered series identifier. |
local_path |
Optional Census storage directory. |
Value
Character scalar narrative.
Describe Local CFTC COT Data
Description
Describe Local CFTC COT Data
Usage
describe_cftc_cot_data(report_id, local_path = NULL)
Arguments
report_id |
Registry report identifier. |
local_path |
Optional CFTC storage directory. |
Value
Character scalar narrative.
Describe Local Crypto Derivatives Data
Description
Describe Local Crypto Derivatives Data
Usage
describe_crypto_derivatives(
provider,
dataset_type,
symbol,
interval = NULL,
local_path = NULL
)
Arguments
provider |
|
dataset_type |
Funding, open-interest, mark/index price, basis, or Binance long-short-ratio dataset identifier. |
symbol |
Provider instrument identifier. |
interval |
Required Binance open-interest period; otherwise a local label. |
local_path |
Optional derivatives storage directory. |
Value
Character scalar narrative.
Describe Local EIA Data
Description
Describe Local EIA Data
Usage
describe_eia_data(series_id, local_path = NULL)
Arguments
series_id |
EIA series identifier. |
local_path |
Optional EIA storage directory. |
Value
Character scalar narrative.
Describe Local Treasury Fiscal Data
Description
Describe Local Treasury Fiscal Data
Usage
describe_fiscaldata(dataset_id, local_path = NULL)
Arguments
dataset_id |
Registry dataset identifier. |
local_path |
Optional Fiscal Data storage directory. |
Value
Character scalar narrative.
Describe FRED Data
Description
Creates a compact narrative describing the structure and meaning of a locally stored FRED series for downstream analyst agents.
Usage
describe_fred_data(
series_id,
local_path = NULL,
registry_path = get_fred_registry_file_path()
)
Arguments
series_id |
FRED series identifier. |
local_path |
Optional local storage path used to read the local series. |
registry_path |
Optional registry path used to resolve series metadata. |
Value
Character scalar narrative.
Describe iShares Data
Description
Creates a compact narrative for locally stored iShares historical fund data.
Usage
describe_ishare_data(ticker, local_path = NULL)
Arguments
ticker |
ETF ticker. |
local_path |
Optional local storage path. |
Value
Character scalar narrative.
Describe Market OHLCV Data
Description
Creates a compact narrative for standardized market OHLCV data.
Usage
describe_market_ohlcv_data(data, source_label = NULL)
Arguments
data |
A standardized OHLCV |
source_label |
Optional source label override. |
Value
Character scalar narrative.
Describe OKX Candle Data
Description
Creates a compact narrative for locally stored OKX candle data.
Usage
describe_okx_candle_data(inst_id, bar, local_path = NULL)
Arguments
inst_id |
Instrument identifier. |
bar |
Candle interval. |
local_path |
Optional local storage path. |
Value
Character scalar narrative.
Describe quantmod Data
Description
Fetches market OHLCV data through quantmod and creates a compact narrative
for the resulting standardized market table.
Usage
describe_quantmod_data(
ticker,
label = ticker,
from = NULL,
to = NULL,
src = "yahoo",
local_path = NULL
)
Arguments
ticker |
Market symbol passed to |
label |
Optional label to store in the standardized |
from |
Start date. If |
to |
End date. If |
src |
quantmod source, default |
local_path |
Optional local storage path used when |
Value
Character scalar narrative.
Describe RSS Data
Description
Creates a compact narrative for locally stored RSS narrative data.
Usage
describe_rss_data(feed_id, local_path = NULL)
Arguments
feed_id |
Local feed identifier. |
local_path |
Optional local storage path. |
Value
Character scalar narrative.
Describe Local SDMX Data
Description
Describe Local SDMX Data
Usage
describe_sdmx_data(series_id, local_path = NULL)
Arguments
series_id |
Registry series identifier. |
local_path |
Optional SDMX storage directory. |
Value
Character scalar narrative.
Describe Local SEC Company Facts
Description
Describe Local SEC Company Facts
Usage
describe_sec_companyfacts(cik, local_path = NULL)
Arguments
cik |
SEC Central Index Key. |
local_path |
Optional SEC Company Facts storage directory. |
Value
Character scalar narrative.
Describe A Local SEC XBRL Frame
Description
Describe A Local SEC XBRL Frame
Usage
describe_sec_frame(taxonomy, tag, unit, period, local_path = NULL)
Arguments
taxonomy |
XBRL taxonomy, such as |
tag |
XBRL concept tag. |
unit |
XBRL unit, such as |
period |
SEC frame period, such as |
local_path |
Optional SEC frame cache directory. |
Value
Character scalar narrative.
Describe Local SEC Submissions
Description
Describe Local SEC Submissions
Usage
describe_sec_submissions(cik, local_path = NULL)
Arguments
cik |
SEC Central Index Key. |
local_path |
Optional SEC submissions storage directory. |
Value
Character scalar narrative.
Describe Treasury Rates
Description
Creates a compact narrative for locally stored Treasury raw rates.
Usage
describe_treasury_rates(dataset, local_path = NULL)
Arguments
dataset |
Treasury dataset key. |
local_path |
Optional local storage path. |
Value
Character scalar narrative.
Describe World Bank Data
Description
Creates a compact narrative for locally stored World Bank indicator data.
Usage
describe_wbstats_data(indicator, country, freq = "Y", local_path)
Arguments
indicator |
World Bank indicator code. |
country |
Country or aggregate code. |
freq |
Frequency code. |
local_path |
Local storage path. |
Value
Character scalar narrative.
Detect Time Gaps
Description
Detects gaps in a local time series using either a fixed or calendar frequency.
Usage
detect_time_gaps(dt, time_col, frequency, tolerance = 1e-04, tz = "UTC")
Arguments
dt |
A data.table-compatible object. |
time_col |
Name of the time column. |
frequency |
Frequency string or candle interval. |
tolerance |
Numeric tolerance applied to fixed-interval gaps. |
tz |
Time zone used when coercing timestamps. |
Value
A data.table describing detected gaps.
Detect Gaps In Local FRED Data
Description
Detect Gaps In Local FRED Data
Usage
detect_time_gaps_fred(x, frequency = NULL, local_path = NULL)
Arguments
x |
A FRED |
frequency |
Optional explicit frequency string. |
local_path |
Optional local storage path if |
Value
A data.table of gaps.
Detect Time Gaps In OKX Candle Data
Description
Detect Time Gaps In OKX Candle Data
Usage
detect_time_gaps_okx_candle(dt, bar = "4H", tolerance = 1e-04)
Arguments
dt |
A candle |
bar |
Candle interval. |
tolerance |
Numeric tolerance for fixed-width gap detection. |
Value
A data.table.
Detect Gaps In Local World Bank Data
Description
Detect Gaps In Local World Bank Data
Usage
detect_time_gaps_wbstats(
x = NULL,
indicator = NULL,
country = NULL,
freq = "Y",
local_path = NULL
)
Arguments
x |
A World Bank |
indicator |
Optional indicator code when reading local data. |
country |
Optional country code when reading local data. |
freq |
Frequency code. |
local_path |
Optional local storage path. |
Value
A data.table of gaps.
Diagnose CNH/USD Cache Differences
Description
Compares the read-only local CNH=X cache with a fresh TLS-verified
Eastmoney 133.USDCNH pull. The resulting JSON and CSV artifacts contain
field-level differences, source timestamps, trading-date labels, provenance,
tolerance calculations, and conservative classifications. This function
never modifies cache or synchronization files and does not create repair
candidates.
Usage
diagnose_cnh_cache_integrity(
local_path = NULL,
output_dir = NULL,
from = NULL,
to = NULL,
overlap_days = 35L
)
Arguments
local_path |
Yahoo Finance cache directory. Defaults to the configured Yahoo Finance data path. |
output_dir |
Directory for diagnostic artifacts. Defaults to
|
from |
Optional inclusive date. Defaults to the recent cache overlap. |
to |
Optional inclusive date. Defaults to the recent cache overlap. |
overlap_days |
Number of calendar days used when |
Details
The Yahoo and Eastmoney identifiers are both interpreted as USD/CNH, meaning
CNH units per one USD. Yahoo's CNH=X is retained as the provider symbol;
Eastmoney's 133.USDCNH is the corresponding provider symbol. Eastmoney
daily labels are reported with the provider's Asia/Shanghai market-date
convention; its HTTP response does not expose a bar timezone explicitly.
Value
A list with summary, field-level differences, and artifact paths.
Fetch Market OHLCV Through quantmod
Description
Returns a standardized OHLCV data.table with common market-schema columns:
source, symbol, interval, datetime, date, open, high, low,
close, and volume.
Usage
fetch_quantmod_OHLC(
ticker,
label = ticker,
from,
to,
src = "yahoo",
raw_data = FALSE,
max_attempts = 3L,
retry_delay_seconds = 1,
fallback_source = NULL,
fallback_ticker = ticker,
require_start_coverage = FALSE
)
Arguments
ticker |
Market symbol passed to |
label |
Optional label to store in the standardized |
from |
Start date. |
to |
End date. |
src |
quantmod source, default |
raw_data |
Logical. If |
max_attempts |
Maximum bounded attempts for a transient source failure. |
retry_delay_seconds |
Initial retry delay in seconds; delays use exponential backoff. |
fallback_source |
Optional explicitly configured fallback provider.
Currently supports |
fallback_ticker |
Optional provider-specific fallback identifier. |
require_start_coverage |
Logical. Require material coverage from |
Details
A row is usable only if open, high, low, and close are finite. Isolated invalid rows are discarded. A window is materially incomplete when its end is more than seven calendar days behind the requested end, or, for an instrument with valid local history, when its start is more than seven calendar days late or fewer than half of the requested weekdays are present. The start rule is not applied to a newly listed instrument, and the calendar-day grace prevents weekend and market-holiday false positives.
Value
data.table or raw xts object when raw_data = TRUE.
Read or Synchronize the ALFRED Registry
Description
Read or Synchronize the ALFRED Registry
Usage
get_alfred_registry(registry_path = NULL)
sync_all_alfred_registry_data(
registry = get_alfred_registry(),
config = NULL,
local_path = NULL,
page_size = 10000L
)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
ALFRED series registry. |
config |
Optional FRED API configuration. |
local_path |
Storage directory. Defaults to |
page_size |
Maximum observations requested per page. |
Value
A registry or per-series batch summary data.table.
Get Alpha Vantage Series Registry
Description
Get Alpha Vantage Series Registry
Usage
get_alphavantage_registry(
registry_path = get_alphavantage_registry_file_path()
)
Arguments
registry_path |
Optional registry JSON path. |
Value
A registry data.table.
Get Alpha Vantage Registry File Path
Description
Get Alpha Vantage Registry File Path
Usage
get_alphavantage_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback. |
Value
Character scalar path.
Get BEA Series Registry
Description
Get BEA Series Registry
Usage
get_bea_registry(registry_path = get_bea_registry_file_path())
Arguments
registry_path |
Optional registry path. |
Value
A registry data.table.
Get BEA Registry File Path
Description
Get BEA Registry File Path
Usage
get_bea_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory. |
Value
Character scalar path.
Get BLS Registry
Description
Get BLS Registry
Usage
get_bls_registry(registry_path = get_bls_registry_file_path())
Arguments
registry_path |
Optional registry path. |
Value
A registry data.table.
Get BLS Registry File Path
Description
Get BLS Registry File Path
Usage
get_bls_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory. |
Value
Character scalar path.
Read or Synchronize the BOJ Registry
Description
Read or Synchronize the BOJ Registry
Usage
get_boj_registry(registry_path = NULL)
sync_all_boj_registry_data(registry = get_boj_registry(), local_path = NULL)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
BOJ series registry. |
local_path |
Directory, defaulting to |
Value
A registry or per-series summary data.table.
Get Census Series Registry
Description
Get Census Series Registry
Usage
get_census_registry(registry_path = get_census_registry_file_path())
Arguments
registry_path |
Optional registry path. |
Value
A registry data.table.
Get Census Registry File Path
Description
Get Census Registry File Path
Usage
get_census_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory. |
Value
Character scalar path.
Read or Synchronize the Census Trade Registry
Description
Read or Synchronize the Census Trade Registry
Usage
get_census_trade_registry(registry_path = NULL)
sync_all_census_trade_registry_data(
registry = get_census_trade_registry(),
to = format(Sys.Date(), "%Y-%m"),
config = NULL,
local_path = NULL
)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
Census trade series registry. |
to |
Inclusive final month in YYYY-MM format. |
config |
Optional Census configuration containing the API key. |
local_path |
Directory, defaulting to |
Value
A registry or per-series summary data.table.
Get CFTC COT Registry
Description
Get CFTC COT Registry
Usage
get_cftc_cot_registry(registry_path = get_cftc_cot_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
A registry data.table.
Get CFTC COT Registry File Path
Description
Get CFTC COT Registry File Path
Usage
get_cftc_cot_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback. |
Value
Character scalar path.
Get Completed Local Daily quantmod OHLC Data
Description
Return only daily OHLC rows whose UTC date is strictly before an explicit cutoff. A finite row dated on the current UTC date is retained in the raw cache but is provisional until the next UTC date.
Usage
get_completed_local_quantmod_OHLC(
label,
src = "yahoo",
interval = "1d",
local_path = NULL,
as_of = as.Date(Sys.time(), tz = "UTC")
)
Arguments
label |
Local symbol label used in the stored data. |
src |
quantmod source, default |
interval |
Interval label. Only |
local_path |
Optional local storage path. |
as_of |
UTC timestamp used to determine the current UTC date. |
Value
data.table or NULL.
Read or Synchronize the UN Comtrade Registry
Description
Read or Synchronize the UN Comtrade Registry
Usage
get_comtrade_registry(registry_path = NULL)
sync_all_comtrade_registry_data(
registry = get_comtrade_registry(),
years = NULL,
local_path = NULL
)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
Annual UN Comtrade series registry. |
years |
Optional annual reporting periods. Defaults to the registry start year through the most recently ended calendar year, capped at 20 years. |
local_path |
Directory, defaulting to |
Value
A registry or per-series summary data.table.
Get Crypto Derivatives Registry
Description
Get Crypto Derivatives Registry
Usage
get_crypto_derivatives_registry(
registry_path = get_crypto_derivatives_registry_file_path()
)
Arguments
registry_path |
Optional JSON registry path. |
Value
A registry data.table.
Get Crypto Derivatives Registry File Path
Description
Get Crypto Derivatives Registry File Path
Usage
get_crypto_derivatives_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback. |
Value
Character scalar path.
Get EIA Series Registry
Description
Get EIA Series Registry
Usage
get_eia_registry(registry_path = get_eia_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
A registry data.table.
Get EIA Registry File Path
Description
Get EIA Registry File Path
Usage
get_eia_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback. |
Value
Character scalar path.
Read Endpoint Access Settings
Description
Merge packaged defaults with field-level overrides under EndpointAccess
in the runtime YAML. The china field means mainland China, hk means
Hong Kong, and vpn means VPN egress. Settings are advisory and have no
effect on Investdatar requests, routing, or synchronization.
Usage
get_endpoint_access(config = NULL, endpoint_ids = NULL)
Arguments
config |
Optional parsed package configuration. When omitted, use the
loaded configuration or the file specified by |
endpoint_ids |
Optional vector of endpoint IDs to return in order.
Unregistered IDs return |
Value
A data.frame with columns endpoint_id, china, vpn, and
hk. Access values are allowed, restricted, or unknown.
Read or Synchronize the FDIC Registry
Description
Read or Synchronize the FDIC Registry
Usage
get_fdic_registry(registry_path = NULL)
sync_all_fdic_registry_data(
registry = get_fdic_registry(),
local_path = NULL,
to = Sys.Date(),
page_size = 100L
)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
FDIC certificate registry. |
local_path |
Directory, defaulting to |
to |
Inclusive report-date end bound. |
page_size |
Records per request, from 1 to 1000. |
Value
A registry or per-bank summary data.table.
Get Treasury Fiscal Data Registry
Description
Get Treasury Fiscal Data Registry
Usage
get_fiscaldata_registry(registry_path = get_fiscaldata_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
A registry data.table.
Get Treasury Fiscal Data Registry File Path
Description
Get Treasury Fiscal Data Registry File Path
Usage
get_fiscaldata_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback. |
Value
Character scalar path.
Get FRED Registry
Description
Get FRED Registry
Usage
get_fred_registry(registry_path = get_fred_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
data.table.
Get FRED Registry File Path
Description
Resolve the JSON registry path for FRED metadata. If no explicit
registry_file is configured, the function falls back to a default filename
in the package config directory.
Usage
get_fred_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for the fallback registry path. |
Value
Character scalar path.
Read or Synchronize the HKMA Registry
Description
Read or Synchronize the HKMA Registry
Usage
get_hkma_registry(registry_path = NULL)
sync_all_hkma_registry_data(
registry = get_hkma_registry(),
from = Sys.Date() - 90L,
to = Sys.Date(),
local_path = NULL,
page_size = 500L
)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
HKMA dataset registry. |
from, to |
Inclusive observation-date bounds. |
local_path |
Directory, defaulting to |
page_size |
Page size from 1 to 1000. |
Value
A registry or per-dataset summary data.table.
Get the Instrument Catalog
Description
Returns factual, provider-neutral market-instrument metadata for downstream
consumers. It deliberately excludes editorial, ranking, simulation, and
execution fields. canonical_symbol is a consumer identity, not a provider
symbol. Current Yahoo local-cache access and synchronization resolve through
provider_identifiers$yahoo; do not pass canonical_symbol directly to
get_completed_local_quantmod_OHLC(). primary_source describes intended
routing; actual row-level provenance remains the source recorded by
synchronization.
Usage
get_instrument_catalog(
catalog_path = .instrument_catalog_seed_path(),
yahoo_registry_path = get_yahoofinance_seed_registry_path(),
validate = TRUE,
schema_version = "1.0.0"
)
Arguments
catalog_path |
Path to a catalog JSON file. Defaults to the packaged seed. |
yahoo_registry_path |
Path to the Yahoo Finance sync registry. Defaults to the packaged seed registry so the catalog is usable without a runtime configuration file. Pass a runtime registry path to validate that runtime registry explicitly. |
validate |
Logical. When |
schema_version |
Output schema. The default |
Value
A data.table with one row per instrument. provider_identifiers,
primary_source, fallback_sources, and supported_intervals are list
columns that preserve their JSON mapping or array structure.
Get Package Configuration
Description
Returns the cached package configuration, loading it from YAML if needed.
Usage
get_investdatar_config(
reload = FALSE,
config_path = Sys.getenv("INVESTDATAR_CONFIG", unset = "")
)
Arguments
reload |
Logical. Reload from disk even if configuration is already cached. |
config_path |
Optional config path used when |
Value
A configuration list.
Get iShares Registry
Description
Get iShares Registry
Usage
get_ishare_registry(registry_path = get_ishare_registry_file_path())
Arguments
registry_path |
Optional registry JSON path. |
Value
data.table.
Get iShares Registry File Path
Description
Get iShares Registry File Path
Usage
get_ishare_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback lookup. |
Value
Character scalar path.
Get The Latest Batch Sync Run Log
Description
Get The Latest Batch Sync Run Log
Usage
get_latest_sync_run(source_id, local_path)
Arguments
source_id |
Source identifier used for the sync log filename prefix. |
local_path |
Local source data path that contains the |
Value
A run-log list, or NULL when no matching log file exists.
Get Local FRED Data
Description
Get Local FRED Data
Usage
get_local_FRED_data(series_id, local_path = NULL)
Arguments
series_id |
FRED series identifier. |
local_path |
Optional local storage path. |
Value
data.table or NULL.
Read or Synchronize Local ALFRED Vintages
Description
Read or Synchronize Local ALFRED Vintages
Usage
get_local_alfred_data(series_id, local_path = NULL, as_of = NULL)
sync_local_alfred_data(
series_id,
config = NULL,
local_path = NULL,
page_size = 10000L
)
Arguments
series_id |
FRED series ID. |
local_path |
Storage directory. Defaults to |
as_of |
Optional date. Return only values whose inclusive real-time interval contains that date. |
config |
Optional FRED API configuration. |
page_size |
Maximum observations requested per page. |
Value
A data.table or NULL for a read, or a synchronization result.
Read Local Alpha Vantage Daily Data
Description
Read Local Alpha Vantage Daily Data
Usage
get_local_alphavantage_data(symbol, local_path = NULL)
Arguments
symbol |
Market symbol. |
local_path |
Optional Alpha Vantage storage directory. |
Value
A standardized market data.table, or NULL.
Read Local BEA Data
Description
Read Local BEA Data
Usage
get_local_bea_data(series_id, local_path = NULL)
Arguments
series_id |
Registered series identifier. |
local_path |
Optional BEA storage directory. |
Value
A data.table, or NULL.
Get Local Binance Kline Data
Description
Get Local Binance Kline Data
Usage
get_local_binance_klines(
symbol = "ETHUSDT",
interval = "1m",
local_path = NULL,
storage = c("single", "monthly"),
from = NULL,
to = NULL
)
Arguments
symbol |
Trading pair symbol. |
interval |
Candlestick interval. |
local_path |
Optional Binance storage path. |
storage |
Local storage mode: monolithic |
from, to |
Optional bounds used to prune monthly partitions before read. |
Value
data.table or NULL.
Read Local BLS Data
Description
Read Local BLS Data
Usage
get_local_bls_data(series_id, local_path = NULL)
Arguments
series_id |
BLS series identifier. |
local_path |
Optional BLS storage directory. |
Value
A data.table, or NULL.
Read or Synchronize Local Bank of Japan Data
Description
Read or Synchronize Local Bank of Japan Data
Usage
get_local_boj_data(series_id, local_path = NULL)
sync_local_boj_data(
series_id,
database,
code,
from = NULL,
to = NULL,
local_path = NULL
)
Arguments
series_id |
Local registry identifier. |
local_path |
Directory, defaulting to |
database |
BOJ database identifier. |
code |
Provider series code without the database prefix. |
from, to |
Optional provider query bounds. Use YYYYMM for daily and monthly databases, YYYYQQ for quarterly databases, or YYYY for annual data. |
Value
A data.table or NULL for a read, or a sync result.
Read Local Census Data
Description
Read Local Census Data
Usage
get_local_census_data(series_id, local_path = NULL)
Arguments
series_id |
Registered series identifier. |
local_path |
Optional Census storage directory. |
Value
A data.table, or NULL.
Read or Synchronize Local Census Trade Data
Description
Read or Synchronize Local Census Trade Data
Usage
get_local_census_trade_data(series_id, local_path = NULL)
sync_local_census_trade_data(
series_id,
direction,
country_code,
commodity_code,
from,
to = format(Sys.Date(), "%Y-%m"),
config = NULL,
local_path = NULL
)
Arguments
series_id |
Local registry identifier. |
local_path |
Directory, defaulting to |
direction |
|
country_code |
Four-character Census Schedule C partner code. |
commodity_code |
Harmonized System product code of 2, 4, 6, or 10 digits. |
from, to |
Inclusive month bounds in YYYY-MM format. |
config |
Optional Census configuration containing the API key. |
Value
A data.table or NULL for a read, or a sync result.
Read Local CFTC COT Data
Description
Read Local CFTC COT Data
Usage
get_local_cftc_cot(report_id, local_path = NULL)
Arguments
report_id |
Registry report identifier. |
local_path |
Optional CFTC storage directory. |
Value
A data.table, or NULL when no local file exists.
Read or Synchronize Local UN Comtrade Data
Description
Read or Synchronize Local UN Comtrade Data
Usage
get_local_comtrade_data(series_id, local_path = NULL)
sync_local_comtrade_data(
series_id,
reporter_code,
partner_code,
commodity_code,
flow,
periods,
frequency = c("A", "M"),
local_path = NULL
)
Arguments
series_id |
Local registry identifier. |
local_path |
Directory, defaulting to |
reporter_code |
UN M49 reporter code. |
partner_code |
UN M49 partner code, or zero for the world aggregate. |
commodity_code |
HS product code or |
flow |
|
periods |
Up to 20 reporting periods, one request per period. Use YYYY for annual data and YYYYMM for monthly data. |
frequency |
|
Value
A data.table or NULL for a read, or a sync result.
Read Local Crypto Derivatives Data
Description
Read Local Crypto Derivatives Data
Usage
get_local_crypto_derivatives(
provider,
dataset_type,
symbol,
interval = NULL,
local_path = NULL,
storage = c("single", "monthly"),
from = NULL,
to = NULL
)
Arguments
provider |
|
dataset_type |
Funding, open-interest, mark/index price, basis, or Binance long-short-ratio dataset identifier. |
symbol |
Provider instrument identifier. |
interval |
Required Binance open-interest period; otherwise a local label. |
local_path |
Optional derivatives storage directory. |
storage |
Local storage mode: monolithic |
from, to |
Optional inclusive UTC time bounds. |
Value
A data.table, or NULL.
Get Local Data Metadata
Description
Get Local Data Metadata
Usage
get_local_data_meta(local_file_path, fallback_to_file_mtime = TRUE)
Arguments
local_file_path |
Path to a local |
fallback_to_file_mtime |
Logical. If no sidecar metadata file exists, use the data file modification time. |
Value
A list of metadata, or NULL.
Read Monthly Partitioned Local Data
Description
Reads a dataset stored as monthly RDS partitions. Time bounds are applied to partition discovery before files are loaded. If no partition directory exists, an existing monolithic RDS file is read for backward compatibility.
Usage
get_local_data_partitioned(
local_file_path,
time_col,
from = NULL,
to = NULL,
order_cols = time_col,
tz = "UTC"
)
Arguments
local_file_path |
Virtual monolithic |
time_col |
Name of the partition timestamp column. |
from, to |
Optional inclusive time bounds. |
order_cols |
Optional output ordering columns. |
tz |
Time zone used to determine month boundaries. |
Value
A data.table, or NULL when no local data exists.
Get Local Update Time
Description
Get Local Update Time
Usage
get_local_data_utime(local_file_path)
Arguments
local_file_path |
Path to a local |
Value
POSIXct or NULL.
Read Local EIA Data
Description
Read Local EIA Data
Usage
get_local_eia_data(series_id, local_path = NULL)
Arguments
series_id |
EIA series identifier. |
local_path |
Optional EIA storage directory. |
Value
A data.table, or NULL.
Read or Synchronize Local FDIC Financials
Description
Read or Synchronize Local FDIC Financials
Usage
get_local_fdic_data(cert, local_path = NULL)
sync_local_fdic_data(
cert,
from = "2020-01-01",
to = Sys.Date(),
local_path = NULL,
page_size = 100L
)
Arguments
cert |
FDIC institution certificate number. |
local_path |
Directory, defaulting to |
from, to |
Inclusive report-date bounds. |
page_size |
Records per request, from 1 to 1000. |
Value
A data.table or NULL for a read, or a sync result.
Read Local Treasury Fiscal Data
Description
Read Local Treasury Fiscal Data
Usage
get_local_fiscaldata(dataset_id, local_path = NULL)
Arguments
dataset_id |
Registry dataset identifier. |
local_path |
Optional Fiscal Data storage directory. |
Value
A data.table, or NULL.
Read Provider-Neutral Local Fund Holdings
Description
Read Provider-Neutral Local Fund Holdings
Usage
get_local_fund_holdings(provider, fund_id, local_path = NULL)
Arguments
provider |
Fund issuer/provider identifier. |
fund_id |
Fund ticker or stable identifier. |
local_path |
Optional generic holdings storage root. |
Value
A provider-neutral data.table, or NULL.
Read or Synchronize Local HKMA Data
Description
Read or Synchronize Local HKMA Data
Usage
get_local_hkma_data(dataset_id, local_path = NULL)
sync_local_hkma_data(
dataset_id,
from = Sys.Date() - 90L,
to = Sys.Date(),
local_path = NULL,
page_size = 500L
)
Arguments
dataset_id |
|
local_path |
Directory, defaulting to |
from, to |
Inclusive observation-date bounds. |
page_size |
Page size from 1 to 1000. |
Value
A data.table or NULL for a read, or a sync result.
Get Local iShares Historical Data
Description
Get Local iShares Historical Data
Usage
get_local_ishare_data(ticker, local_path = NULL)
Arguments
ticker |
ETF ticker. |
local_path |
Optional local storage path. |
Value
data.table or NULL.
Get Local iShares Holdings Data
Description
Get Local iShares Holdings Data
Usage
get_local_ishare_holdings(ticker, local_path = NULL)
Arguments
ticker |
ETF ticker. |
local_path |
Optional local storage path. |
Value
data.table or NULL.
Convert Cached iShares Holdings To The Neutral Contract
Description
Convert Cached iShares Holdings To The Neutral Contract
Usage
get_local_ishare_holdings_standardized(ticker, local_path = NULL)
Arguments
ticker |
iShares fund ticker. |
local_path |
Optional iShares storage directory. |
Value
A provider-neutral holdings data.table, or NULL.
Get Local iShares Metadata Snapshot
Description
Get Local iShares Metadata Snapshot
Usage
get_local_ishare_mega_data(local_path = NULL)
Arguments
local_path |
Optional local storage path. |
Value
data.table or NULL.
Read or Synchronize Local New York Fed Markets Data
Description
Read or Synchronize Local New York Fed Markets Data
Usage
get_local_nyfed_data(dataset_id, local_path = NULL)
sync_local_nyfed_data(
dataset_id,
from = Sys.Date() - 30L,
to = Sys.Date(),
local_path = NULL,
series_ids = c("PDPOSMBS-TOT", "PDSORA-UTSETTOT", "PDFTD-USTET")
)
Arguments
dataset_id |
One of |
local_path |
Storage directory. Defaults to |
from, to |
Inclusive observation-date bounds. |
series_ids |
Primary dealer series IDs. Defaults to the shipped panel. |
Value
The reader returns a data.table or NULL. The synchronizer returns a sync result.
Read or Synchronize Local OFR Data
Description
Read or Synchronize Local OFR Data
Usage
get_local_ofr_data(mnemonic, monitor = c("stfm", "hfm"), local_path = NULL)
sync_local_ofr_data(
mnemonic,
monitor = c("stfm", "hfm"),
from = NULL,
to = NULL,
local_path = NULL
)
Arguments
mnemonic |
Provider series mnemonic. |
monitor |
|
local_path |
Storage directory. Defaults to |
from, to |
Optional inclusive observation-date bounds. |
Value
A data.table or NULL for a read, or a sync result.
Get Local OKX Candle Data
Description
Get Local OKX Candle Data
Usage
get_local_okx_candle(
inst_id,
bar,
local_path = NULL,
storage = c("single", "monthly"),
from = NULL,
to = NULL
)
Arguments
inst_id |
Instrument identifier. |
bar |
Candle interval. |
local_path |
Optional OKX storage path. |
storage |
Local storage mode: monolithic |
from, to |
Optional bounds used to prune monthly partitions before read. |
Value
data.table or NULL.
Read or Synchronize Local World Bank QEDS
Description
Read or Synchronize Local World Bank QEDS
Usage
get_local_qeds_data(series_id, local_path = NULL)
sync_local_qeds_data(
series_id,
source_id,
country,
indicator,
from = NULL,
to = NULL,
local_path = NULL,
page_size = 100L
)
Arguments
series_id |
Local registry identifier. |
local_path |
Directory, defaulting to |
source_id |
World Bank source 22 (SDDS) or 23 (GDDS). |
country |
Three-letter World Bank economy code. |
indicator |
Source-specific QEDS indicator code. |
from, to |
Optional inclusive quarter bounds in YYYY-Qn format. |
page_size |
Results per request, from 1 to 1000. |
Value
A data.table or NULL for a read, or a sync result.
Get Local quantmod OHLC Data
Description
Get Local quantmod OHLC Data
Usage
get_local_quantmod_OHLC(
label,
src = "yahoo",
interval = "1d",
local_path = NULL
)
Arguments
label |
Local symbol label used in the stored data. |
src |
quantmod source, default |
interval |
Interval label, default |
local_path |
Optional local storage path. |
Value
data.table or NULL.
Get Local RSS Data
Description
Get Local RSS Data
Usage
get_local_rss_data(feed_id, local_path = NULL)
Arguments
feed_id |
Local feed identifier. |
local_path |
Optional local storage path. |
Value
data.table or NULL.
Read Local SDMX Data
Description
Read Local SDMX Data
Usage
get_local_sdmx_data(series_id, local_path = NULL)
Arguments
series_id |
Registry series identifier. |
local_path |
Optional SDMX storage directory. |
Value
A data.table, or NULL.
Read Local SEC Company Facts
Description
Read Local SEC Company Facts
Usage
get_local_sec_companyfacts(cik, local_path = NULL)
Arguments
cik |
SEC Central Index Key. |
local_path |
Optional SEC Company Facts storage directory. |
Value
A data.table, or NULL.
Read A Local SEC XBRL Frame
Description
Read A Local SEC XBRL Frame
Usage
get_local_sec_frame(taxonomy, tag, unit, period, local_path = NULL)
Arguments
taxonomy |
XBRL taxonomy, such as |
tag |
XBRL concept tag. |
unit |
XBRL unit, such as |
period |
SEC frame period, such as |
local_path |
Optional SEC frame cache directory. |
Value
A cached data.table, or NULL.
Read or Synchronize Local Holdings From an SEC N-PORT Filing
Description
Read or Synchronize Local Holdings From an SEC N-PORT Filing
Usage
get_local_sec_nport_data(cik, accession_number, local_path = NULL)
sync_local_sec_nport_data(
cik,
accession_number,
primary_document = "primary_doc.xml",
local_path = NULL,
config = NULL
)
Arguments
cik |
SEC Central Index Key. |
accession_number |
Filing accession number. |
local_path |
Storage directory. Defaults to the SEC cache's nport subdirectory. |
primary_document |
Primary filing document name from submissions data. |
config |
Optional SEC configuration. |
Value
A data.table or NULL for a read, or a synchronization result.
Read Local SEC Submissions
Description
Read Local SEC Submissions
Usage
get_local_sec_submissions(cik, local_path = NULL)
Arguments
cik |
SEC Central Index Key. |
local_path |
Optional SEC submissions storage directory. |
Value
A data.table, or NULL.
Read or Synchronize Local Treasury International Capital Data
Description
Read or Synchronize Local Treasury International Capital Data
Usage
get_local_tic_data(local_path = NULL)
sync_local_tic_data(
series_ids = .tic_default_series,
local_path = NULL,
archive_path = NULL
)
Arguments
local_path |
Storage directory. Defaults to |
series_ids |
Treasury CSLT source IDs. The default selects mainland China and Japan holdings and net transactions in long-term U.S. Treasuries. |
archive_path |
Optional existing official CSLT ZIP. When omitted, downloads the Treasury archive once. |
Value
A data.table or NULL for a read, or a synchronization result.
Get Local Treasury Rates
Description
Get Local Treasury Rates
Usage
get_local_treasury_rates(dataset, local_path = NULL)
Arguments
dataset |
Treasury dataset key. |
local_path |
Optional local storage path. |
Value
data.table or NULL.
Get Local World Bank Data
Description
Get Local World Bank Data
Usage
get_local_wbstats_data(indicator, country, freq = "Y", local_path = NULL)
Arguments
indicator |
World Bank indicator code. |
country |
Country or aggregate code. |
freq |
Frequency code. |
local_path |
Optional local storage path. |
Value
data.table or NULL.
Get the New York Fed Markets Registry
Description
Get the New York Fed Markets Registry
Usage
get_nyfed_registry(registry_path = NULL)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
Value
A registry data.table.
Read or Synchronize the OFR Registry
Description
Read or Synchronize the OFR Registry
Usage
get_ofr_registry(registry_path = NULL)
sync_all_ofr_registry_data(
registry = get_ofr_registry(),
local_path = NULL,
from = NULL,
to = NULL
)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
OFR mnemonic and monitor registry. |
local_path |
Storage directory. Defaults to |
from, to |
Optional inclusive observation-date bounds. |
Value
A registry or per-series batch summary data.table.
Get the 4-Hour OKX Perpetual Catalog
Description
Returns the provider-neutral 4-hour OKX perpetual-swap subset. Its
canonical_symbol values are consumer identities; local cache access uses
provider_identifiers$okx with get_local_okx_candle(). Contract metadata
describes OKX linear USDT-margined perpetuals; actual cached row provenance
remains in the synchronized data.
Usage
get_okx_perpetual_catalog(
catalog_path = .instrument_catalog_seed_path(),
local_path = NULL,
as_of = Sys.time(),
validate = TRUE
)
Arguments
catalog_path |
Path to a catalog JSON file. Defaults to the packaged seed. |
local_path |
Optional local OKX candle-cache directory. Supplying it enables catalog-to-cache validation. |
as_of |
UTC time used to exclude cache rows at or after the cutoff. |
validate |
Logical. Validate the catalog before returning it. |
Value
A data.table with one row per 4-hour OKX perpetual instrument.
Read or Synchronize the QEDS Registry
Description
Read or Synchronize the QEDS Registry
Usage
get_qeds_registry(registry_path = NULL)
sync_all_qeds_registry_data(
registry = get_qeds_registry(),
local_path = NULL,
page_size = 100L
)
Arguments
registry_path |
Optional JSON file. Defaults to the configured registry or the package seed. |
registry |
QEDS series registry. |
local_path |
Directory, defaulting to |
page_size |
Results per request, from 1 to 1000. |
Value
A registry or per-series summary data.table.
Get RSS Registry
Description
Get RSS Registry
Usage
get_rss_registry(registry_path = get_rss_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
data.table.
Get RSS Registry File Path
Description
Resolve the JSON registry path for RSS feed metadata. If no explicit
registry_file is configured, the function falls back to a default filename
in the package config directory.
Usage
get_rss_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for the fallback registry path. |
Value
Character scalar path.
Get SDMX Series Registry
Description
Get SDMX Series Registry
Usage
get_sdmx_registry(registry_path = get_sdmx_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
A registry data.table.
Get SDMX Registry File Path
Description
Get SDMX Registry File Path
Usage
get_sdmx_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback. |
Value
Character scalar path.
Retrieve SEC Ticker-CIK Mappings
Description
Retrieve SEC Ticker-CIK Mappings
Usage
get_sec_company_tickers(config = NULL)
Arguments
config |
Optional SEC configuration containing an identifiable user agent. |
Value
A data.table with cik, company_name, ticker, and exchange.
Get SEC Frames Registry
Description
Get SEC Frames Registry
Usage
get_sec_frames_registry(registry_path = get_sec_frames_registry_file_path())
Arguments
registry_path |
Optional registry path. |
Value
A registry data.table.
Get SEC Frames Registry File Path
Description
Get SEC Frames Registry File Path
Usage
get_sec_frames_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory. |
Value
Character scalar path.
Get SEC Company Registry
Description
Get SEC Company Registry
Usage
get_sec_registry(registry_path = get_sec_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
A registry data.table.
Get SEC Company Registry File Path
Description
Get SEC Company Registry File Path
Usage
get_sec_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for fallback. |
Value
Character scalar path.
Get Source Configuration
Description
Returns the configuration block for a named source.
Usage
get_source_config(source, config = get_investdatar_config())
Arguments
source |
Character source name. |
config |
Optional package config list. |
Value
A list, or an empty list if the source is not configured.
Retrieve ALFRED Observation Vintages
Description
Retrieve ALFRED Observation Vintages
Usage
get_source_data_alfred(
series_id,
config = NULL,
from = NULL,
to = NULL,
page_size = 10000L
)
Arguments
series_id |
FRED series ID. |
config |
Optional FRED API configuration. |
from, to |
Optional inclusive observation-date bounds. |
page_size |
Maximum observations requested per page. |
Value
A data.table with date, value and inclusive real-time validity bounds, or NULL for a successful empty result.
Fetch Daily Time Series from AlphaVantage
Description
Retrieves daily historical stock data (open, high, low, close, volume) for a given symbol
using the AlphaVantage API. You can specify whether to retrieve only recent data
("compact") or the full history ("full").
The returned object follows the package's standardized market OHLCV schema.
Usage
get_source_data_alphavantage_ts_daily(
symbol,
mode = c("compact", "full"),
config = NULL
)
Arguments
symbol |
A character string for the stock ticker symbol (e.g., |
mode |
Character string; either |
config |
A list of AlphaVantage API settings, typically retrieved via |
Value
A data.table with standardized columns including source,
symbol, interval, datetime, date, open, high, low, close,
and volume.
datetimeMidnight timestamp derived from the trading date.
dateDate of the observation.
openOpening price.
highHighest price of the day.
lowLowest price of the day.
closeClosing price.
volumeVolume of trades.
Examples
## Not run:
config <- list(api_key = Sys.getenv("ALPHAVANTAGE_API_KEY"))
df <- get_source_data_alphavantage_ts_daily("MSFT", mode = "compact", config = config)
head(df)
## End(Not run)
Retrieve BEA Regional Data
Description
Retrieve BEA Regional Data
Usage
get_source_data_bea(
series_id,
table_name,
line_code,
geofips = "STATE",
year = "ALL",
label = NULL,
config = NULL
)
Arguments
series_id |
Stable local series identifier. |
table_name |
BEA Regional table name. |
line_code |
BEA line code. |
geofips |
Geography selector such as |
year |
Year selector, default |
label |
Optional local label. |
config |
Optional BEA configuration. |
Value
A standardized regional panel.
Fetch Kline Data from Binance Futures API
Description
Retrieves candlestick data from Binance USDT-margined futures. If
paginate = TRUE, the function keeps requesting pages until the requested
time range is exhausted or the API returns fewer rows than limit.
Usage
get_source_data_binance_klines(
symbol = "ETHUSDT",
interval = "1m",
start_time = NULL,
end_time = NULL,
limit = 1500L,
tz = "UTC",
paginate = TRUE
)
Arguments
symbol |
Trading pair symbol. |
interval |
Candlestick interval. |
start_time |
Optional start time. |
end_time |
Optional end time. |
limit |
Page size. Binance futures allows up to 1500. |
tz |
Time zone applied to returned timestamps. |
paginate |
Logical. Request multiple pages when needed. |
Value
Standardized OHLCV data.table with source, symbol, interval,
datetime, date, open, high, low, close, and volume, plus
Binance-specific columns such as close_time and trade counts.
Retrieve One BLS Series
Description
Retrieve One BLS Series
Usage
get_source_data_bls(
series_id,
label = NULL,
from = NULL,
to = NULL,
config = NULL
)
Arguments
series_id |
BLS series identifier. |
label |
Optional local label. |
from, to |
Optional year or date bounds. |
config |
Optional BLS configuration. |
Value
A standardized monthly data.table.
Retrieve One Bank of Japan Series
Description
Retrieve One Bank of Japan Series
Usage
get_source_data_boj(database, code, from = NULL, to = NULL)
Arguments
database |
BOJ database identifier. |
code |
Provider series code without the database prefix. |
from, to |
Optional provider query bounds. Use YYYYMM for daily and monthly databases, YYYYQQ for quarterly databases, or YYYY for annual data. |
Value
A long data.table, or NULL for a successful empty response.
Retrieve A Selected Census Economic Indicator Series
Description
Retrieve A Selected Census Economic Indicator Series
Usage
get_source_data_census(
series_id,
dataset,
data_type_code,
category_code,
seasonally_adj = "yes",
from = NULL,
to = NULL,
label = NULL,
config = NULL
)
Arguments
series_id |
Stable local series identifier. |
dataset |
Economic Indicators dataset suffix, such as |
data_type_code |
Census item type code. |
category_code |
Census industry/category code. |
seasonally_adj |
Seasonal adjustment value. |
from, to |
Optional time bounds. |
label |
Optional local label. |
config |
Optional Census configuration. |
Value
A standardized long data.table.
Retrieve Monthly U.S. Census International Goods Trade
Description
Retrieve Monthly U.S. Census International Goods Trade
Usage
get_source_data_census_trade(
direction = c("imports", "exports"),
country_code,
commodity_code,
from,
to = format(Sys.Date(), "%Y-%m"),
config = NULL
)
Arguments
direction |
|
country_code |
Four-character Census Schedule C partner code. |
commodity_code |
Harmonized System product code of 2, 4, 6, or 10 digits. |
from, to |
Inclusive month bounds in YYYY-MM format. |
config |
Optional Census configuration containing the API key. |
Value
A data.table of nominal monthly U.S. dollar trade values, or NULL for an empty response. Imports are general imports. Exports are total exports.
Retrieve CFTC Commitments Of Traders Data
Description
Retrieves TFF, Disaggregated, or Legacy reports from the CFTC Public Reporting Environment.
Usage
get_source_data_cftc_cot(
report_variant = c("futures_only", "combined"),
report_type = "tff",
report_id = NULL,
dataset_id = NULL,
market_codes = NULL,
from = NULL,
to = NULL,
page_size = 5000L,
max_pages = Inf
)
Arguments
report_variant |
Report variant: |
report_type |
Report family: |
report_id |
Stable local report identifier. |
dataset_id |
Optional official Socrata dataset identifier. |
market_codes |
Optional CFTC contract-market codes. |
from, to |
Optional inclusive report-date bounds. |
page_size |
Number of source rows requested per page. |
max_pages |
Optional page limit, primarily useful for diagnostics. |
Value
A standardized wide data.table, one row per market and report date.
Retrieve a Bounded UN Comtrade Goods Series
Description
Retrieve a Bounded UN Comtrade Goods Series
Usage
get_source_data_comtrade(
reporter_code,
partner_code,
commodity_code,
flow,
periods,
frequency = c("A", "M")
)
Arguments
reporter_code |
UN M49 reporter code. |
partner_code |
UN M49 partner code, or zero for the world aggregate. |
commodity_code |
HS product code or |
flow |
|
periods |
Up to 20 reporting periods, one request per period. Use YYYY for annual data and YYYYMM for monthly data. |
frequency |
|
Value
A data.table of published trade aggregates, or NULL for no observations.
Retrieve Historical Crypto Derivatives Data
Description
Retrieve Historical Crypto Derivatives Data
Usage
get_source_data_crypto_derivatives(
provider,
dataset_type,
symbol,
interval = NULL,
from = NULL,
to = NULL,
limit = NULL,
config = NULL
)
Arguments
provider |
|
dataset_type |
Funding, open-interest, mark/index price, basis, or Binance long-short-ratio dataset identifier. |
symbol |
Provider instrument identifier. |
interval |
Required Binance open-interest period; otherwise a local label. |
from, to |
Optional inclusive UTC time bounds. |
limit |
Provider page size. |
config |
Optional exchange configuration. |
Value
A standardized data.table retaining provider fields.
Retrieve One EIA Series
Description
Retrieve One EIA Series
Usage
get_source_data_eia(
series_id,
label = NULL,
config = NULL,
from = NULL,
to = NULL,
page_size = 5000L,
max_pages = Inf
)
Arguments
series_id |
EIA series identifier. |
label |
Optional local label. |
config |
Optional EIA API configuration. |
from, to |
Optional inclusive period bounds. |
page_size |
Number of observations requested per page. |
max_pages |
Optional page limit for diagnostics. |
Value
A standardized long data.table.
Retrieve Quarterly FDIC BankFind Financials
Description
Retrieve Quarterly FDIC BankFind Financials
Usage
get_source_data_fdic(
cert,
from = "2020-01-01",
to = Sys.Date(),
page_size = 100L
)
Arguments
cert |
FDIC institution certificate number. |
from, to |
Inclusive report-date bounds. |
page_size |
Records per request, from 1 to 1000. |
Value
A data.table, or NULL for an empty response. Monetary fields use the provider's thousands of U.S. dollars.
Retrieve A U.S. Treasury Fiscal Data Table
Description
Retrieve A U.S. Treasury Fiscal Data Table
Usage
get_source_data_fiscaldata(
dataset_id,
endpoint,
date_col = "record_date",
key_cols = date_col,
fields = NULL,
from = NULL,
to = NULL,
page_size = 10000L,
max_pages = Inf
)
Arguments
dataset_id |
Stable local dataset identifier. |
endpoint |
Fiscal Data endpoint relative to the fiscal-service base URL. |
date_col |
Source date column. |
key_cols |
Source columns that uniquely identify observations per date. |
fields |
Optional source fields to request. |
from, to |
Optional inclusive date bounds. |
page_size |
Number of source rows requested per page. |
max_pages |
Optional page limit for diagnostics. |
Value
A typed, table-shaped data.table with source and dataset identity.
Get FRED Series Data
Description
Download a FRED series and return dates and numeric values.
Usage
get_source_data_fred(series_id, config = NULL)
Arguments
series_id |
Character. FRED series ID (e.g., "DGS10"). |
config |
Optional list with fields: |
Value
data.table with columns: date (Date), value (numeric, NA for ".").
Retrieve HKMA Daily Monetary Statistics
Description
Retrieve HKMA Daily Monetary Statistics
Usage
get_source_data_hkma(
dataset_id,
from = Sys.Date() - 90L,
to = Sys.Date(),
page_size = 500L
)
Arguments
dataset_id |
|
from, to |
Inclusive observation-date bounds. |
page_size |
Page size from 1 to 1000. |
Value
A data.table retaining source fields, or NULL for an empty response.
Get iShares Historical Data
Description
Downloads and parses the historical sheet for a single iShares fund using the local iShares registry metadata.
Usage
get_source_data_ishare(
ticker,
ishare_mega_data = NULL,
cache_dir = NULL,
local_path = NULL
)
Arguments
ticker |
ETF ticker. |
ishare_mega_data |
Optional iShares registry table. |
cache_dir |
Optional download cache directory. |
local_path |
Optional local storage path used to resolve defaults. |
Value
data.table.
Get iShares Holdings Data
Description
Downloads and parses the holdings sheet for a single iShares fund using the local iShares registry metadata.
Usage
get_source_data_ishare_holdings(
ticker,
ishare_mega_data = NULL,
cache_dir = NULL,
local_path = NULL
)
Arguments
ticker |
ETF ticker. |
ishare_mega_data |
Optional iShares registry table. |
cache_dir |
Optional download cache directory. |
local_path |
Optional local storage path used to resolve defaults. |
Value
data.table.
Retrieve New York Fed Markets Data
Description
Retrieve New York Fed Markets Data
Usage
get_source_data_nyfed(
dataset_id,
from = Sys.Date() - 30L,
to = Sys.Date(),
series_ids = c("PDPOSMBS-TOT", "PDSORA-UTSETTOT", "PDFTD-USTET")
)
Arguments
dataset_id |
One of |
from, to |
Inclusive observation-date bounds. |
series_ids |
Primary dealer series IDs. Defaults to the shipped panel. |
Value
A data.table retaining provider fields, or NULL for a successful empty response.
Retrieve an Office of Financial Research Series
Description
Retrieve an Office of Financial Research Series
Usage
get_source_data_ofr(
mnemonic,
monitor = c("stfm", "hfm"),
from = NULL,
to = NULL
)
Arguments
mnemonic |
Provider series mnemonic. |
monitor |
|
from, to |
Optional inclusive observation-date bounds. |
Value
A data.table with dates and values, or NULL for a successful empty response.
Get Latest OKX Candle Data
Description
Get Latest OKX Candle Data
Usage
get_source_data_okx_candle(
inst_id,
bar,
limit = 100L,
config = NULL,
tz = "UTC"
)
Arguments
inst_id |
Instrument identifier. |
bar |
Candle interval. |
limit |
Integer page size. |
config |
Optional OKX API config. If omitted, defaults from the
package config and |
tz |
Output time zone. |
Value
data.table or NULL.
Get Source Data Path
Description
Resolves the local data directory for a source using the package config.
Usage
get_source_data_path(
source,
config = get_investdatar_config(),
subdir = NULL,
create = FALSE
)
Arguments
source |
Character source name. |
config |
Optional package config list. |
subdir |
Optional subdirectory appended to the source data path. |
create |
Logical. Create the directory if it does not exist. |
Value
Character scalar path.
Retrieve World Bank Quarterly External Debt Statistics
Description
Retrieve World Bank Quarterly External Debt Statistics
Usage
get_source_data_qeds(
source_id,
country,
indicator,
from = NULL,
to = NULL,
page_size = 100L
)
Arguments
source_id |
World Bank source 22 (SDDS) or 23 (GDDS). |
country |
Three-letter World Bank economy code. |
indicator |
Source-specific QEDS indicator code. |
from, to |
Optional inclusive quarter bounds in YYYY-Qn format. |
page_size |
Results per request, from 1 to 1000. |
Value
Quarterly data.table retaining provider indicator and source ID, or NULL for an empty response.
Get RSS Feed Data
Description
Download an RSS feed and return a normalized item-level data.table.
Usage
get_source_data_rss(
feed_id,
url,
parser = c("plain", "gdpnow"),
ca_bundle = NULL
)
Arguments
feed_id |
Local feed identifier. |
url |
RSS feed URL. |
parser |
Parsing strategy. Currently supports |
ca_bundle |
Optional CA bundle path used only for this feed request. |
Value
data.table.
Retrieve Data From An SDMX Provider
Description
Retrieve Data From An SDMX Provider
Usage
get_source_data_sdmx(
series_id,
provider,
base_url,
agency = NULL,
dataflow,
version = "latest",
key = "",
flow_ref = NULL,
format = NULL,
accept = "text/csv",
time_col = "TIME_PERIOD",
value_col = "OBS_VALUE",
dimension_cols = NULL,
label = NULL,
frequency = NULL,
from = NULL,
to = NULL,
last_n_observations = NULL
)
Arguments
series_id |
Stable local series identifier. |
provider |
Provider dialect: |
base_url |
Provider REST base URL. |
agency |
Optional SDMX agency identifier. |
dataflow |
SDMX dataflow identifier. |
version |
SDMX dataflow version. |
key |
SDMX series key. |
flow_ref |
Optional provider-specific flow reference. |
format |
Provider query format. |
accept |
HTTP response media type. |
time_col, value_col |
Source observation columns. |
dimension_cols |
Columns identifying distinct series in the response. |
label, frequency |
Optional local metadata. |
from, to |
Optional inclusive SDMX periods. |
last_n_observations |
Optional number of latest observations requested per matching SDMX series. |
Value
A standardized long data.table retaining original SDMX columns.
Retrieve SEC Company Facts
Description
Retrieve SEC Company Facts
Usage
get_source_data_sec_companyfacts(
cik,
ticker = NULL,
company_name = NULL,
concepts = NULL,
forms = NULL,
from = NULL,
to = NULL,
config = NULL
)
Arguments
cik |
SEC Central Index Key. |
ticker |
Optional ticker label. |
company_name |
Optional company name label. |
concepts |
Optional concept names or |
forms |
Optional filing forms to retain. |
from, to |
Optional inclusive filed-date bounds. |
config |
Optional SEC configuration. |
Value
A standardized long XBRL fact data.table.
Retrieve An SEC XBRL Frame
Description
Retrieve An SEC XBRL Frame
Usage
get_source_data_sec_frame(taxonomy, tag, unit, period, config = NULL)
Arguments
taxonomy |
XBRL taxonomy, such as |
tag |
XBRL concept tag. |
unit |
XBRL unit, such as |
period |
SEC frame period, such as |
config |
Optional SEC configuration. |
Value
A normalized cross-company data.table.
Retrieve Holdings From a Selected Public SEC N-PORT Filing
Description
Retrieve Holdings From a Selected Public SEC N-PORT Filing
Usage
get_source_data_sec_nport(
cik,
accession_number,
primary_document = "primary_doc.xml",
config = NULL
)
Arguments
cik |
SEC Central Index Key. |
accession_number |
Filing accession number. |
primary_document |
Primary filing document name from submissions data. |
config |
Optional SEC configuration. |
Value
A data.table of as-filed holdings or NULL for a filing without rows.
Retrieve SEC Filing Submissions
Description
Retrieve SEC Filing Submissions
Usage
get_source_data_sec_submissions(
cik,
ticker = NULL,
company_name = NULL,
forms = NULL,
from = NULL,
to = NULL,
include_history = TRUE,
config = NULL
)
Arguments
cik |
SEC Central Index Key. |
ticker |
Optional ticker label. |
company_name |
Optional company name label. |
forms |
Optional filing forms to retain. |
from, to |
Optional inclusive filing-date bounds. |
include_history |
Logical; retrieve older SEC submission files in addition to recent filings. |
config |
Optional SEC configuration. |
Value
A standardized filing-event data.table.
Retrieve Treasury International Capital Long-Term Securities Data
Description
Retrieve Treasury International Capital Long-Term Securities Data
Usage
get_source_data_tic(series_ids = .tic_default_series, archive_path = NULL)
Arguments
series_ids |
Treasury CSLT source IDs. The default selects mainland China and Japan holdings and net transactions in long-term U.S. Treasuries. |
archive_path |
Optional existing official CSLT ZIP. When omitted, downloads the Treasury archive once. |
Value
A data.table with monthly observations and provider metadata.
Get Treasury Rates Data
Description
Download U.S. Treasury raw daily rates and return a normalized long-format
data.table.
Usage
get_source_data_treasury_rates(dataset, years = NULL)
Arguments
dataset |
Treasury dataset key. Supported values are |
years |
Optional integer vector of calendar years to fetch. If omitted, the function combines the historical archive with current-year annual XML feeds from 2024 through the current year. |
Value
data.table.
Get World Bank Data via wbstats
Description
Downloads indicator data using the wbstats package and standardizes it to
a package-native long schema.
Usage
get_source_data_wbstats(
indicator,
country = "countries_only",
start_date = NULL,
end_date = NULL,
mrv = NULL,
mrnev = NULL,
cache = NULL,
freq = "Y",
gapfill = FALSE,
date_as_class_date = FALSE,
lang = NULL
)
Arguments
indicator |
World Bank indicator code. |
country |
Country or aggregate code. |
start_date |
Optional start date. |
end_date |
Optional end date. |
mrv |
Optional number of most recent values. |
mrnev |
Optional number of most recent non-empty values. |
cache |
Optional cache object passed to |
freq |
Frequency code: |
gapfill |
Logical passed to |
date_as_class_date |
Logical passed to |
lang |
Optional language code. |
Value
Standardized data.table.
Get Historical OKX Candle Data
Description
Get Historical OKX Candle Data
Usage
get_source_hist_data_okx_candle(
inst_id,
bar,
before = NULL,
limit = 100L,
config = NULL,
tz = "UTC"
)
Arguments
inst_id |
Instrument identifier. |
bar |
Candle interval. |
before |
Optional pagination cursor. Date-time cursors are interpreted
in |
limit |
Integer page size. |
config |
Optional OKX API config. If omitted, defaults from the
package config and |
tz |
Output time zone. |
Value
data.table or NULL.
Retrieve metadata for a FRED series
Description
Queries the FRED API to obtain basic metadata of a given series, such as title, observation range, frequency, units, and seasonal adjustment.
Usage
get_source_metadata_fred(series_id, config = NULL)
Arguments
series_id |
A character string. The FRED series ID (e.g., "AMERIBOR"). |
config |
A list containing API configuration with elements:
|
Value
A list with elements:
-
title— Series title -
start— Observation start date -
end— Observation end date -
freq— Data frequency -
units— Measurement units -
season— Seasonal adjustment type
Examples
## Not run:
config <- list(
api_key = "your_api_key",
url = "https://api.stlouisfed.org/fred/series",
mode = "json"
)
get_source_metadata_fred("AMERIBOR", config)
## End(Not run)
Get Source Specification
Description
Returns a formal source-spec object describing one provider module. The spec is intentionally lightweight so modules can later move into separate packages without changing the high-level contract.
Usage
get_source_spec(source)
Arguments
source |
Character provider key. |
Value
An object of class investdatar_source_spec.
Get CFTC Dataset Update Time
Description
Get CFTC Dataset Update Time
Usage
get_source_utime_cftc_cot(
report_variant = c("futures_only", "combined"),
report_type = "tff",
dataset_id = NULL
)
Arguments
report_variant |
Report variant: |
report_type |
Report family: |
dataset_id |
Optional official Socrata dataset identifier. |
Value
A UTC POSIXct update time, or NULL when unavailable.
Get Latest Crypto Derivatives Observation Time
Description
Get Latest Crypto Derivatives Observation Time
Usage
get_source_utime_crypto_derivatives(
provider,
dataset_type,
symbol,
interval = NULL,
config = NULL
)
Arguments
provider |
|
dataset_type |
Funding, open-interest, mark/index price, basis, or Binance long-short-ratio dataset identifier. |
symbol |
Provider instrument identifier. |
interval |
Required Binance open-interest period; otherwise a local label. |
config |
Optional exchange configuration. |
Value
UTC POSIXct, or NULL.
Get Latest EIA Series Update Date
Description
Get Latest EIA Series Update Date
Usage
get_source_utime_eia(series_id, config = NULL)
Arguments
series_id |
EIA series identifier. |
config |
Optional EIA API configuration. |
Value
A UTC POSIXct, or NULL.
Get The Latest Treasury Fiscal Data Date
Description
Get The Latest Treasury Fiscal Data Date
Usage
get_source_utime_fiscaldata(dataset_id, endpoint, date_col = "record_date")
Arguments
dataset_id |
Stable local dataset identifier. |
endpoint |
Fiscal Data endpoint relative to the fiscal-service base URL. |
date_col |
Source date column. |
Value
A UTC POSIXct inferred from the newest source record, or NULL.
Get FRED Series Last Update Time
Description
Return the last update time of a FRED series as POSIXct in UTC.
Usage
get_source_utime_fred(
series_id,
config = NULL,
from_server = FALSE,
tz = "America/Chicago"
)
Arguments
series_id |
Character. FRED series ID. |
config |
Optional list with fields: |
from_server |
Logical. If |
tz |
Time zone used when parsing or inferring the update time. |
Value
POSIXct (UTC).
Get iShares Source Update Time
Description
Returns a best-effort upstream update time for iShares data. When
check_online = TRUE, the function scrapes the product page; otherwise it
falls back to the latest midnight in tz.
Usage
get_source_utime_ishare(tz = "America/New_York", check_online = TRUE)
Arguments
tz |
Time zone used for the returned timestamp. |
check_online |
Logical. Scrape iShares online when |
Value
POSIXct.
Get Last Completed Candle Time
Description
Floor current time to the last completed candle start for the given bar.
Usage
get_source_utime_okx_candle(bar, tz = "UTC")
Arguments
bar |
Character. OKX timeframe tag (e.g., |
tz |
Character. IANA timezone. |
Value
POSIXct.
Get RSS Feed Last Update Time
Description
Get RSS Feed Last Update Time
Usage
get_source_utime_rss(
feed_id,
url,
parser = c("plain", "gdpnow"),
ca_bundle = NULL
)
Arguments
feed_id |
Local feed identifier. |
url |
RSS feed URL. |
parser |
Parsing strategy. Currently supports |
ca_bundle |
Optional CA bundle path used only for this feed request. |
Value
POSIXct or NULL.
Get Latest SDMX Observation Time
Description
Get Latest SDMX Observation Time
Usage
get_source_utime_sdmx(
series_id,
provider,
base_url,
agency = NULL,
dataflow,
version = "latest",
key = "",
flow_ref = NULL,
format = NULL,
accept = "text/csv",
time_col = "TIME_PERIOD",
value_col = "OBS_VALUE",
dimension_cols = NULL,
label = NULL,
frequency = NULL
)
Arguments
series_id |
Stable local series identifier. |
provider |
Provider dialect: |
base_url |
Provider REST base URL. |
agency |
Optional SDMX agency identifier. |
dataflow |
SDMX dataflow identifier. |
version |
SDMX dataflow version. |
key |
SDMX series key. |
flow_ref |
Optional provider-specific flow reference. |
format |
Provider query format. |
accept |
HTTP response media type. |
time_col, value_col |
Source observation columns. |
dimension_cols |
Columns identifying distinct series in the response. |
label, frequency |
Optional local metadata. |
Value
A UTC POSIXct, or NULL.
Get Latest SEC Company Facts Filing Date
Description
Get Latest SEC Company Facts Filing Date
Usage
get_source_utime_sec_companyfacts(cik, config = NULL)
Arguments
cik |
SEC Central Index Key. |
config |
Optional SEC configuration. |
Value
A UTC POSIXct, or NULL.
Get Latest SEC Submission Time
Description
Get Latest SEC Submission Time
Usage
get_source_utime_sec_submissions(cik, config = NULL)
Arguments
cik |
SEC Central Index Key. |
config |
Optional SEC configuration. |
Value
A UTC-compatible POSIXct, or NULL.
Get Treasury Rates Last Update Time
Description
Get Treasury Rates Last Update Time
Usage
get_source_utime_treasury_rates(dataset, years = NULL)
Arguments
dataset |
Treasury dataset key. Supported values are |
years |
Optional integer vector of calendar years to fetch. If omitted, the function combines the historical archive with current-year annual XML feeds from 2024 through the current year. |
Value
POSIXct or NULL.
Get Fallback Source Update Time for wbstats Data
Description
Get Fallback Source Update Time for wbstats Data
Usage
get_source_utime_wbstats(freq = "Y", tz = "UTC")
Arguments
freq |
Frequency code: |
tz |
Time zone used for the inferred timestamp. |
Value
POSIXct.
Get World Bank Registry
Description
Get World Bank Registry
Usage
get_wbstats_registry(registry_path = get_wbstats_registry_file_path())
Arguments
registry_path |
Optional JSON registry path. |
Value
data.table.
Get World Bank Registry File Path
Description
Resolve the JSON registry path for World Bank indicator metadata. If no
explicit registry_file is configured, the function falls back to a default
filename in the package config directory.
Usage
get_wbstats_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for the fallback registry path. |
Value
Character scalar path.
Get Yahoo Finance Registry
Description
Get Yahoo Finance Registry
Usage
get_yahoofinance_registry(
registry_path = get_yahoofinance_registry_file_path()
)
Arguments
registry_path |
Optional registry JSON path. |
Value
data.table.
Get Yahoo Finance Registry File Path
Description
Resolve the JSON registry path for Yahoo Finance ticker metadata. If no
explicit registry_file is configured, the function falls back to a default
filename in the package config directory.
Usage
get_yahoofinance_registry_file_path(config_dir = NULL)
Arguments
config_dir |
Optional configuration directory used for the fallback registry path. |
Value
Character scalar path.
Get Yahoo Finance Registry Migration Patch
Description
Show the seed-owned policy fields that would be added to an older external
Yahoo Finance registry. The runtime registry is never modified. If
output_path is supplied, the patch is written as JSON at that path.
Usage
get_yahoofinance_registry_migration_patch(
registry_path = get_yahoofinance_registry_file_path(),
seed_path = get_yahoofinance_seed_registry_path(),
output_path = NULL
)
Arguments
registry_path |
Runtime registry JSON path. |
seed_path |
Package seed registry JSON path. |
output_path |
Optional JSON path for the explicit migration patch. |
Value
A data.table with ticker and policy fields.
Get Yahoo Finance Seed Registry Path
Description
Get Yahoo Finance Seed Registry Path
Usage
get_yahoofinance_seed_registry_path()
Value
Path to the package-managed Yahoo Finance registry seed.
Infer Source Update Time From Frequency
Description
Provides a fallback source update time for resources that do not expose a server-side update timestamp.
Usage
infer_source_utime_from_frequency(
frequency,
reference_time = Sys.time(),
tz = "UTC"
)
Arguments
frequency |
Frequency string or candle interval. |
reference_time |
POSIXct reference time. Defaults to |
tz |
Time zone used for period flooring. |
Value
POSIXct.
Check Whether A Batch Sync Run Succeeded
Description
A run is successful when its stored summary contains no row with an error status or non-empty error message. Empty summaries are successful because an intentionally empty registry has no failed work.
Usage
is_sync_run_successful(run)
Arguments
run |
A run-log object returned by |
Value
Logical scalar.
List Source Specifications
Description
List Source Specifications
Usage
list_source_specs()
Value
Named list of investdatar_source_spec objects.
Load Package Configuration
Description
Loads the package YAML configuration and caches it in package options.
Usage
load_investdatar_config(
config_path = Sys.getenv("INVESTDATAR_CONFIG", unset = "")
)
Arguments
config_path |
Optional path to the YAML config file. If omitted, the
function uses the |
Value
A normalized configuration list.
Normalize the Instrument Catalog to schema 1.1.0
Description
Converts legacy schema 1.0.0 records without changing provider identifiers, cache keys, synchronization routing, or fallback declarations. Legacy MIC-like calendar values are treated as completed-bar calendar aliases only.
Usage
normalize_instrument_catalog(
catalog_path = .instrument_catalog_seed_path(),
yahoo_registry_path = get_yahoofinance_seed_registry_path()
)
Arguments
catalog_path |
Path to a catalog JSON file. Defaults to the packaged seed. |
yahoo_registry_path |
Path to the Yahoo Finance sync registry. Defaults to the packaged seed registry so the catalog is usable without a runtime configuration file. Pass a runtime registry path to validate that runtime registry explicitly. |
Value
A normalized data.table using schema 1.1.0 fields.
Repair Approved CSI 300 Cache Rows From Eastmoney
Description
Apply a manually approved repair derived from a versioned
audit_csi300_cache_integrity() artifact. The function authorizes only
dates present in that artifact's discrepancy set, verifies that the current
cache has not changed since the audit, and verifies the fresh Eastmoney
candidate against the audited candidate using the audit's close tolerance.
Usage
repair_csi300_cache_integrity(
audit_artifact_path,
approved_dates,
local_path = NULL,
output_dir = NULL,
dry_run = TRUE
)
Arguments
audit_artifact_path |
JSON report produced by
|
approved_dates |
Explicit unique dates to repair. Every date must be in the audit artifact's discrepancy set. |
local_path |
Yahoo Finance cache directory. Defaults to the configured Yahoo Finance data path. |
output_dir |
Directory for repair logs and backups. Defaults to
|
dry_run |
Whether to write only a proposed repair log. Defaults to
|
Details
The default is a dry run. It always writes a versioned repair log; dry runs do not mutate the cache or create a backup. A non-dry-run first copies the cache to the repair directory, then replaces only the explicitly approved rows. If writing fails, it restores the cache from that backup.
Value
A list with the proposed or applied repair rows, log path, and (when applied) backup path.
Repair Local Binance Kline Data From Multiple Windows
Description
Fetches all requested Binance kline windows in memory and writes the merged
repair result to local storage with one sync_local_data() call.
Usage
repair_local_binance_klines_gaps(
symbol = "ETHUSDT",
interval = "1m",
windows,
limit = 1500L,
tz = "UTC",
local_path = NULL,
storage = c("single", "monthly")
)
Arguments
symbol |
Trading pair symbol. |
interval |
Candlestick interval. |
windows |
A |
limit |
Page size. Binance futures allows up to 1500. |
tz |
Time zone applied to returned timestamps. |
local_path |
Optional Binance storage path. |
storage |
Local storage mode: monolithic |
Value
A sync result list.
Repair Local OKX Candle Data From Multiple History Pages
Description
Fetches multiple OKX historical candle pages in memory and writes the merged
repair result to local storage with one sync_local_data() call.
Usage
repair_local_okx_candle_gaps(
inst_id,
bar,
before,
config = NULL,
local_path = NULL,
limit = 100L,
tz = "UTC",
storage = c("single", "monthly")
)
Arguments
inst_id |
Instrument identifier. |
bar |
Candle interval. |
before |
Character, numeric, or date-time vector of OKX history
pagination cursors. Date-time cursors are interpreted in |
config |
Optional OKX API config. If omitted, defaults from the
package config and |
local_path |
Optional OKX storage path. |
limit |
Integer page size. |
tz |
Output time zone. |
storage |
Local storage mode: monolithic |
Value
A sync result list.
Resolve An SEC CIK From A Ticker
Description
Resolve An SEC CIK From A Ticker
Usage
resolve_sec_cik(ticker, mappings = NULL, config = NULL)
Arguments
ticker |
Security ticker. |
mappings |
Optional table returned by |
config |
Optional SEC configuration used when mappings are not supplied. |
Value
Unpadded CIK character scalar.
Standardize Fund Holdings Across Issuers
Description
Converts issuer-specific snapshots to the provider-neutral holdings contract.
Usage
standardize_fund_holdings(
data,
provider,
fund_id,
as_of_date = NULL,
column_map = list()
)
Arguments
data |
Holdings table. |
provider |
Stable provider identifier, such as |
fund_id |
Stable fund ticker or identifier. |
as_of_date |
Optional snapshot date overriding the source column. |
column_map |
Optional named list mapping canonical names to source columns. |
Value
A provider-neutral long data.table.
Synchronize Registered Alpha Vantage Series
Description
Synchronize Registered Alpha Vantage Series
Usage
sync_all_alphavantage_registry_data(
registry = get_alphavantage_registry(),
config = NULL,
local_path = NULL,
...
)
Arguments
registry |
Optional Alpha Vantage registry. |
config |
Optional API configuration. |
local_path |
Optional storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize Registered BEA Series
Description
Synchronize Registered BEA Series
Usage
sync_all_bea_registry_data(
registry = get_bea_registry(),
config = NULL,
local_path = NULL
)
Arguments
registry |
Optional BEA registry. |
config |
Optional BEA configuration. |
local_path |
Optional storage directory. |
Value
A batch summary.
Synchronize Registered BLS Series
Description
Synchronize Registered BLS Series
Usage
sync_all_bls_registry_data(
registry = get_bls_registry(),
config = NULL,
local_path = NULL,
...
)
Arguments
registry |
Optional BLS registry. |
config |
Optional BLS configuration. |
local_path |
Optional BLS storage directory. |
... |
Passed to |
Value
A batch summary.
Synchronize Registered Census Series
Description
Synchronize Registered Census Series
Usage
sync_all_census_registry_data(
registry = get_census_registry(),
config = NULL,
local_path = NULL
)
Arguments
registry |
Optional Census registry. |
config |
Optional Census configuration. |
local_path |
Optional storage directory. |
Value
A batch summary.
Synchronize All Registered CFTC COT Reports
Description
Synchronize All Registered CFTC COT Reports
Usage
sync_all_cftc_cot_registry_data(
registry = get_cftc_cot_registry(),
local_path = NULL,
...
)
Arguments
registry |
Optional CFTC registry table. |
local_path |
Optional CFTC storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize All Registered Crypto Derivatives Data
Description
Synchronize All Registered Crypto Derivatives Data
Usage
sync_all_crypto_derivatives_registry_data(
registry = get_crypto_derivatives_registry(),
local_path = NULL,
...
)
Arguments
registry |
Optional derivatives registry. |
local_path |
Optional derivatives storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize All Registered EIA Series
Description
Synchronize All Registered EIA Series
Usage
sync_all_eia_registry_data(
registry = get_eia_registry(),
config = NULL,
local_path = NULL,
...
)
Arguments
registry |
Optional EIA registry table. |
config |
Optional EIA API configuration. |
local_path |
Optional EIA storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize All Registered Treasury Fiscal Data
Description
Synchronize All Registered Treasury Fiscal Data
Usage
sync_all_fiscaldata_registry_data(
registry = get_fiscaldata_registry(),
local_path = NULL,
...
)
Arguments
registry |
Optional Fiscal Data registry table. |
local_path |
Optional Fiscal Data storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize All FRED Series In The Registry
Description
Synchronize All FRED Series In The Registry
Usage
sync_all_fred_registry_data(
registry = get_fred_registry(),
config = NULL,
local_path = NULL,
from_server = FALSE,
tz = "America/Chicago"
)
Arguments
registry |
Optional FRED registry table. |
config |
Optional FRED API config. |
local_path |
Optional local storage path. |
from_server |
Logical. If |
tz |
Time zone used for source update time inference. |
Value
Summary data.table.
Synchronize All iShares Tickers In The Registry
Description
Synchronize All iShares Tickers In The Registry
Usage
sync_all_ishare_registry_data(
registry = get_ishare_registry(),
local_path = NULL,
cache_dir = NULL,
source_utime = NULL,
ishare_mega_data = NULL
)
Arguments
registry |
Optional iShares registry table. |
local_path |
Optional local storage path. |
cache_dir |
Optional cache directory. |
source_utime |
Optional upstream update time shared across the batch. |
ishare_mega_data |
Optional metadata table used to resolve fund URLs. |
Value
Summary data.table.
Synchronize All iShares Holdings In The Registry
Description
Synchronize All iShares Holdings In The Registry
Usage
sync_all_ishare_registry_holdings(
registry = NULL,
tickers = NULL,
local_path = NULL,
cache_dir = NULL,
source_utime = NULL,
ishare_mega_data = NULL
)
Arguments
registry |
Optional iShares registry table. When |
tickers |
Optional character vector of holdings tickers to sync. When
|
local_path |
Optional local storage path. |
cache_dir |
Optional cache directory. |
source_utime |
Optional upstream update time shared across the batch. |
ishare_mega_data |
Optional metadata table used to resolve fund URLs. |
Value
Summary data.table.
Synchronize Registered New York Fed Markets Datasets
Description
Synchronize Registered New York Fed Markets Datasets
Usage
sync_all_nyfed_registry_data(
registry = get_nyfed_registry(),
local_path = NULL,
from = Sys.Date() - 30L,
to = Sys.Date()
)
Arguments
registry |
Dataset registry. |
local_path |
Storage directory. Defaults to |
from, to |
Inclusive observation-date bounds. |
Value
A per-dataset batch summary.
Synchronize All RSS Registry Feeds
Description
Synchronize All RSS Registry Feeds
Usage
sync_all_rss_registry_data(
registry = get_rss_registry(),
local_path = NULL,
ca_bundles = NULL
)
Arguments
registry |
Optional RSS registry table. |
local_path |
Optional local storage path. |
ca_bundles |
Optional named list or character vector mapping feed IDs to
request-scoped CA bundle paths. When omitted, |
Value
Summary data.table.
Synchronize All Registered SDMX Series
Description
Synchronize All Registered SDMX Series
Usage
sync_all_sdmx_registry_data(
registry = get_sdmx_registry(),
local_path = NULL,
...
)
Arguments
registry |
Optional SDMX series registry. |
local_path |
Optional SDMX storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize Registered SEC Company Facts
Description
Synchronize Registered SEC Company Facts
Usage
sync_all_sec_companyfacts_registry_data(
registry = get_sec_registry(),
config = NULL,
local_path = NULL,
...
)
Arguments
registry |
Optional SEC company registry. |
config |
Optional SEC configuration. |
local_path |
Optional SEC Company Facts storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize Registered SEC XBRL Frames
Description
Synchronize Registered SEC XBRL Frames
Usage
sync_all_sec_frames_registry_data(
registry = get_sec_frames_registry(),
config = NULL,
local_path = NULL
)
Arguments
registry |
Optional Frames registry. |
config |
Optional SEC configuration. |
local_path |
Optional frame storage directory. |
Value
A standardized batch summary.
Synchronize Registered SEC Submissions
Description
Synchronize Registered SEC Submissions
Usage
sync_all_sec_submissions_registry_data(
registry = get_sec_registry(),
config = NULL,
local_path = NULL,
...
)
Arguments
registry |
Optional SEC company registry. |
config |
Optional SEC configuration. |
local_path |
Optional SEC submissions storage directory. |
... |
Passed to |
Value
A standardized batch summary data.table.
Synchronize All Treasury Rate Datasets
Description
Synchronize All Treasury Rate Datasets
Usage
sync_all_treasury_rates(
datasets = names(.treasury_dataset_map()),
years = NULL,
local_path = NULL
)
Arguments
datasets |
Optional dataset vector. If omitted, sync all supported Treasury rate datasets. |
years |
Optional year filter passed to |
local_path |
Optional local storage path. |
Value
Summary data.table.
Synchronize All World Bank Registry Series
Description
Synchronize All World Bank Registry Series
Usage
sync_all_wbstats_registry_data(
registry = get_wbstats_registry(),
local_path = NULL,
...
)
Arguments
registry |
Optional World Bank registry table. |
local_path |
Optional local storage path. |
... |
Passed to |
Value
Summary data.table.
Synchronize All Yahoo Finance Tickers In The Registry
Description
Synchronize All Yahoo Finance Tickers In The Registry
Usage
sync_all_yahoofinance_registry_data(
from = NULL,
to = Sys.Date(),
registry = get_yahoofinance_registry(),
local_path = NULL,
src = "yahoo",
overlap_days = 10L,
initial_lookback_days = 400L,
max_attempts = 3L,
retry_delay_seconds = 1,
fallback_source = NULL,
fallback_ticker = NULL
)
Arguments
from |
Optional start date passed to |
to |
End date passed to |
registry |
Optional Yahoo Finance registry table. When omitted, the configured runtime registry is validated against the package seed before any provider request. |
local_path |
Optional local storage path. |
src |
quantmod source, default |
overlap_days |
Integer safety overlap used when deriving per-ticker incremental start dates from local data. |
initial_lookback_days |
Integer fallback lookback for tickers without
local data when |
max_attempts |
Maximum bounded attempts for a transient source failure. |
retry_delay_seconds |
Initial retry delay in seconds; delays use exponential backoff. |
fallback_source |
Optional explicitly configured fallback provider.
Currently supports |
fallback_ticker |
Optional provider-specific fallback identifier. |
Value
Summary data.table.
Synchronize One Alpha Vantage Daily Series
Description
Synchronize One Alpha Vantage Daily Series
Usage
sync_local_alphavantage_data(
symbol,
mode = NULL,
config = NULL,
local_path = NULL
)
Arguments
symbol |
A character string for the stock ticker symbol (e.g., |
mode |
Character string; either |
config |
A list of AlphaVantage API settings, typically retrieved via |
local_path |
Optional Alpha Vantage storage directory. |
Value
A standard synchronization result.
Synchronize One BEA Regional Series
Description
Synchronize One BEA Regional Series
Usage
sync_local_bea_data(
series_id,
table_name,
line_code,
geofips = "STATE",
year = "ALL",
label = NULL,
config = NULL,
local_path = NULL
)
Arguments
series_id |
Stable local series identifier. |
table_name |
BEA Regional table name. |
line_code |
BEA line code. |
geofips |
Geography selector such as |
year |
Year selector, default |
label |
Optional local label. |
config |
Optional BEA configuration. |
local_path |
Optional BEA storage directory. |
Value
A standard synchronization result.
Synchronize Local Binance Kline Data
Description
Synchronize Local Binance Kline Data
Usage
sync_local_binance_klines(
symbol = "ETHUSDT",
interval = "1m",
start_time = NULL,
end_time = NULL,
limit = 1500L,
tz = "UTC",
paginate = TRUE,
local_path = NULL,
storage = c("single", "monthly")
)
Arguments
symbol |
Trading pair symbol. |
interval |
Candlestick interval. |
start_time |
Optional start time. |
end_time |
Optional end time. |
limit |
Page size. Binance futures allows up to 1500. |
tz |
Time zone applied to returned timestamps. |
paginate |
Logical. Request multiple pages when needed. |
local_path |
Optional Binance storage path. |
storage |
Local storage mode: monolithic |
Value
A sync result list.
Synchronize One BLS Series
Description
Synchronize One BLS Series
Usage
sync_local_bls_data(
series_id,
label = NULL,
from = NULL,
to = NULL,
config = NULL,
local_path = NULL,
overlap_years = 2L
)
Arguments
series_id |
BLS series identifier. |
label |
Optional local label. |
from, to |
Optional year or date bounds. |
config |
Optional BLS configuration. |
local_path |
Optional BLS storage directory. |
overlap_years |
Years re-fetched for revisions. |
Value
A standard synchronization result.
Synchronize One Census Series
Description
Synchronize One Census Series
Usage
sync_local_census_data(
series_id,
dataset,
data_type_code,
category_code,
seasonally_adj = "yes",
from = NULL,
to = NULL,
label = NULL,
config = NULL,
local_path = NULL,
overlap_months = 24L
)
Arguments
series_id |
Stable local series identifier. |
dataset |
Economic Indicators dataset suffix, such as |
data_type_code |
Census item type code. |
category_code |
Census industry/category code. |
seasonally_adj |
Seasonal adjustment value. |
from, to |
Optional time bounds. |
label |
Optional local label. |
config |
Optional Census configuration. |
local_path |
Optional Census storage directory. |
overlap_months |
Months re-fetched for revisions. |
Value
A standard synchronization result.
Synchronize One CFTC COT Report
Description
Synchronize One CFTC COT Report
Usage
sync_local_cftc_cot(
report_variant = c("futures_only", "combined"),
report_type = "tff",
report_id = NULL,
dataset_id = NULL,
market_codes = NULL,
from = NULL,
to = NULL,
local_path = NULL,
overlap_days = 14L,
page_size = 5000L
)
Arguments
report_variant |
Report variant: |
report_type |
Report family: |
report_id |
Stable local report identifier. |
dataset_id |
Optional official Socrata dataset identifier. |
market_codes |
Optional CFTC contract-market codes. |
from, to |
Optional inclusive report-date bounds. |
local_path |
Optional CFTC storage directory. |
overlap_days |
Number of days re-fetched around the latest local report. |
page_size |
Number of source rows requested per page. |
Value
A local synchronization result list.
Synchronize One Crypto Derivatives Dataset
Description
Synchronize One Crypto Derivatives Dataset
Usage
sync_local_crypto_derivatives(
provider,
dataset_type,
symbol,
interval = NULL,
from = NULL,
to = NULL,
limit = NULL,
local_path = NULL,
overlap_days = 2L,
config = NULL,
storage = c("single", "monthly")
)
Arguments
provider |
|
dataset_type |
Funding, open-interest, mark/index price, basis, or Binance long-short-ratio dataset identifier. |
symbol |
Provider instrument identifier. |
interval |
Required Binance open-interest period; otherwise a local label. |
from, to |
Optional inclusive UTC time bounds. |
limit |
Provider page size. |
local_path |
Optional derivatives storage directory. |
overlap_days |
Days re-fetched before the latest local observation. |
config |
Optional exchange configuration. |
storage |
Local storage mode: monolithic |
Value
A local synchronization result list.
Store Captured Crypto Liquidation Events
Description
Exchange REST APIs do not provide trustworthy market-wide liquidation history. This function persists events captured from Binance or OKX public liquidation streams without presenting private force-order history as market data.
Usage
sync_local_crypto_liquidations(
events,
provider,
symbol,
local_path = NULL,
storage = c("single", "monthly")
)
Arguments
events |
Event rows containing a time column and price/quantity fields. |
provider |
Exchange identifier. |
symbol |
Exchange instrument identifier. |
local_path |
Optional derivatives storage directory. |
storage |
Local storage mode. |
Value
A local synchronization result list.
Synchronize Local Data
Description
Merges freshly retrieved source data into a local .rds file and stores a
sidecar metadata file containing the local update time and source update time.
Usage
sync_local_data(
new_data,
local_file_path,
key_cols,
order_cols = key_cols,
source_utime = NULL,
local_updated_at = Sys.time()
)
Arguments
new_data |
A |
local_file_path |
Output |
key_cols |
Character vector of key columns used for de-duplication. |
order_cols |
Character vector used to sort the merged data. |
source_utime |
Optional upstream update time recorded in metadata. |
local_updated_at |
Optional local update time override. |
Value
A list describing the sync result.
Synchronize Local Data From In-Memory Batches
Description
Combines multiple freshly retrieved data batches in memory, de-duplicates
them by key_cols, then calls sync_local_data() once. This is useful for
gap repair workflows where calling sync_local_data() once per small page
would repeatedly rewrite the same local .rds file.
Usage
sync_local_data_batches(
batches,
local_file_path,
key_cols,
order_cols = key_cols,
source_utime = NULL,
local_updated_at = Sys.time()
)
Arguments
batches |
A list of |
local_file_path |
Output |
key_cols |
Character vector of key columns used for de-duplication. |
order_cols |
Character vector used to sort the merged data. |
source_utime |
Optional upstream update time recorded in metadata. |
local_updated_at |
Optional local update time override. |
Value
A sync result list.
Synchronize Monthly Partitioned Local Data
Description
Upserts only monthly partitions touched by new_data. On the first
partitioned sync, an existing monolithic RDS cache is copied into monthly
partitions so callers can opt in without a separate migration step.
Usage
sync_local_data_partitioned(
new_data,
local_file_path,
time_col,
key_cols,
order_cols = key_cols,
source_utime = NULL,
local_updated_at = Sys.time(),
tz = "UTC"
)
Arguments
new_data |
A |
local_file_path |
Output |
time_col |
Name of the timestamp column used for monthly partitioning. |
key_cols |
Character vector of key columns used for de-duplication. |
order_cols |
Character vector used to sort the merged data. |
source_utime |
Optional upstream update time recorded in metadata. |
local_updated_at |
Optional local update time override. |
tz |
Time zone used to determine month boundaries. |
Value
A sync result list. Its data element contains the touched rows,
rather than the complete potentially large dataset.
Synchronize One EIA Series
Description
Synchronize One EIA Series
Usage
sync_local_eia_data(
series_id,
label = NULL,
config = NULL,
from = NULL,
to = NULL,
local_path = NULL,
overlap_days = 31L,
page_size = 5000L
)
Arguments
series_id |
EIA series identifier. |
label |
Optional local label. |
config |
Optional EIA API configuration. |
from, to |
Optional inclusive period bounds. |
local_path |
Optional EIA storage directory. |
overlap_days |
Days re-fetched around the latest local observation. |
page_size |
Number of observations requested per page. |
Value
A local synchronization result list.
Synchronize One Treasury Fiscal Data Table
Description
Synchronize One Treasury Fiscal Data Table
Usage
sync_local_fiscaldata(
dataset_id,
endpoint,
date_col = "record_date",
key_cols = date_col,
fields = NULL,
from = NULL,
to = NULL,
local_path = NULL,
overlap_days = 14L,
page_size = 10000L
)
Arguments
dataset_id |
Stable local dataset identifier. |
endpoint |
Fiscal Data endpoint relative to the fiscal-service base URL. |
date_col |
Source date column. |
key_cols |
Source columns that uniquely identify observations per date. |
fields |
Optional source fields to request. |
from, to |
Optional inclusive date bounds. |
local_path |
Optional Fiscal Data storage directory. |
overlap_days |
Days re-fetched around the latest local date. |
page_size |
Number of source rows requested per page. |
Value
A local synchronization result list.
Synchronize Local FRED Data
Description
Synchronize Local FRED Data
Usage
sync_local_fred_data(
series_id,
config = NULL,
local_path = NULL,
from_server = FALSE,
tz = "America/Chicago"
)
Arguments
series_id |
FRED series identifier. |
config |
Optional FRED API config. |
local_path |
Optional local storage path. |
from_server |
Logical. If |
tz |
Time zone used for source update time inference. |
Value
A sync result list.
Synchronize Provider-Neutral Fund Holdings
Description
Synchronize Provider-Neutral Fund Holdings
Usage
sync_local_fund_holdings(
data,
provider,
fund_id,
local_path = NULL,
as_of_date = NULL,
column_map = list(),
source_utime = NULL
)
Arguments
data |
Holdings table, standardized internally. |
provider |
Fund issuer/provider identifier. |
fund_id |
Fund ticker or stable identifier. |
local_path |
Optional generic holdings storage root. |
as_of_date |
Optional snapshot-date override. |
column_map |
Optional canonical-to-source column mapping. |
source_utime |
Optional upstream update time. |
Value
A standard synchronization result.
Synchronize Local iShares Historical Data
Description
Synchronize Local iShares Historical Data
Usage
sync_local_ishare_data(
ticker,
ishare_mega_data = NULL,
local_path = NULL,
cache_dir = NULL,
source_utime = NULL
)
Arguments
ticker |
ETF ticker. |
ishare_mega_data |
Optional iShares registry table. |
local_path |
Optional local storage path. |
cache_dir |
Optional XLS cache directory. |
source_utime |
Optional upstream update time. |
Value
A sync result list.
Synchronize Local iShares Holdings Data
Description
Synchronize Local iShares Holdings Data
Usage
sync_local_ishare_holdings(
ticker,
ishare_mega_data = NULL,
local_path = NULL,
cache_dir = NULL,
source_utime = NULL
)
Arguments
ticker |
ETF ticker. |
ishare_mega_data |
Optional iShares registry table. |
local_path |
Optional local storage path. |
cache_dir |
Optional XLS cache directory. |
source_utime |
Optional upstream update time. |
Value
A sync result list.
Synchronize Local OKX Candle Data
Description
Synchronize Local OKX Candle Data
Usage
sync_local_okx_candle(
inst_id,
bar,
config = NULL,
local_path = NULL,
mode = c("latest", "history"),
before = NULL,
limit = 100L,
tz = "UTC",
storage = c("single", "monthly")
)
Arguments
inst_id |
Instrument identifier. |
bar |
Candle interval. |
config |
Optional OKX API config. If omitted, defaults from the
package config and |
local_path |
Optional OKX storage path. |
mode |
Either |
before |
Optional history cursor. |
limit |
Integer page size. |
tz |
Output time zone. |
storage |
Local storage mode: monolithic |
Value
A sync result list.
Synchronize Local quantmod OHLC Data
Description
Synchronize Local quantmod OHLC Data
Usage
sync_local_quantmod_OHLC(
ticker,
label = ticker,
from,
to,
src = "yahoo",
local_path = NULL,
max_attempts = 3L,
retry_delay_seconds = 1,
fallback_source = NULL,
fallback_ticker = ticker
)
Arguments
ticker |
Market symbol passed to |
label |
Optional label to store in the standardized |
from |
Start date. |
to |
End date. |
src |
quantmod source, default |
local_path |
Optional local storage path. |
max_attempts |
Maximum bounded attempts for a transient source failure. |
retry_delay_seconds |
Initial retry delay in seconds; delays use exponential backoff. |
fallback_source |
Optional explicitly configured fallback provider.
Currently supports |
fallback_ticker |
Optional provider-specific fallback identifier. |
Details
An external fallback never replaces a finite existing primary-source OHLC bar. It only fills keys whose local bars are missing or invalid.
Value
A sync result list.
Synchronize Local RSS Data
Description
Synchronize Local RSS Data
Usage
sync_local_rss_data(
feed_id,
url,
parser = c("plain", "gdpnow"),
local_path = NULL,
ca_bundle = NULL
)
Arguments
feed_id |
Local feed identifier. |
url |
RSS feed URL. |
parser |
Parsing strategy. Currently supports |
local_path |
Optional local storage path. |
ca_bundle |
Optional CA bundle path used only for this feed request. |
Value
A sync result list.
Synchronize One SDMX Registry Entry
Description
Synchronize One SDMX Registry Entry
Usage
sync_local_sdmx_data(
series_id,
provider,
base_url,
agency = NULL,
dataflow,
version = "latest",
key = "",
flow_ref = NULL,
format = NULL,
accept = "text/csv",
time_col = "TIME_PERIOD",
value_col = "OBS_VALUE",
dimension_cols = NULL,
label = NULL,
frequency = NULL,
from = NULL,
to = NULL,
local_path = NULL,
overlap_days = 62L
)
Arguments
series_id |
Stable local series identifier. |
provider |
Provider dialect: |
base_url |
Provider REST base URL. |
agency |
Optional SDMX agency identifier. |
dataflow |
SDMX dataflow identifier. |
version |
SDMX dataflow version. |
key |
SDMX series key. |
flow_ref |
Optional provider-specific flow reference. |
format |
Provider query format. |
accept |
HTTP response media type. |
time_col, value_col |
Source observation columns. |
dimension_cols |
Columns identifying distinct series in the response. |
label, frequency |
Optional local metadata. |
from, to |
Optional inclusive SDMX periods. |
local_path |
Optional SDMX storage directory. |
overlap_days |
Days re-fetched around the latest local period. |
Value
A local synchronization result list.
Download An Optional SEC Bulk Archive
Description
Download An Optional SEC Bulk Archive
Usage
sync_local_sec_bulk_archive(
archive = c("companyfacts", "submissions"),
local_path = NULL,
config = NULL,
overwrite = FALSE,
extract = FALSE
)
Arguments
archive |
One of |
local_path |
Optional SEC bulk archive directory. |
config |
Optional SEC configuration. |
overwrite |
Replace the existing ZIP. |
extract |
Extract the ZIP into a same-named directory. |
Value
Download metadata.
Synchronize SEC Company Facts For One Company
Description
Synchronize SEC Company Facts For One Company
Usage
sync_local_sec_companyfacts(
cik,
ticker = NULL,
company_name = NULL,
concepts = NULL,
forms = NULL,
from = NULL,
to = NULL,
config = NULL,
local_path = NULL,
overlap_days = 31L
)
Arguments
cik |
SEC Central Index Key. |
ticker |
Optional ticker label. |
company_name |
Optional company name label. |
concepts |
Optional concept names or |
forms |
Optional filing forms to retain. |
from, to |
Optional inclusive filed-date bounds. |
config |
Optional SEC configuration. |
local_path |
Optional SEC Company Facts storage directory. |
overlap_days |
Filed-date overlap used for local upserts. |
Value
A local synchronization result list.
Download A Selected SEC Filing Document
Description
Download A Selected SEC Filing Document
Usage
sync_local_sec_filing_document(
cik,
accession_number,
primary_document,
local_path = NULL,
config = NULL,
overwrite = FALSE
)
Arguments
cik |
SEC Central Index Key. |
accession_number |
Filing accession number. |
primary_document |
Primary filing document name from submissions data. |
local_path |
Optional document cache directory. |
config |
Optional SEC configuration. |
overwrite |
Replace an existing local document. |
Value
A one-row metadata data.table.
Synchronize One SEC XBRL Frame
Description
Synchronize One SEC XBRL Frame
Usage
sync_local_sec_frame(
taxonomy,
tag,
unit,
period,
config = NULL,
local_path = NULL
)
Arguments
taxonomy |
XBRL taxonomy, such as |
tag |
XBRL concept tag. |
unit |
XBRL unit, such as |
period |
SEC frame period, such as |
config |
Optional SEC configuration. |
local_path |
Optional SEC frame cache directory. |
Value
A standard synchronization result.
Synchronize SEC Submissions For One Company
Description
Synchronize SEC Submissions For One Company
Usage
sync_local_sec_submissions(
cik,
ticker = NULL,
company_name = NULL,
forms = NULL,
from = NULL,
to = NULL,
include_history = TRUE,
config = NULL,
local_path = NULL,
overlap_days = 14L
)
Arguments
cik |
SEC Central Index Key. |
ticker |
Optional ticker label. |
company_name |
Optional company name label. |
forms |
Optional filing forms to retain. |
from, to |
Optional inclusive filing-date bounds. |
include_history |
Logical; retrieve older SEC submission files in addition to recent filings. |
config |
Optional SEC configuration. |
local_path |
Optional SEC submissions storage directory. |
overlap_days |
Filing-date overlap for incremental synchronization. |
Value
A local synchronization result list.
Synchronize Local Treasury Rates
Description
Synchronize Local Treasury Rates
Usage
sync_local_treasury_rates(dataset, years = NULL, local_path = NULL)
Arguments
dataset |
Treasury dataset key. Supported values are |
years |
Optional integer vector of calendar years to fetch. If omitted, the function combines the historical archive with current-year annual XML feeds from 2024 through the current year. |
local_path |
Optional local storage path. |
Value
A sync result list.
Synchronize Local World Bank Data
Description
Synchronize Local World Bank Data
Usage
sync_local_wbstats_data(indicator, country, freq = "Y", local_path = NULL, ...)
Arguments
indicator |
World Bank indicator code. |
country |
Country or aggregate code. |
freq |
Frequency code. |
local_path |
Optional local storage path. |
... |
Passed to |
Value
A sync result list.
Download Selected Documents From Local SEC Submissions
Description
Download Selected Documents From Local SEC Submissions
Usage
sync_sec_filing_documents(
cik,
forms = NULL,
from = NULL,
to = NULL,
limit = 20L,
submissions_path = NULL,
local_path = NULL,
config = NULL
)
Arguments
cik |
SEC Central Index Key. |
forms |
Optional filing-form filter. |
from, to |
Optional filing-date bounds. |
limit |
Maximum number of newest documents. |
submissions_path |
Optional submissions cache directory. |
local_path |
Optional document cache directory. |
config |
Optional SEC configuration. |
Value
One metadata row per selected document.
Validate the Instrument Catalog
Description
Validates the package-owned, provider-neutral instrument catalog and its Yahoo identifier and fallback projection against a Yahoo Finance registry. The Yahoo registry remains the sync authority: catalog fallback entries are validated projections, not instructions for synchronization.
Usage
validate_instrument_catalog(
catalog_path = .instrument_catalog_seed_path(),
yahoo_registry_path = get_yahoofinance_seed_registry_path()
)
Arguments
catalog_path |
Path to a catalog JSON file. Defaults to the packaged seed. |
yahoo_registry_path |
Path to the Yahoo Finance sync registry. Defaults to the packaged seed registry so the catalog is usable without a runtime configuration file. Pass a runtime registry path to validate that runtime registry explicitly. |
Details
Every public field is required and non-null except that fallback_sources
may be an empty array. asset_class must be one of equity,
fixed_income, commodity, foreign_exchange, or cryptocurrency.
market_calendar is the completed-bar session calendar, not a listing
venue. Schema 1.0.0 accepts legacy XNYS as a calendar alias; schema
1.1.0 uses values such as US_EQUITY, XSHG, FX_24_5, and
CRYPTO_24_7. provider_identifiers is a non-empty named list whose
values are non-empty provider symbols. quote_currency is a three-letter
uppercase currency code, or the recognized stablecoin quote code USDT or
USDC; CNH is permitted as the conventional offshore Chinese-yuan quote
code. price_frequency and every supported_intervals entry are limited
to 1d or 4h and must match
price_frequency. Perpetual swaps must provide an OKX identifier and
positive contract_size and quantity_step, their units, settlement
currency, and contract_structure = "linear_usdt_margined_perpetual".
Each fallback_sources object has exactly provider and symbol fields;
pairs must be unique and ordered lexicographically by provider then symbol.
Value
A list with valid, an errors data table, and a catalog data
table. The catalog retains nested provider mappings as list columns.
Validate the 4-Hour OKX Perpetual Catalog
Description
Validates the provider-neutral catalog and returns its active or inactive
4-hour OKX perpetual-swap subset. When local_path is supplied, every
active instrument must have a non-empty local cache with a finite completed
OHLC row. OKX cache ingestion already excludes unconfirmed candles, so this
check never treats an in-progress candle as usable.
Usage
validate_okx_perpetual_catalog(
catalog_path = .instrument_catalog_seed_path(),
local_path = NULL,
as_of = Sys.time()
)
Arguments
catalog_path |
Path to a catalog JSON file. Defaults to the packaged seed. |
local_path |
Optional local OKX candle-cache directory. Supplying it enables catalog-to-cache validation. |
as_of |
UTC time used to exclude cache rows at or after the cutoff. |
Value
A list with valid, errors, catalog, and cache_status data
tables.
Validate Yahoo Finance Runtime Registry
Description
Compare required ticker entries and fallback declarations in a runtime
registry with the package-managed seed. Additional runtime-only ticker
metadata is permitted. Seed entries with required: true must be present;
every seed fallback declaration must be present unchanged. Missing seed-owned
degraded-cache policy fields are projected by get_yahoofinance_registry();
explicitly weaker supplied values are invalid.
Usage
validate_yahoofinance_registry(
registry_path = get_yahoofinance_registry_file_path(),
seed_path = get_yahoofinance_seed_registry_path()
)
Arguments
registry_path |
Runtime registry JSON path. |
seed_path |
Package seed registry JSON path. |
Value
A list with valid, missing, mismatched, and
missing_required data tables.