| Title: | Fetch Turkish Banking Sector Data from the Turkish Banking Regulation and Supervision Agency |
|---|---|
| Description: | The goal of the 'rbrsa' package is to provide automated access to banking sector data from the Turkish Banking Regulation and Supervision Agency (BRSA, known as BDDK in Turkish). The package retrieves tables from two distinct publication portals maintained by the BRSA: The Monthly Bulletin Portal <https://www.bddk.org.tr/bultenaylik> and The FinTurk Data System <https://www.bddk.org.tr/BultenFinturk>. |
| Authors: | Ozan Bakis [aut, cre] |
| Maintainer: | Ozan Bakis <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-06-06 07:43:36 UTC |
| Source: | https://github.com/obakis/rbrsa |
Fetches BDDK data for a range of months by calling fetch_bddk1 iteratively.
fetch_bddk( start_year, start_month, end_year, end_month, table_no, grup_kod = 10001, currency = "TL", lang = "en", delay = 0.5, verbose = TRUE )fetch_bddk( start_year, start_month, end_year, end_month, table_no, grup_kod = 10001, currency = "TL", lang = "en", delay = 0.5, verbose = TRUE )
start_year, end_year
|
Starting/ending year (YYYY). |
start_month, end_month
|
Starting/ending month (1-12). |
table_no |
Table number to fetch (1-17). No default.
Use |
grup_kod |
Group code (10001-10016). Default 10001.
Use |
currency |
Currency code ("TL" or "USD"). Default "TL". |
lang |
Language ("en" or "tr"). Default "en". |
delay |
Delay between requests in seconds. Default 0.5. |
verbose |
Print progress messages. Default TRUE. |
Combined data frame with "fetch_info" attribute.
fetch_finturk() for quarterly province-level data.
# Fetch multiple months my_dat <- fetch_bddk(2024, 1, 2024, 3, table_no = 15)# Fetch multiple months my_dat <- fetch_bddk(2024, 1, 2024, 3, table_no = 15)
Retrieves monthly banking data from the BDDK API for specified group codes.
Supports multiple group codes in a single request, returning a combined
data frame with consistent numeric grup_kod values.
fetch_bddk1( year, month, table_no, grup_kod = 10001, currency = "TL", lang = "en" )fetch_bddk1( year, month, table_no, grup_kod = 10001, currency = "TL", lang = "en" )
year |
Year as 4-digit integer (YYYY). |
month |
Month as integer (1-12). |
table_no |
Table number to fetch (1-17). No default.
Use |
grup_kod |
Group code (10001-10010). Default 10001.
Use |
currency |
Currency code ("TL" or "USD"). Default "TL". |
lang |
Language ("en" or "tr"). Default "en". |
Data frame with a fetch_info attribute that contains query details.
fetch_finturk1() for quarterly province-level data.
# Single group code fetch_bddk1(2020, 3, 1, grup_kod = 10001) # Multiple group codes fetch_bddk1(2020, 3, 1, grup_kod = c(10001, 10002)) # Turkish language output fetch_bddk1(2020, 3, 1, grup_kod = 10001, lang = "tr")# Single group code fetch_bddk1(2020, 3, 1, grup_kod = 10001) # Multiple group codes fetch_bddk1(2020, 3, 1, grup_kod = c(10001, 10002)) # Turkish language output fetch_bddk1(2020, 3, 1, grup_kod = 10001, lang = "tr")
Fetches FinTurk data for a range of quarters by calling fetch_finturk1 iteratively.
fetch_finturk( start_year, start_month, end_year, end_month, table_no, grup_kod = 10001, il = 0, delay = 0.5, verbose = TRUE )fetch_finturk( start_year, start_month, end_year, end_month, table_no, grup_kod = 10001, il = 0, delay = 0.5, verbose = TRUE )
start_year, end_year
|
Starting/ending year (YYYY). |
start_month, end_month
|
Starting/ending month (3,6,9,12). |
table_no |
Table number to fetch (1-7). No default.
Use |
grup_kod |
Group code (10001-10007). Default 10001.
Use |
il |
plaka (license plate) number (0-81, 99). Default 0. |
delay |
Delay between requests in seconds. Default 0.5. |
verbose |
Print progress messages. Default TRUE. |
Combined data frame with "fetch_info" attribute.
fetch_bddk() for monthly BRSA data .
# Fetch multiple quarters my_data <- fetch_finturk(2024, 3, 2024, 9, table_no = 1)# Fetch multiple quarters my_data <- fetch_finturk(2024, 3, 2024, 9, table_no = 1)
Retrieves quarterly banking data from the BDDK FinTurk API for specified group codes and provinces. Supports multiple group codes and province codes in a single request.
fetch_finturk1(year, month, table_no, grup_kod = 10001, il = 0)fetch_finturk1(year, month, table_no, grup_kod = 10001, il = 0)
year |
Year as 4-digit integer (YYYY). |
month |
Month as integer (3,6,9,12 for quarterly data). |
table_no |
Table number to fetch (1-7). No default. |
grup_kod |
Group code (10001-1007). Default 10001. |
il |
plaka (license plate) number (0-81); 999 = Yurt Disi. Default 0.
0=HEPSI (All Cities), 1=Adana, 6=Ankara, 34=Istanbul, 35=Izmir, etc.
See |
The FinTurk API only provides data for quarter-ending months (March, June, September, December). Province codes follow Turkey's standard license plate numbering (1 = Adana, 6 = Ankara, 34 = Istanbul, etc.).
Data frame with a fetch_info attribute that contains query details.
fetch_bddk1() for monthly data without province granularity.
# Single group, all provinces fetch_finturk1(2020, 3, 1, grup_kod = 10001) # Multiple groups and specific provinces fetch_finturk1(2020, 3, 1, grup_kod = c(10006, 10007), il = c(6, 34)) # Single group, single province fetch_finturk1(2020, 3, 1, grup_kod = 10001, il = 34)# Single group, all provinces fetch_finturk1(2020, 3, 1, grup_kod = 10001) # Multiple groups and specific provinces fetch_finturk1(2020, 3, 1, grup_kod = c(10006, 10007), il = c(6, 34)) # Single group, single province fetch_finturk1(2020, 3, 1, grup_kod = 10001, il = 34)
List Available Cities for Finturk Print available cities for Finturk quarterly data with plaka (license plate) numbers.
list_cities()list_cities()
Data frame of available cities
list_cities()list_cities()
List available groups Print available banking groups for a data source.
list_groups(source = c("bddk", "finturk"), lang = c("en", "tr"))list_groups(source = c("bddk", "finturk"), lang = c("en", "tr"))
source |
Either "bddk" or "finturk" |
lang |
Either "tr" or "en" for names. "en" is default |
Data frame of available groups (invisibly)
list_groups("bddk") list_groups("finturk","tr")list_groups("bddk") list_groups("finturk","tr")
List Available Tables Print available tables for a data source.
list_tables(source = c("bddk", "finturk"), lang = c("en", "tr"))list_tables(source = c("bddk", "finturk"), lang = c("en", "tr"))
source |
Either "bddk" or "finturk" |
lang |
Either "tr" or "en" for column names. "en" is default |
Data frame of available tables (invisibly)
list_tables("bddk") list_tables("finturk", "tr")list_tables("bddk") list_tables("finturk", "tr")
Convert plaka (license plate number) to province name Maps Turkish license plate numbers to province names used in the Finturk API.
plaka_to_city(plaka)plaka_to_city(plaka)
plaka |
license plate number (0 for "HEPSI", 1-81 for provinces, 999 for "YURT DISI") |
province name in ALL CAPS as required by API
plaka_to_city(6) # "ANKARA" plaka_to_city(34) # "ISTANBUL" plaka_to_city(0) # "HEPSI"plaka_to_city(6) # "ANKARA" plaka_to_city(34) # "ISTANBUL" plaka_to_city(0) # "HEPSI"
Save Fetched Data to Multiple Formats
save_data(df, filename = NULL, format = "rds")save_data(df, filename = NULL, format = "rds")
df |
Data frame to save (with fetch_info attribute for auto-naming). |
filename |
Required. A non-empty string (without extension) must be provided. |
format |
Output format: "rds", "csv", or "xlsx". Default "rds". |
Full file path (invisibly).
my_data <- fetch_bddk1(2024, 1, 15) temp_file <- tempfile() # filename should be without extension save_data(my_data, temp_file, format = "csv")my_data <- fetch_bddk1(2024, 1, 15) temp_file <- tempfile() # filename should be without extension save_data(my_data, temp_file, format = "csv")