Access Turkish Central Bank (TCMB) EVDS economic data from R.
# install.packages("pak")
pak::pak("murattasdemir/evdsr")Get your API key from https://evds2.tcmb.gov.tr (register, go to Profile, click "API Key").
library(evdsr)
# Save key permanently (writes to ~/.Renviron)
evds_setup("your-api-key-here")
# Or set for current session only
evds_setup("your-api-key-here", install = FALSE)library(evdsr)
# Browse the catalog
evds_categories()
evds_datagroups(category = 2) # Exchange rates
evds_series("bie_dkdovytl") # Series in a data group
# Search by keyword
evds_search("doviz")
evds_search("exchange rate")
# Download data
usd <- evds_get("TP.DK.USD.A.YTL", start_date = "2024-01-01")
# Multiple series, monthly frequency
fx <- evds_get(
c("TP.DK.USD.A.YTL", "TP.DK.EUR.A.YTL"),
start_date = "2020-01-01",
end_date = "2024-12-31",
frequency = 5
)
# With caching
usd_cached <- evds_get(
"TP.DK.USD.A.YTL",
start_date = "2020-01-01",
cache = TRUE
)
# Clear cache when needed
evds_clear_cache()| Code | Frequency |
|---|---|
| 1 | Daily |
| 2 | Business day |
| 3 | Weekly |
| 4 | Bimonthly |
| 5 | Monthly |
| 6 | Quarterly |
| 7 | Semi-annual |
| 8 | Annual |
"avg", "min", "max", "first", "last", "sum"
| Code | Transformation |
|---|---|
| 0 | Level |
| 1 | % Change |
| 2 | Difference |
| 3 | Annual % Change |
| 4 | Annual Difference |
| 5 | YTD % Change |
| 6 | YTD Difference |
| 7 | Moving Average |
| 8 | Moving Sum |
- Uses the EVDS v3 API with proper HTTP header authentication
- Accepts ISO dates (
YYYY-MM-DD) and converts internally - Auto-chunks large date ranges to respect the 150-observation API limit
- Optional local RDS caching
- Session-cached catalog for fast repeated searches
- Built on httr2 with retry, throttle, and SSL compatibility
MIT