Title: | Economic Statistics System of the Bank of Korea |
---|---|
Description: | API wrapper to download statistical information from the Economic Statistics System (ECOS) of the Bank of Korea <https://ecos.bok.or.kr/api/#/>. |
Authors: | Seokhoon Joo [aut, cre], Jaehyun Joo [ctb] |
Maintainer: | Seokhoon Joo <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.6 |
Built: | 2025-02-17 02:43:26 UTC |
Source: | https://github.com/seokhoonj/ecos |
API wrapper to download statistical information from the Economic Statistics System (ECOS) of the Bank of Korea https://ecos.bok.or.kr/api/#/.
To use this package, you will first need to get your API key from the
website https://ecos.bok.or.kr/api/#/AuthKeyApply. Once you have your
key, you can save it as an environment variable for the current session
using the ecos.setKey
function. Alternatively, you can set it
permanently by adding the following line to your .Renviron file:
ECOS_API_KEY = PASTE YOUR API KEY
Any functions that require your API key try to retrieve it via
Sys.getenv("ECOS_API_KEY")
(unless API key is explicitly specified as
a function argument).
Maintainer: Seokhoon Joo [email protected]
Other contributors:
Jaehyun Joo [contributor]
The ecos open API has been revised on 2022.06.01. A calendar was created to respond to any type of date format according to the cycle argument.
calendar
calendar
A data frame with 73049 rows and 6 variables:
daily
semi-monthly
monthly
quarterly
semi-annually
annually
calendar
calendar
Save ECOS API key for the current session. To set it permanently, please add the following line to your .Renvrion file:
ECOS_API_KEY = YOUR API KEY
ecos.setKey(api_key) ecos.printKey()
ecos.setKey(api_key) ecos.printKey()
api_key |
A string specifying ECOS API key |
No return value, called to set api key
## Set API Key for the current session ecos.setKey("your_api_key") ## Check API key ecos.printKey()
## Set API Key for the current session ecos.setKey("your_api_key") ## Check API key ecos.printKey()
Top 100 statistical indicators
keyStatList(format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
keyStatList(format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
format |
A string specifying the file format to process - xml, json |
lang |
A string specifying the language of result value - kr (Korean), en (English) |
count |
An integer specifying the number of requests |
## Example keyStatList(lang = "en", count = 100)
A data.frame object containing queried information
Item list of statistics
statItemList( stat_code, format = c("xml", "json"), lang = c("kr", "en"), count = 1000 )
statItemList( stat_code, format = c("xml", "json"), lang = c("kr", "en"), count = 1000 )
stat_code |
A string specifying the statistical table code |
format |
A string specifying the file format to process - xml, json |
lang |
A string specifying the language of result value - kr (Korean), en (English) |
count |
An integer specifying the number of requests |
## Example statItemList(lang = "en", count = 100, stat_code = "902Y001")
A data.frame object containing queried information
Retrieve statistical meta DB
statMeta(meta, format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
statMeta(meta, format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
meta |
A string specifying the name of meta DB to query |
format |
A string specifying the file format to process - xml, json |
lang |
A string specifying the language of result value - kr (Korean), en (English) |
count |
An integer specifying the number of requests |
## Example statMeta(lang = "en", meta = "Economic Sentiment Index")
A data.frame object containing queried information
Search conditional statistics
statSearch( stat_code, item_code1, item_code2 = "?", item_code3 = "?", item_code4 = "?", cycle, start_time, end_time, format = c("xml", "json"), lang = c("kr", "en"), count )
statSearch( stat_code, item_code1, item_code2 = "?", item_code3 = "?", item_code4 = "?", cycle, start_time, end_time, format = c("xml", "json"), lang = c("kr", "en"), count )
stat_code |
A string specifying the statistical table code |
item_code1 |
A string specifying the statistical item 1 code |
item_code2 |
A string specifying the statistical item 2 code |
item_code3 |
A string specifying the statistical item 3 code |
item_code4 |
A string specifying the statistical item 4 code |
cycle |
A string specifying the cycle (Annual: A, Semi-Annual: S, Quarterly: Q, Monthly: M, Semi-Monthly: SM, Daily: D) |
start_time |
A string specifying the start date (according to cycle format: 2015, 2015S1, 2015Q1, 201501, 201501S1, 20150101, etc.) |
end_time |
A string specifying the end date (according to cycle format: 2015, 2015S1, 2015Q1, 201501, 201501S1, 20150101, etc.) |
format |
A string specifying the file format to process - xml, json |
lang |
A string specifying the language of result value - kr (Korean), en (English) |
count |
An integer specifying the number of requests |
## Example statSearch(lang = "en", stat_code = "102Y004", item_code1 = "ABA1", cycle = "M", start_time = "196001", end_time = "201812")
A data.frame object containing queried information
Table list of statistical tables
statTableList(format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
statTableList(format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
format |
A string specifying the file format to process - xml, json |
lang |
A string specifying the language of result value - kr (Korean), en (English) |
count |
An integer specifying the number of requests |
## Example statTableList(lang = "en", count = 100)
A data.frame object containing queried information
Glossary of Statistical Terms
statWord(word, format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
statWord(word, format = c("xml", "json"), lang = c("kr", "en"), count = 1000)
word |
A string specifying the term to search |
format |
A string specifying the file format to process - xml, json |
lang |
A string specifying the language of result value - kr (Korean), en (English) |
count |
An integer specifying the number of requests |
## Example statWord(word = "CPI", lang = "en")
A data.frame object containing queried information