본문 바로가기
  • Homines, dum docent, discunt
  • Repetitio est Mater Memoriae
  • Dilige et fac quod vis
지식 창고/R 언어

[R 웹 스크래핑 코드] 열린 재정 OPEN API 이용하기

by Manana Cho 2022. 5. 25.
반응형

열린 재정 재정 정보 공개 시스템은정부가 재원을 어떻게 조달, 관리,지출하는지를 공시합니다.

정부기관이다 보니 OPEN API를 통한 데이터를 공개하는데, 가이드라인이 불친절하여 여기 내용을 남깁니다. 

[1] 열린 재정 사이트: https://www.openfiscaldata.go.kr/op/ko/index

 

열린재정

공유 버튼보기 이전 공유하기

www.openfiscaldata.go.kr

[2] 재정 연구분석> 데이터공개> OPEN API 접속

[3] SNS 로그인 - OPEN API 인증키 신청

[4] OPEN API 목록의 서비스 유형을 클릭 시, 통계목록이 나오고, 이를 다운 받을 수 있습니다. 사용 편의성을 위해 함께 첨부합니다. 다운로드 버튼이 링크식이 아닌 java를 이용한 듯 하여 R의 download.file로 확인할 수는 없습니다. 

통계목록 다운로드.xlsx
0.02MB

여기서 OPEN API로 들어가면 가이드라인이 나오는데, SAMPLE KEY를 따라하면 일반 R에서는 데이터 수집이 불가능합니다. 따라서, 아래와 같이 사용하는 것을 권고드립니다. 

 

[5] [코드 양식]

openfin_apikey=[개인 인증키]

baseurl="https://openapi.openfiscaldata.go.kr/OPFI156"
Type='xml' #홈페이지 상에서는 json이 가능하다고 나와있으나, xml 밖에 지원하지 않는 것으로 나타남
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020 #필수 인자
url_fiscalrevstruct = paste0(baseurl,
                       '?Key=',openfin_apikey,
                       '&Type=',Type,
                       '&pIndex=',pIndex,
                       '&pSize=',pSize,
                       '&ACNT_YR=',ACNT_YR)
temp=read_xml(url_fiscalrevstruct)
temp0=xmlParse(temp)
fiscalrevstruct=xmlToDataFrame(getNodeSet(temp0, "//row"))
#fiscalrevstruct=xmleasyfun(url_fiscalrevstruct) #함수를 이용한 경우
fiscalrevstruct

 

*위의 함수를 이용한 경우에 대해: 

본 사이트는 각각의 통계 목록에 따라 URL이 달라지는데, 이럴 때마다 xml 불러오는 구문을 사용하는 것이 번거로워 함수로 정의하게 되었습니다.

xmleasyfun=function(url){
  temp=read_xml(url)
  temp0=xmlParse(temp)
  df=xmlToDataFrame(getNodeSet(temp0, "//row"))
}​​

 

[6] R 코드 파일

열린재정 R 코드.txt
0.10MB

 

[7] [전체코드] 

###Install Packages/Libraries-------------------------------
if (!require('httr')) install.packages('httr'); library('httr')
if (!require('tidyverse')) install.packages('tidyverse'); library('tidyverse')
if (!require('jsonlite')) install.packages('jsonlite'); library('jsonlite')
if (!require('rvest')) install.packages('rvest'); library('rvest')
if (!require('dplyr')) install.packages('dplyr'); library('dplyr')
if (!require('stringr')) install.packages('stringr'); library('stringr')
if (!require('magrittr')) install.packages('magrittr'); library('magrittr')
if (!require('shiny')) install.packages('shiny'); library('shiny')
if (!require('DT')) install.packages('DT'); library('DT')
if (!require('XML')) install.packages('XML'); library('XML')
if (!require('xml2')) install.packages('xml2'); library('xml2')
###열린재정 API-------------------------------
openfin_apikey=[개인 인증키]
openfin_statlist=read.csv("openfinstatlist.csv")
DT::datatable(openfin_statlist)
##본 재정 데이터는 코드에 대한 지침이 명확하지 않아 임의로 만들었습니다. 참고 부탁드립니다. 

#[1] 재정수입구조(본예산총수입기준) (fiscalrevstruct)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI156"
Type='xml' #홈페이지 상에서는 json이 가능하다고 나와있으나, xml 밖에 지원하지 않는 것으로 나타남
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020 #선택사항
url_fiscalrevstruct = paste0(baseurl,
                       '?Key=',openfin_apikey,
                       '&Type=',Type,
                       '&pIndex=',pIndex,
                       '&pSize=',pSize
                       #, '&ACNT_YR=',ACNT_YR
                       )
temp=read_xml(url_fiscalrevstruct)
temp0=xmlParse(temp)
fiscalrevstruct=xmlToDataFrame(getNodeSet(temp0, "//row"))
#fiscalrevstruct=xmleasyfun(url_fiscalrevstruct) #함수를 이용한 경우
fiscalrevstruct
write.csv(fiscalrevstruct,"fiscalrevstruct.csv")
#[2] 국세수입추이(taxrevtend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI157"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_taxrevtend = paste0(baseurl,
                             '?Key=',openfin_apikey,
                             '&Type=',Type,
                             '&pIndex=',pIndex,
                             '&pSize=',pSize
                             #, '&ACNT_YR=',ACNT_YR
                        )
fiscalrevstruct=xmleasyfun(url_taxrevtend) #함수를 이용한 경우
fiscalrevstruct
write.csv(fiscalrevstruct,"fiscalrevstruct.csv")
#[3] 조세부담률및국민부담률추이(taxburden)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI141"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_taxburden = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize
                        #, '&ACNT_YR=',ACNT_YR
                       )
taxburden=xmleasyfun(url_taxburden) #함수를 이용한 경우
taxburden
write.csv(taxburden,"taxburden.csv")
#[4] 일반·특별회계세외수입추이(extrataxrev)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI158"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_extrataxrev = paste0(baseurl,
                       '?Key=',openfin_apikey,
                       '&Type=',Type,
                       '&pIndex=',pIndex,
                       '&pSize=',pSize
                       #, '&ACNT_YR=',ACNT_YR
                       )
extrataxrev=xmleasyfun(url_extrataxrev) #함수를 이용한 경우
extrataxrev
write.csv(extrataxrev,"extrataxrev.csv")
#[5] 기금수입추이(fundrev)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI159"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_fundrev = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR
                     )
fundrev=xmleasyfun(url_fundrev) #함수를 이용한 경우
fundrev
write.csv(fundrev,"fundrev.csv")
#[6] 재정지출추이(본예산총지출기준)(fisoutflowtend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI171"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_fisoutflowtend = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize
                     #, '&ACNT_YR=',ACNT_YR
                     )
fisoutflowtend=xmleasyfun(url_fisoutflowtend) #함수를 이용한 경우
fisoutflowtend
write.csv(fisoutflowtend,"fisoutflowtend.csv")
#[7] 재정지출추이(총계기준)(totalfisouttend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI160"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_totalfisouttend = paste0(baseurl,
                            '?Key=',openfin_apikey,
                            '&Type=',Type,
                            '&pIndex=',pIndex,
                            '&pSize=',pSize
                            #, '&ACNT_YR=',ACNT_YR
                            )
totalfisouttend=xmleasyfun(url_totalfisouttend) #함수를 이용한 경우
totalfisouttend
write.csv(totalfisouttend,"totalfisouttend.csv")
#[8] 특별회계별재정지출추이(총지출기준)(specacctouttend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI161"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_specacctouttend = paste0(baseurl,
                             '?Key=',openfin_apikey,
                             '&Type=',Type,
                             '&pIndex=',pIndex,
                             '&pSize=',pSize
                             #, '&ACNT_YR=',ACNT_YR
                             )
specacctouttend=xmleasyfun(url_specacctouttend) #함수를 이용한 경우
specacctouttend
write.csv(specacctouttend,"specacctouttend.csv")
#[9] 기금성격별운용규모(총지출기준)(fundtypeoperscale)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI162"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_fundtypeoperscale = paste0(baseurl,
                             '?Key=',openfin_apikey,
                             '&Type=',Type,
                             '&pIndex=',pIndex,
                             '&pSize=',pSize
                             #, '&ACNT_YR=',ACNT_YR
                             )
fundtypeoperscale=xmleasyfun(url_fundtypeoperscale) #함수를 이용한 경우
fundtypeoperscale
write.csv(fundtypeoperscale,"fundtypeoperscale.csv")
#[10] 사업성기금운용규모(총지출기준)(projfundoperscale)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI163"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_projfundoperscale = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize
                           #, '&ACNT_YR=',ACNT_YR
                           )
projfundoperscale=xmleasyfun(url_projfundoperscale) #함수를 이용한 경우
projfundoperscale
write.csv(projfundoperscale,"projfundoperscale.csv")
#[11] 기금운용구분별운용규모(총지출기준)(fundstandoperscale)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI164"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_fundstandoperscale = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize
                           #, '&ACNT_YR=',ACNT_YR
                           )
fundstandoperscale=xmleasyfun(url_fundstandoperscale) #함수를 이용한 경우
fundstandoperscale
write.csv(fundstandoperscale,"fundstandoperscale.csv")
#[12] 분야별재원배분(총지출기준)(catefinsdist)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI165"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_catefinsdist = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize
                                #, '&ACNT_YR=',ACNT_YR
                          )
catefinsdist=xmleasyfun(url_catefinsdist) #함수를 이용한 경우
catefinsdist
write.csv(catefinsdist,"catefinsdist.csv")
#[13] 의무·재량지출규모추이(obliexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI142"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_obliexptend = paste0(baseurl,
                               '?Key=',openfin_apikey,
                               '&Type=',Type,
                               '&pIndex=',pIndex,
                               '&pSize=',pSize
                               #, '&ACNT_YR=',ACNT_YR
                         )
obliexptend=xmleasyfun(url_obliexptend) #함수를 이용한 경우
obliexptend
write.csv(obliexptend,"obliexptend.csv")
#[14] 중앙관서별총지출추이(deptexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI166"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_deptexptend = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR
                         )
deptexptend=xmleasyfun(url_deptexptend) #함수를 이용한 경우
deptexptend
write.csv(deptexptend,"deptexptend.csv")
#[15] 성질별지출추이(chrexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI123"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_chrexptend = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR
                        )
chrexptend=xmleasyfun(url_chrexptend) #함수를 이용한 경우
chrexptend
write.csv(chrexptend,"chrexptend.csv")
#[16] 인건비편성사업지출추이(laborprojexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI124"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_laborprojexptend = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize
                        #, '&ACNT_YR=',ACNT_YR
                        )
laborprojexptend=xmleasyfun(url_laborprojexptend) #함수를 이용한 경우
laborprojexptend
write.csv(laborprojexptend,"laborprojexptend.csv")
#[17] 기본경비추이(adminexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI125"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_adminexptend = paste0(baseurl,
                              '?Key=',openfin_apikey,
                              '&Type=',Type,
                              '&pIndex=',pIndex,
                              '&pSize=',pSize
                              #, '&ACNT_YR=',ACNT_YR
                          )
adminexptend=xmleasyfun(url_adminexptend) #함수를 이용한 경우
adminexptend
write.csv(adminexptend,"adminexptend.csv")
#[18] 본예산기준인건비,경비,사업비추이(budgetexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI126"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_budgetexptend = paste0(baseurl,
                          '?Key=',openfin_apikey,
                          '&Type=',Type,
                          '&pIndex=',pIndex,
                          '&pSize=',pSize
                          #, '&ACNT_YR=',ACNT_YR
                          )
budgetexptend=xmleasyfun(url_budgetexptend) #함수를 이용한 경우
budgetexptend
write.csv(budgetexptend,"budgetexptend.csv")
#[19] 본예산기준인건비,경비,사업비추이(capitalexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI127"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_capitalexptend = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize
                           #, '&ACNT_YR=',ACNT_YR
                           )
capitalexptend=xmleasyfun(url_capitalexptend) #함수를 이용한 경우
capitalexptend
write.csv(capitalexptend,"capitalexptend.csv")
#[20] 분야별출자금추이(investperfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI128"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_investperfield = paste0(baseurl,
                            '?Key=',openfin_apikey,
                            '&Type=',Type,
                            '&pIndex=',pIndex,
                            '&pSize=',pSize
                            #, '&ACNT_YR=',ACNT_YR
                            )
investperfield=xmleasyfun(url_investperfield) #함수를 이용한 경우
investperfield
write.csv(investperfield,"investperfield.csv")
#[21] 분야별융자지출추이(liabperfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI129"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_liabperfield = paste0(baseurl,
                            '?Key=',openfin_apikey,
                            '&Type=',Type,
                            '&pIndex=',pIndex,
                            '&pSize=',pSize
                            #, '&ACNT_YR=',ACNT_YR
                          )
liabperfield=xmleasyfun(url_liabperfield) #함수를 이용한 경우
liabperfield
write.csv(liabperfield,"liabperfield.csv")
#[22] 분야별이차보전지출추이(secexpperfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI130"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_secexpperfield = paste0(baseurl,
                          '?Key=',openfin_apikey,
                          '&Type=',Type,
                          '&pIndex=',pIndex,
                          '&pSize=',pSize
                          #, '&ACNT_YR=',ACNT_YR
                          )
secexpperfield=xmleasyfun(url_secexpperfield) #함수를 이용한 경우
secexpperfield
write.csv(secexpperfield,"secexpperfield.csv")
#[23]국고보조사업지출추이(govproexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI131"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_govproexptend = paste0(baseurl,
                            '?Key=',openfin_apikey,
                            '&Type=',Type,
                            '&pIndex=',pIndex,
                            '&pSize=',pSize
                            #, '&ACNT_YR=',ACNT_YR
                           )
govproexptend=xmleasyfun(url_govproexptend) #함수를 이용한 경우
govproexptend
write.csv(govproexptend,"govproexptend.csv")
#[24]분야별국고보조사업지출추이(govproexptendbyfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI132"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_govproexptendbyfield = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize
                           #, '&ACNT_YR=',ACNT_YR
                           )
govproexptendbyfield=xmleasyfun(url_govproexptendbyfield) #함수를 이용한 경우
govproexptendbyfield
write.csv(govproexptendbyfield,"govproexptendbyfield.csv")
#[25]출연금지출추이(investexptend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI133"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_investexptend = paste0(baseurl,
                                  '?Key=',openfin_apikey,
                                  '&Type=',Type,
                                  '&pIndex=',pIndex,
                                  '&pSize=',pSize
                                  #, '&ACNT_YR=',ACNT_YR
                           )
investexptend=xmleasyfun(url_investexptend) #함수를 이용한 경우
investexptend
write.csv(investexptend,"investexptend.csv")
#[26]분야별출연금지출추이(investexptendbyfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI134"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_investexptendbyfield = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize
                           #, '&ACNT_YR=',ACNT_YR
                           )
investexptendbyfield=xmleasyfun(url_investexptendbyfield) #함수를 이용한 경우
investexptendbyfield
write.csv(investexptendbyfield,"investexptendbyfield.csv")
#[27]총지출기준집행추이(totexpstantend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI113"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_totexpstantend = paste0(baseurl,
                                  '?Key=',openfin_apikey,
                                  '&Type=',Type,
                                  '&pIndex=',pIndex,
                                  '&pSize=',pSize
                                  #, '&ACNT_YR=',ACNT_YR'
                                  )
totexpstantend=xmleasyfun(url_totexpstantend) #함수를 이용한 경우
totexpstantend
write.csv(totexpstantend,"totexpstantend.csv")
#[28]회계·기금별집행추이(acctfundtend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI114"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_acctfundtend = paste0(baseurl,
                            '?Key=',openfin_apikey,
                            '&Type=',Type,
                            '&pIndex=',pIndex,
                            '&pSize=',pSize
                            #, '&ACNT_YR=',ACNT_YR'
)
acctfundtend=xmleasyfun(url_acctfundtend) #함수를 이용한 경우
acctfundtend
write.csv(acctfundtend,"acctfundtend.csv")
#[29]회계·기금별이월추이(acctfundnexttend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI115"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_acctfundnexttend = paste0(baseurl,
                          '?Key=',openfin_apikey,
                          '&Type=',Type,
                          '&pIndex=',pIndex,
                          '&pSize=',pSize
                          #, '&ACNT_YR=',ACNT_YR'
)
acctfundnexttend=xmleasyfun(url_acctfundnexttend) #함수를 이용한 경우
acctfundnexttend
write.csv(acctfundnexttend,"acctfundnexttend.csv")
#[30]회계·기금별불용추이(acctfundnonusetend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI116"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_acctfundnonusetend = paste0(baseurl,
                              '?Key=',openfin_apikey,
                              '&Type=',Type,
                              '&pIndex=',pIndex,
                              '&pSize=',pSize
                              #, '&ACNT_YR=',ACNT_YR'
)
acctfundnonusetend=xmleasyfun(url_acctfundnonusetend) #함수를 이용한 경우
acctfundnonusetend
write.csv(acctfundnonusetend,"acctfundnonusetend.csv")
#[31]분야별이월추이(nextbyfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI118"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_nextbyfield = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize
                                #, '&ACNT_YR=',ACNT_YR'
)
nextbyfield=xmleasyfun(url_nextbyfield) #함수를 이용한 경우
nextbyfield
write.csv(nextbyfield,"nextbyfield.csv")
#[32]분야별불용추이(nonusebyfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI119"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_nonusebyfield = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR'
)
nonusebyfield=xmleasyfun(url_nonusebyfield) #함수를 이용한 경우
nonusebyfield
write.csv(nonusebyfield,"nonusebyfield.csv")
#[33]분야별집행추이(exebyfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI117"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_exebyfield = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize
                           #, '&ACNT_YR=',ACNT_YR'
)
exebyfield=xmleasyfun(url_exebyfield) #함수를 이용한 경우
exebyfield
write.csv(exebyfield,"exebyfield.csv")
#[34]성질별집행추이(exebychr)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI120"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_exebychr = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize
                        #, '&ACNT_YR=',ACNT_YR'
)
exebychr=xmleasyfun(url_exebychr) #함수를 이용한 경우
exebychr
write.csv(exebychr,"exebychr.csv")
#[35]이월의성질별추이(nextbychr)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI121"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_nextbychr = paste0(baseurl,
                      '?Key=',openfin_apikey,
                      '&Type=',Type,
                      '&pIndex=',pIndex,
                      '&pSize=',pSize
                      #, '&ACNT_YR=',ACNT_YR'
)
nextbychr=xmleasyfun(url_nextbychr) #함수를 이용한 경우
nextbychr
write.csv(nextbychr,"nextbychr.csv")
#[36]불용성질별추이(nonusebychr)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI121"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_nonusebychr = paste0(baseurl,
                       '?Key=',openfin_apikey,
                       '&Type=',Type,
                       '&pIndex=',pIndex,
                       '&pSize=',pSize
                       #, '&ACNT_YR=',ACNT_YR'
)
nonusebychr=xmleasyfun(url_nonusebychr) #함수를 이용한 경우
nonusebychr
write.csv(nonusebychr,"nonusebychr.csv")
#[37]작성기준별주요재정통계(중앙정부기준)(mainfinstat)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI150"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_mainfinstat = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR'
)
mainfinstat=xmleasyfun(url_mainfinstat) #함수를 이용한 경우
mainfinstat
write.csv(mainfinstat,"mainfinstat.csv")
#[38]성질별국가채무추이(govliabychr)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI152"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_govliabychr = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR'
)
govliabychr=xmleasyfun(url_govliabychr) #함수를 이용한 경우
govliabychr
write.csv(govliabychr,"govliabychr.csv")
#[38]성질별국가채무추이(govliabychr)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI152"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_govliabychr = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR'
)
govliabychr=xmleasyfun(url_govliabychr) #함수를 이용한 경우
govliabychr
write.csv(govliabychr,"govliabychr.csv")

###[CAUTIOUS] 일반 정부부채, 공공부문 부채는 OPENAPI를 제공하지 않습니다.-----

#[39]연도별총세입·총세출예산및결산(annualbudgetbalance)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI140"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_annualbudgetbalance = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize
                         #, '&ACNT_YR=',ACNT_YR'
)
annualbudgetbalance=xmleasyfun(url_annualbudgetbalance) #함수를 이용한 경우
annualbudgetbalance
write.csv(annualbudgetbalance,"annualbudgetbalance.csv")
#[40]연도별지방교부세추이(annuallocaltaxtend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI168"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_annuallocaltaxtend = paste0(baseurl,
                                 '?Key=',openfin_apikey,
                                 '&Type=',Type,
                                 '&pIndex=',pIndex,
                                 '&pSize=',pSize
                                 #, '&ACNT_YR=',ACNT_YR'
)
annuallocaltaxtend=xmleasyfun(url_annuallocaltaxtend) #함수를 이용한 경우
annuallocaltaxtend
write.csv(annuallocaltaxtend,"annuallocaltaxtend.csv")
#[41]연도별교육재정교부금추이(annualedufin)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI170"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_annualedufin = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize
                                #, '&ACNT_YR=',ACNT_YR'
)
annualedufin=xmleasyfun(url_annualedufin) #함수를 이용한 경우
annualedufin
write.csv(annualedufin,"annualedufin.csv")
#[42]자치단체국고보조사업추이(localsubproj)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI167"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_localsubproj = paste0(baseurl,
                          '?Key=',openfin_apikey,
                          '&Type=',Type,
                          '&pIndex=',pIndex,
                          '&pSize=',pSize
                          #, '&ACNT_YR=',ACNT_YR'
)
localsubproj=xmleasyfun(url_localsubproj) #함수를 이용한 경우
localsubproj
write.csv(localsubproj,"localsubproj.csv")
###[CAUTIOUS] 기금별운용현황은 OPENAPI를 제공하지 않습니다.-----
#[43]분야별 프로그램 예산(programbudgetbyfield)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI172"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_programbudgetbyfield = paste0(baseurl,
                          '?Key=',openfin_apikey,
                          '&Type=',Type,
                          '&pIndex=',pIndex,
                          '&pSize=',pSize
                          #, '&ACNT_YR=',ACNT_YR'
)
programbudgetbyfield=xmleasyfun(url_programbudgetbyfield) #함수를 이용한 경우
programbudgetbyfield
write.csv(programbudgetbyfield,"programbudgetbyfield.csv")
#[44]세부사업 예산편성현황(총액)(detailprojbudget)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ExpenditureBudgetInit5"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailprojbudget = paste0(baseurl,
                                  '?Key=',openfin_apikey,
                                  '&Type=',Type,
                                  '&pIndex=',pIndex,
                                  '&pSize=',pSize,
                                  '&FSCL_YY=',FSCL_YY
)
detailprojbudget=xmleasyfun(url_detailprojbudget) #함수를 이용한 경우
detailprojbudget
write.csv(detailprojbudget,"detailprojbudget.csv")
#[45]세목 예산편성현황(총액)(detailledgerbudget)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ExpenditureBudgetInit6"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailledgerbudget = paste0(baseurl,
                              '?Key=',openfin_apikey,
                              '&Type=',Type,
                              '&pIndex=',pIndex,
                              '&pSize=',pSize,
                              '&FSCL_YY=',FSCL_YY
)
detailledgerbudget=xmleasyfun(url_detailledgerbudget) #함수를 이용한 경우
detailledgerbudget
write.csv(detailledgerbudget,"detailledgerbudget.csv")
#[46]세부사업 예산편성현황(총지출)(detailprojbudgetstatus)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/TotalExpenditure5"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailprojbudgetstatus = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize,
                                '&FSCL_YY=',FSCL_YY
)
detailprojbudgetstatus=xmleasyfun(url_detailprojbudgetstatus) #함수를 이용한 경우
detailprojbudgetstatus
write.csv(detailprojbudgetstatus,"detailprojbudgetstatus.csv")
#[47]세목 예산편성현황(총지출)(detailledgerbudgettotalexp)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/TotalExpenditure6"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailledgerbudgettotalexp = paste0(baseurl,
                                    '?Key=',openfin_apikey,
                                    '&Type=',Type,
                                    '&pIndex=',pIndex,
                                    '&pSize=',pSize,
                                    '&FSCL_YY=',FSCL_YY
)
detailledgerbudgettotalexp=xmleasyfun(url_detailledgerbudgettotalexp) #함수를 이용한 경우
detailledgerbudgettotalexp
write.csv(detailledgerbudgettotalexp,"detailledgerbudgettotalexp.csv")
#[47]세부사업 예산편성현황(외화)(detailprojbudgetforecurr)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ForeignExpenditureBudgget5"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailprojbudgetforecurr = paste0(baseurl,
                                        '?Key=',openfin_apikey,
                                        '&Type=',Type,
                                        '&pIndex=',pIndex,
                                        '&pSize=',pSize,
                                        '&FSCL_YY=',FSCL_YY
)
detailprojbudgetforecurr=xmleasyfun(url_detailprojbudgetforecurr) #함수를 이용한 경우
detailprojbudgetforecurr
write.csv(detailprojbudgetforecurr,"detailprojbudgetforecurr.csv")
#[48]세목 예산편성현황(외화)(detailledgerbudgetforecurr)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ForeignExpenditureBudgget6"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailledgerbudgetforecurr = paste0(baseurl,
                                      '?Key=',openfin_apikey,
                                      '&Type=',Type,
                                      '&pIndex=',pIndex,
                                      '&pSize=',pSize,
                                      '&FSCL_YY=',FSCL_YY
)
detailledgerbudgetforecurr=xmleasyfun(url_detailledgerbudgetforecurr) #함수를 이용한 경우
detailledgerbudgetforecurr
write.csv(detailledgerbudgetforecurr,"detailledgerbudgetforecurr.csv")
#[49]세출 세부사업 예산편성현황(추경포함)(detailbudgetexp)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ExpenditureBudgetAdd7"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailbudgetexp = paste0(baseurl,
                                        '?Key=',openfin_apikey,
                                        '&Type=',Type,
                                        '&pIndex=',pIndex,
                                        '&pSize=',pSize,
                                        '&FSCL_YY=',FSCL_YY
)
detailbudgetexp=xmleasyfun(url_detailbudgetexp) #함수를 이용한 경우
detailbudgetexp
write.csv(detailbudgetexp,"detailbudgetexp.csv")
#[50]세출 세부사업 예산편성현황(추경포함)(detailledgerbudgetexp)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ExpenditureBudgetAdd8"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_detailledgerbudgetexp = paste0(baseurl,
                             '?Key=',openfin_apikey,
                             '&Type=',Type,
                             '&pIndex=',pIndex,
                             '&pSize=',pSize,
                             '&FSCL_YY=',FSCL_YY
)
detailledgerbudgetexp=xmleasyfun(url_detailledgerbudgetexp) #함수를 이용한 경우
detailledgerbudgetexp
write.csv(detailledgerbudgetexp,"detailledgerbudgetexp.csv")
#[51]예산편성현황(총액)(BudgetRevenuesInit2)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/BudgetRevenuesInit2"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_BudgetRevenuesInit2 = paste0(baseurl,
                                   '?Key=',openfin_apikey,
                                   '&Type=',Type,
                                   '&pIndex=',pIndex,
                                   '&pSize=',pSize,
                                   '&FSCL_YY=',FSCL_YY
)
BudgetRevenuesInit2=xmleasyfun(url_BudgetRevenuesInit2) #함수를 이용한 경우
BudgetRevenuesInit2
write.csv(BudgetRevenuesInit2,"BudgetRevenuesInit2.csv")
#[52]예산편성현황(총액)(TotalRevenue2)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/TotalRevenue2"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_TotalRevenue2 = paste0(baseurl,
                                 '?Key=',openfin_apikey,
                                 '&Type=',Type,
                                 '&pIndex=',pIndex,
                                 '&pSize=',pSize,
                                 '&FSCL_YY=',FSCL_YY
)
TotalRevenue2=xmleasyfun(url_TotalRevenue2) #함수를 이용한 경우
TotalRevenue2
write.csv(TotalRevenue2,"TotalRevenue2.csv")
#[53]예산편성현황(외화)(BudgetRevenuesAdd3)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/BudgetRevenuesAdd3"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_BudgetRevenuesAdd3 = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize,
                           '&FSCL_YY=',FSCL_YY
)
BudgetRevenuesAdd3=xmleasyfun(url_BudgetRevenuesAdd3) #함수를 이용한 경우
BudgetRevenuesAdd3
write.csv(BudgetRevenuesAdd3,"BudgetRevenuesAdd3.csv")
#[54]정부구매예산(GovOrdBz1)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/GovOrdBz1"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_GovOrdBz1 = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize,
                                '&FSCL_YY=',FSCL_YY
)
GovOrdBz1=xmleasyfun(url_GovOrdBz1) #함수를 이용한 경우
GovOrdBz1
write.csv(GovOrdBz1,"GovOrdBz1.csv")
#[55]월별 수입징수상황(VWFORM)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VWFORM"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VWFORM = paste0(baseurl,
                       '?Key=',openfin_apikey,
                       '&Type=',Type,
                       '&pIndex=',pIndex,
                       '&pSize=',pSize,
                       '&FSCL_YY=',FSCL_YY
)
VWFORM=xmleasyfun(url_VWFORM) #함수를 이용한 경우
VWFORM
write.csv(VWFORM,"VWFORM.csv")
#[56]월별 수입징수상황(VWFORM2)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VWFORM2"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VWFORM2 = paste0(baseurl,
                    '?Key=',openfin_apikey,
                    '&Type=',Type,
                    '&pIndex=',pIndex,
                    '&pSize=',pSize,
                    '&FSCL_YY=',FSCL_YY
)
VWFORM2=xmleasyfun(url_VWFORM2) #함수를 이용한 경우
VWFORM2
write.csv(VWFORM2,"VWFORM2.csv")
#[57]월별 수입징수상황(VWFORD)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VWFORD"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VWFORD = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&FSCL_YY=',FSCL_YY
)
VWFORD=xmleasyfun(url_VWFORD) #함수를 이용한 경우
VWFORD
write.csv(VWFORD,"VWFORD.csv")
#[58]월별 지출집행상황(VWFOEM)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VWFOEM"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VWFOEM = paste0(baseurl,
                    '?Key=',openfin_apikey,
                    '&Type=',Type,
                    '&pIndex=',pIndex,
                    '&pSize=',pSize,
                    '&FSCL_YY=',FSCL_YY
)
VWFOEM=xmleasyfun(url_VWFOEM) #함수를 이용한 경우
VWFOEM
write.csv(VWFOEM,"VWFOEM.csv")
#[59]월별 지출운용상황(VWFOEM2)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VWFOEM2"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VWFOEM2 = paste0(baseurl,
                    '?Key=',openfin_apikey,
                    '&Type=',Type,
                    '&pIndex=',pIndex,
                    '&pSize=',pSize,
                    '&FSCL_YY=',FSCL_YY
)
VWFOEM2=xmleasyfun(url_VWFOEM2) #함수를 이용한 경우
VWFOEM2
write.csv(VWFOEM2,"VWFOEM2.csv")
#[60]일별 지출운용상황(VWFOED)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VWFOED"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VWFOED = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&FSCL_YY=',FSCL_YY
)
VWFOED=xmleasyfun(url_VWFOED) #함수를 이용한 경우
VWFOED
write.csv(VWFOED,"VWFOED.csv")
#[61]소관별 주요관리대상사업 집행실적(VW_FOBM302)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOBM302"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOBM302 = paste0(baseurl,
                    '?Key=',openfin_apikey,
                    '&Type=',Type,
                    '&pIndex=',pIndex,
                    '&pSize=',pSize,
                    '&FSCL_YY=',FSCL_YY
)
VW_FOBM302=xmleasyfun(url_VW_FOBM302) #함수를 이용한 경우
VW_FOBM302
write.csv(VW_FOBM302,"VW_FOBM302.csv")
#[62]소관별 주요관리대상사업 집행실적(VW_FOBM303)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOBM303"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOBM303 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOBM303=xmleasyfun(url_VW_FOBM303) #함수를 이용한 경우
VW_FOBM303
write.csv(VW_FOBM303,"VW_FOBM303.csv")
#[63]총사업비현황(TotalProjectCost)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/TotalProjectCost"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_TotalProjectCost = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
TotalProjectCost=xmleasyfun(url_TotalProjectCost) #함수를 이용한 경우
TotalProjectCost
write.csv(TotalProjectCost,"TotalProjectCost.csv")
#[64]국유재산 증감 및 현재액 총괄(National)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/National"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_National = paste0(baseurl,
                              '?Key=',openfin_apikey,
                              '&Type=',Type,
                              '&pIndex=',pIndex,
                              '&pSize=',pSize,
                              '&FSCL_YY=',FSCL_YY
)
National=xmleasyfun(url_National) #함수를 이용한 경우
National
write.csv(National,"National.csv")
#[65]국유재산현황(NationalProperty)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/NationalPropertyProperty"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_NationalProperty = paste0(baseurl,
                      '?Key=',openfin_apikey,
                      '&Type=',Type,
                      '&pIndex=',pIndex,
                      '&pSize=',pSize,
                      '&FSCL_YY=',FSCL_YY
)
NationalProperty=xmleasyfun(url_NationalProperty) #함수를 이용한 경우
NationalProperty
write.csv(NationalProperty,"NationalProperty.csv")
#[66]국유재산현황(StateOwnedLands)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/StateOwnedLands"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_StateOwnedLands = paste0(baseurl,
                              '?Key=',openfin_apikey,
                              '&Type=',Type,
                              '&pIndex=',pIndex,
                              '&pSize=',pSize,
                              '&FSCL_YY=',FSCL_YY
)
StateOwnedLands=xmleasyfun(url_StateOwnedLands) #함수를 이용한 경우
StateOwnedLands
write.csv(StateOwnedLands,"StateOwnedLands.csv")
#[Cautious]종류별 국유재산 현황 OPEN API는 지원되지 않습니다.-----------
#[Cautious]중앙관서별 국유지 현황 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지역별 국유지 현황 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지목별 국유지 현황 OPEN API는 지원되지 않습니다.-----------
#[Cautious]용도별 국유건물 현황 OPEN API는 지원되지 않습니다.-----------
#[Cautious]중앙관서별 국유건물현황 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지역별 국유건물 현황 OPEN API는 지원되지 않습니다.-----------
#[Cautious]e나라재산 바로가기 OPEN API는 지원되지 않습니다.-----------
#[67]부담금운용현황(LevyingAmount)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/LevyingAmount"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_LevyingAmount = paste0(baseurl,
                             '?Key=',openfin_apikey,
                             '&Type=',Type,
                             '&pIndex=',pIndex,
                             '&pSize=',pSize,
                             '&FSCL_YY=',FSCL_YY
)
LevyingAmount=xmleasyfun(url_LevyingAmount) #함수를 이용한 경우
LevyingAmount
write.csv(LevyingAmount,"LevyingAmount.csv")
#[67]소관별 세입/세출 결산 현황(DepartRevenExpenSettle)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/DepartRevenExpenSettle"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_DepartRevenExpenSettle = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize,
                           '&FSCL_YY=',FSCL_YY
)
DepartRevenExpenSettle=xmleasyfun(url_DepartRevenExpenSettle) #함수를 이용한 경우
DepartRevenExpenSettle
write.csv(DepartRevenExpenSettle,"DepartRevenExpenSettle.csv")
#[68]세입/수입 결산 현황(RevenuesSettled)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/RevenuesSettled"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_RevenuesSettled = paste0(baseurl,
                                    '?Key=',openfin_apikey,
                                    '&Type=',Type,
                                    '&pIndex=',pIndex,
                                    '&pSize=',pSize,
                                    '&FSCL_YY=',FSCL_YY
)
RevenuesSettled=xmleasyfun(url_RevenuesSettled) #함수를 이용한 경우
RevenuesSettled
write.csv(RevenuesSettled,"RevenuesSettled.csv")
#[69]세출/지출 결산 현황(ExpendituresSettlement)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ExpendituresSettlement"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_ExpendituresSettlement = paste0(baseurl,
                             '?Key=',openfin_apikey,
                             '&Type=',Type,
                             '&pIndex=',pIndex,
                             '&pSize=',pSize,
                             '&FSCL_YY=',FSCL_YY
)
ExpendituresSettlement=xmleasyfun(url_ExpendituresSettlement) #함수를 이용한 경우
ExpendituresSettlement
write.csv(ExpendituresSettlement,"ExpendituresSettlement.csv")
#[70]회계별 세입/세출 결산 현황(FiacalRevenExpenSettle)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/FiacalRevenExpenSettle"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_FiacalRevenExpenSettle = paste0(baseurl,
                                    '?Key=',openfin_apikey,
                                    '&Type=',Type,
                                    '&pIndex=',pIndex,
                                    '&pSize=',pSize,
                                    '&FSCL_YY=',FSCL_YY
)
FiacalRevenExpenSettle=xmleasyfun(url_FiacalRevenExpenSettle) #함수를 이용한 경우
FiacalRevenExpenSettle
write.csv(FiacalRevenExpenSettle,"FiacalRevenExpenSettle.csv")
#[71]회계별 세입 결산 현황(FiscalRevenSettle)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/FiscalRevenSettle"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_FiscalRevenSettle = paste0(baseurl,
                                    '?Key=',openfin_apikey,
                                    '&Type=',Type,
                                    '&pIndex=',pIndex,
                                    '&pSize=',pSize,
                                    '&FSCL_YY=',FSCL_YY
)
FiscalRevenSettle=xmleasyfun(url_FiscalRevenSettle) #함수를 이용한 경우
FiscalRevenSettle
write.csv(FiscalRevenSettle,"FiscalRevenSettle.csv")
#[72]회계별 세출 결산 현황(FiscalExpenSettle)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/FiscalExpenSettle"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_FiscalExpenSettle = paste0(baseurl,
                               '?Key=',openfin_apikey,
                               '&Type=',Type,
                               '&pIndex=',pIndex,
                               '&pSize=',pSize,
                               '&FSCL_YY=',FSCL_YY
)
FiscalExpenSettle=xmleasyfun(url_FiscalExpenSettle) #함수를 이용한 경우
FiscalExpenSettle
write.csv(FiscalExpenSettle,"FiscalExpenSettle.csv")
#[73]기금별 수입/지출 결산 현황(ClosingFundRevenuesExpenses)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ClosingFundRevenuesExpenses"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_ClosingFundRevenuesExpenses = paste0(baseurl,
                               '?Key=',openfin_apikey,
                               '&Type=',Type,
                               '&pIndex=',pIndex,
                               '&pSize=',pSize,
                               '&FSCL_YY=',FSCL_YY
)
ClosingFundRevenuesExpenses=xmleasyfun(url_ClosingFundRevenuesExpenses) #함수를 이용한 경우
ClosingFundRevenuesExpenses
write.csv(ClosingFundRevenuesExpenses,"ClosingFundRevenuesExpenses.csv")
#[74]세계잉여금(AnnualSurplusBudget)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/AnnualSurplusBudget"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_AnnualSurplusBudget = paste0(baseurl,
                                         '?Key=',openfin_apikey,
                                         '&Type=',Type,
                                         '&pIndex=',pIndex,
                                         '&pSize=',pSize,
                                         '&FSCL_YY=',FSCL_YY
)
AnnualSurplusBudget=xmleasyfun(url_AnnualSurplusBudget) #함수를 이용한 경우
AnnualSurplusBudget
write.csv(AnnualSurplusBudget,"AnnualSurplusBudget.csv")
#[75]연기금투자풀 수탁규모(분기별)(ConsignInvestPoolSizeQuarter)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ConsignInvestPoolSizeQuarter"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_ConsignInvestPoolSizeQuarter = paste0(baseurl,
                                 '?Key=',openfin_apikey,
                                 '&Type=',Type,
                                 '&pIndex=',pIndex,
                                 '&pSize=',pSize,
                                 '&FSCL_YY=',FSCL_YY
)
ConsignInvestPoolSizeQuarter=xmleasyfun(url_ConsignInvestPoolSizeQuarter) #함수를 이용한 경우
ConsignInvestPoolSizeQuarter
write.csv(ConsignInvestPoolSizeQuarter,"ConsignInvestPoolSizeQuarter.csv")
#[76]연기금투자풀 기간수익률(분기별)(ConsignInvestPoolPeriodQuarter)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ConsignInvestPoolPeriodQuarter"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_ConsignInvestPoolPeriodQuarter = paste0(baseurl,
                                          '?Key=',openfin_apikey,
                                          '&Type=',Type,
                                          '&pIndex=',pIndex,
                                          '&pSize=',pSize,
                                          '&FSCL_YY=',FSCL_YY
)
ConsignInvestPoolPeriodQuarter=xmleasyfun(url_ConsignInvestPoolPeriodQuarter) #함수를 이용한 경우
ConsignInvestPoolPeriodQuarter
write.csv(ConsignInvestPoolPeriodQuarter,"ConsignInvestPoolPeriodQuarter.csv")
#[77]연기금투자풀 수탁규모(ConsignInvestPoolSize)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ConsignInvestPoolSize"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_ConsignInvestPoolSize = paste0(baseurl,
                                            '?Key=',openfin_apikey,
                                            '&Type=',Type,
                                            '&pIndex=',pIndex,
                                            '&pSize=',pSize,
                                            '&FSCL_YY=',FSCL_YY
)
ConsignInvestPoolSize=xmleasyfun(url_ConsignInvestPoolSize) #함수를 이용한 경우
ConsignInvestPoolSize
write.csv(ConsignInvestPoolSize,"ConsignInvestPoolSize.csv")
#[78]연기금투자풀 수탁규모(ConsignInvestPoolPeriod)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ConsignInvestPoolPeriod"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_ConsignInvestPoolPeriod = paste0(baseurl,
                                   '?Key=',openfin_apikey,
                                   '&Type=',Type,
                                   '&pIndex=',pIndex,
                                   '&pSize=',pSize,
                                   '&FSCL_YY=',FSCL_YY
)
ConsignInvestPoolPeriod=xmleasyfun(url_ConsignInvestPoolPeriod) #함수를 이용한 경우
ConsignInvestPoolPeriod
write.csv(ConsignInvestPoolPeriod,"ConsignInvestPoolPeriod.csv")
#[79]재정상태표(VW_FOAC007)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC007"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC007 = paste0(baseurl,
                                     '?Key=',openfin_apikey,
                                     '&Type=',Type,
                                     '&pIndex=',pIndex,
                                     '&pSize=',pSize,
                                     '&FSCL_YY=',FSCL_YY
)
VW_FOAC007=xmleasyfun(url_VW_FOAC007) #함수를 이용한 경우
VW_FOAC007
write.csv(VW_FOAC007,"VW_FOAC007.csv")
#[80]재정운영표(VW_FOAC008)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC008"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC008 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC008=xmleasyfun(url_VW_FOAC008) #함수를 이용한 경우
VW_FOAC008
write.csv(VW_FOAC008,"VW_FOAC008.csv")
#[81]순자산변동표(VW_FOAC009)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC009"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC009 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC009=xmleasyfun(url_VW_FOAC009) #함수를 이용한 경우
VW_FOAC009
write.csv(VW_FOAC009,"VW_FOAC009.csv")
#[82]순자산변동표(VW_FOAC004)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC004"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC004 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC004=xmleasyfun(url_VW_FOAC004) #함수를 이용한 경우
VW_FOAC004
write.csv(VW_FOAC004,"VW_FOAC004.csv")
#[83]소관별 재정운영표(VW_FOAC005)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC005"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC005 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC005=xmleasyfun(url_VW_FOAC005) #함수를 이용한 경우
VW_FOAC005
write.csv(VW_FOAC005,"VW_FOAC005.csv")
#[84]소관별 순자산변동표(VW_FOAC006)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC006"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC006 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC006=xmleasyfun(url_VW_FOAC006) #함수를 이용한 경우
VW_FOAC006
write.csv(VW_FOAC006,"VW_FOAC006.csv")
#[85]회계·기금별 재정상태표(VW_FOAC001)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC001"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC001 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC001=xmleasyfun(url_VW_FOAC001) #함수를 이용한 경우
VW_FOAC001
write.csv(VW_FOAC001,"VW_FOAC001.csv")
#[86]회계·기금별 재정상태표(VW_FOAC002)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC002"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC002 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC002=xmleasyfun(url_VW_FOAC002) #함수를 이용한 경우
VW_FOAC002
write.csv(VW_FOAC002,"VW_FOAC002.csv")
#[87]회계·기금별 순자산변동표(VW_FOAC003)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOAC003"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_VW_FOAC003 = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
VW_FOAC003=xmleasyfun(url_VW_FOAC003) #함수를 이용한 경우
VW_FOAC003
write.csv(VW_FOAC003,"VW_FOAC003.csv")
#[88]재정증권 발행 및 상환내역(FinanSecuriIssuanAndRedemp)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/FinanSecuriIssuanAndRedemp"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
FSCL_YY=2020
url_FinanSecuriIssuanAndRedemp = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&FSCL_YY=',FSCL_YY
)
FinanSecuriIssuanAndRedemp=xmleasyfun(url_FinanSecuriIssuanAndRedemp) #함수를 이용한 경우
FinanSecuriIssuanAndRedemp
write.csv(FinanSecuriIssuanAndRedemp,"FinanSecuriIssuanAndRedemp.csv")
#[89]국가채권현황(ReceivedGovernment)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/ReceivedGovernment"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_ReceivedGovernment = paste0(baseurl,
                                        '?Key=',openfin_apikey,
                                        '&Type=',Type,
                                        '&pIndex=',pIndex,
                                        '&pSize=',pSize,
                                        '&OJ_YY=',OJ_YY
)
ReceivedGovernment=xmleasyfun(url_ReceivedGovernment) #함수를 이용한 경우
ReceivedGovernment
write.csv(ReceivedGovernment,"ReceivedGovernment.csv")
#[Cautious]국가채권추이 OPEN API는 지원되지 않습니다.-----------
#[90]회계·기금별 국가채권 현황(NRAccountingFund)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/NRAccountingFund"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_NRAccountingFund = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize,
                                '&OJ_YY=',OJ_YY
)
NRAccountingFund=xmleasyfun(url_NRAccountingFund) #함수를 이용한 경우
NRAccountingFund
write.csv(NRAccountingFund,"NRAccountingFund.csv")
#[91]채권현재액명세서(VW_FOCT002)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/VW_FOCT002"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_VW_FOCT002 = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize,
                                '&OJ_YY=',OJ_YY
)
VW_FOCT002=xmleasyfun(url_VW_FOCT002) #함수를 이용한 경우
VW_FOCT002
write.csv(VW_FOCT002,"VW_FOCT002.csv")
#[92]정부출자현황(GovernmentInvestment)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/GovernmentInvestment"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_GovernmentInvestment = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&OJ_YY=',OJ_YY
)
GovernmentInvestment=xmleasyfun(url_GovernmentInvestment) #함수를 이용한 경우
GovernmentInvestment
write.csv(GovernmentInvestment,"GovernmentInvestment.csv")
#[93]정부출자기관 정부배당 현황(GovernmentDividend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/GovernmentDividend"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_GovernmentDividend = paste0(baseurl,
                                  '?Key=',openfin_apikey,
                                  '&Type=',Type,
                                  '&pIndex=',pIndex,
                                  '&pSize=',pSize,
                                  '&OJ_YY=',OJ_YY
)
GovernmentDividend=xmleasyfun(url_GovernmentDividend) #함수를 이용한 경우
GovernmentDividend
write.csv(GovernmentDividend,"GovernmentDividend.csv")
#[94]국가채무(D1)(GovernmentDebtYear)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/GovernmentDebtYear"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_GovernmentDebtYear = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize,
                                '&OJ_YY=',OJ_YY
)
GovernmentDebtYear=xmleasyfun(url_GovernmentDebtYear) #함수를 이용한 경우
GovernmentDebtYear
write.csv(GovernmentDebtYear,"GovernmentDebtYear.csv")
#[95]일반정부 부채(D2)(OPFI197)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI197"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_OPFI197 = paste0(baseurl,
                                '?Key=',openfin_apikey,
                                '&Type=',Type,
                                '&pIndex=',pIndex,
                                '&pSize=',pSize,
                                '&OJ_YY=',OJ_YY
)
OPFI197=xmleasyfun(url_OPFI197) #함수를 이용한 경우
OPFI197
write.csv(OPFI197,"OPFI197.csv")
#[96]공공부문 부채(D3)(PublicDebtAndNationalDebt)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/PublicDebtAndNationalDebt"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_PublicDebtAndNationalDebt = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&OJ_YY=',OJ_YY
)
PublicDebtAndNationalDebt=xmleasyfun(url_PublicDebtAndNationalDebt) #함수를 이용한 경우
PublicDebtAndNationalDebt
write.csv(PublicDebtAndNationalDebt,"PublicDebtAndNationalDebt.csv")
#[98]보증채무 현황(SuretyLiabilityYear)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/SuretyLiabilityYear"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_SuretyLiabilityYear = paste0(baseurl,
                                       '?Key=',openfin_apikey,
                                       '&Type=',Type,
                                       '&pIndex=',pIndex,
                                       '&pSize=',pSize,
                                       '&OJ_YY=',OJ_YY
)
SuretyLiabilityYear=xmleasyfun(url_SuretyLiabilityYear) #함수를 이용한 경우
SuretyLiabilityYear
write.csv(SuretyLiabilityYear,"SuretyLiabilityYear.csv")
#[99]총수입(TotalIncome)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/TotalIncome"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_TotalIncome = paste0(baseurl,
                                 '?Key=',openfin_apikey,
                                 '&Type=',Type,
                                 '&pIndex=',pIndex,
                                 '&pSize=',pSize,
                                 '&OJ_YY=',OJ_YY
)
TotalIncome=xmleasyfun(url_TotalIncome) #함수를 이용한 경우
TotalIncome
write.csv(TotalIncome,"TotalIncome.csv")
#[100]국세수입(IncomeTax)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/IncomeTax"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_IncomeTax = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize,
                         '&OJ_YY=',OJ_YY
)
IncomeTax=xmleasyfun(url_IncomeTax) #함수를 이용한 경우
IncomeTax
write.csv(IncomeTax,"IncomeTax.csv")
#[101]국세수입(IncomeTaxNontaxIncome)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/NontaxIncome"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_IncomeTaxNontaxIncome = paste0(baseurl,
                       '?Key=',openfin_apikey,
                       '&Type=',Type,
                       '&pIndex=',pIndex,
                       '&pSize=',pSize,
                       '&OJ_YY=',OJ_YY
)
IncomeTaxNontaxIncome=xmleasyfun(url_IncomeTaxNontaxIncome) #함수를 이용한 경우
IncomeTaxNontaxIncome
write.csv(IncomeTaxNontaxIncome,"IncomeTaxNontaxIncome.csv")
#[102]기금수입(FundIncome)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/FundIncome"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_FundIncome = paste0(baseurl,
                                   '?Key=',openfin_apikey,
                                   '&Type=',Type,
                                   '&pIndex=',pIndex,
                                   '&pSize=',pSize,
                                   '&OJ_YY=',OJ_YY
)
FundIncome=xmleasyfun(url_FundIncome) #함수를 이용한 경우
FundIncome
write.csv(FundIncome,"FundIncome.csv")
#[103]총지출(GrossExpend)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/GrossExpend"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_GrossExpend = paste0(baseurl,
                        '?Key=',openfin_apikey,
                        '&Type=',Type,
                        '&pIndex=',pIndex,
                        '&pSize=',pSize,
                        '&OJ_YY=',OJ_YY
)
GrossExpend=xmleasyfun(url_GrossExpend) #함수를 이용한 경우
GrossExpend
write.csv(GrossExpend,"GrossExpend.csv")
#[104]총지출(GovernmentDebtMonth)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/GovernmentDebtMonth"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_GovernmentDebtMonth = paste0(baseurl,
                         '?Key=',openfin_apikey,
                         '&Type=',Type,
                         '&pIndex=',pIndex,
                         '&pSize=',pSize,
                         '&OJ_YY=',OJ_YY
)
GovernmentDebtMonth=xmleasyfun(url_GovernmentDebtMonth) #함수를 이용한 경우
GovernmentDebtMonth
write.csv(GovernmentDebtMonth,"GovernmentDebtMonth.csv")
#[105]월별 보증채무 현황(SuretyLiabilityMonth)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/SuretyLiabilityMonth"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_SuretyLiabilityMonth = paste0(baseurl,
                                 '?Key=',openfin_apikey,
                                 '&Type=',Type,
                                 '&pIndex=',pIndex,
                                 '&pSize=',pSize,
                                 '&OJ_YY=',OJ_YY
)
SuretyLiabilityMonth=xmleasyfun(url_SuretyLiabilityMonth) #함수를 이용한 경우
SuretyLiabilityMonth
write.csv(SuretyLiabilityMonth,"SuretyLiabilityMonth.csv")
#[106]재정수지(BudgetBalance)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/BudgetBalance"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
OJ_YY=2020
url_BudgetBalance = paste0(baseurl,
                                  '?Key=',openfin_apikey,
                                  '&Type=',Type,
                                  '&pIndex=',pIndex,
                                  '&pSize=',pSize,
                                  '&OJ_YY=',OJ_YY
)
BudgetBalance=xmleasyfun(url_BudgetBalance) #함수를 이용한 경우
BudgetBalance
write.csv(BudgetBalance,"BudgetBalance.csv")
#[107]통합재정수지(86GFS예산)(OPFI199)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI199"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI199 = paste0(baseurl,
                           '?Key=',openfin_apikey,
                           '&Type=',Type,
                           '&pIndex=',pIndex,
                           '&pSize=',pSize,
                           '&ACNT_YR=',ACNT_YR
)
OPFI199=xmleasyfun(url_OPFI199) #함수를 이용한 경우
OPFI199
write.csv(OPFI199,"OPFI199.csv")
#[108]수입의경제적분류(86GFS예산)(OPFI200)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI200"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI200 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI200=xmleasyfun(url_OPFI200) #함수를 이용한 경우
OPFI200
write.csv(OPFI200,"OPFI200.csv")
#[109]지출및순융자의경제적분류(86GFS예산)(OPFI201)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI201"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI201 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI201=xmleasyfun(url_OPFI201) #함수를 이용한 경우
OPFI201
write.csv(OPFI201,"OPFI201.csv")
#[110]순융자(86GFS예산)(OPFI202)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI202"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI202 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI202=xmleasyfun(url_OPFI202) #함수를 이용한 경우
OPFI202
write.csv(OPFI202,"OPFI202.csv")
#[111]보전재원(86GFS예산)(OPFI203)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI203"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI203 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI203=xmleasyfun(url_OPFI203) #함수를 이용한 경우
OPFI203
write.csv(OPFI203,"OPFI203.csv")
#[112]내부거래(86GFS예산)(OPFI204)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI204"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI204 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI204=xmleasyfun(url_OPFI204) #함수를 이용한 경우
OPFI204
write.csv(OPFI204,"OPFI204.csv")
#[113]통합재정수지(86GFS결산)(OPFI205)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI205"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI205 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI205=xmleasyfun(url_OPFI205) #함수를 이용한 경우
OPFI205
write.csv(OPFI205,"OPFI205.csv")
#[114]수입의경제적분류(86GFS결산)(OPFI206)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI206"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI206 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI206=xmleasyfun(url_OPFI206) #함수를 이용한 경우
OPFI206
write.csv(OPFI206,"OPFI206.csv")
#[115]지출및순융자의경제적분류(86GFS결산)(OPFI207)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI207"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI207 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI207=xmleasyfun(url_OPFI207) #함수를 이용한 경우
OPFI207
write.csv(OPFI207,"OPFI207.csv")
#[116]지출및순융자의기능적분류(86GFS결산)(OPFI208)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI208"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI208 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI208=xmleasyfun(url_OPFI208) #함수를 이용한 경우
OPFI208
write.csv(OPFI208,"OPFI208.csv")
#[117]순융자(86GFS결산)(OPFI209)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI209"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI209 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI209=xmleasyfun(url_OPFI209) #함수를 이용한 경우
OPFI209
write.csv(OPFI209,"OPFI209.csv")
#[118]보전재원(86GFS결산)(OPFI210)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI210"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI210 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI210=xmleasyfun(url_OPFI210) #함수를 이용한 경우
OPFI210
write.csv(OPFI210,"OPFI210.csv")
#[119]내부거래(86GFS결산)(OPFI211)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI211"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI211 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI211=xmleasyfun(url_OPFI211) #함수를 이용한 경우
OPFI211
write.csv(OPFI211,"OPFI211.csv")
#[120]내부거래(86GFS결산)(OPFI212)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI212"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI212 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI212=xmleasyfun(url_OPFI212) #함수를 이용한 경우
OPFI212
write.csv(OPFI212,"OPFI212.csv")
#[121]수익명세(01GFS)(OPFI213)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI213"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI213 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI213=xmleasyfun(url_OPFI213) #함수를 이용한 경우
OPFI213
write.csv(OPFI213,"OPFI213.csv")
#[122]비용명세(01GFS)(OPFI214)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI214"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI214 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI214=xmleasyfun(url_OPFI214) #함수를 이용한 경우
OPFI214
write.csv(OPFI214,"OPFI214.csv")
#[123]거래명세(01GFS)(OPFI215)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI215"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI215 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI215=xmleasyfun(url_OPFI215) #함수를 이용한 경우
OPFI215
write.csv(OPFI215,"OPFI215.csv")
#[124]거래외명세(01GFS)(OPFI216)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI216"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI216 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI216=xmleasyfun(url_OPFI216) #함수를 이용한 경우
OPFI216
write.csv(OPFI216,"OPFI216.csv")
#[125]재정상태표(01GFS)(OPFI217)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI217"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI217 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI217=xmleasyfun(url_OPFI217) #함수를 이용한 경우
OPFI217
write.csv(OPFI217,"OPFI217.csv")
#[126]국가채무총괄표 (정부부문)(OPFI218)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFI218"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFI218 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFI218=xmleasyfun(url_OPFI218) #함수를 이용한 경우
OPFI218
write.csv(OPFI218,"OPFI218.csv")
#[Cautious]예산개요 OPEN API는 지원되지 않습니다.-----------
#[Cautious]결산개요 OPEN API는 지원되지 않습니다.-----------
#[127]중기 재정수입 전망(OPFB130)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFB130"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFB130 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFB130=xmleasyfun(url_OPFB130) #함수를 이용한 경우
OPFB130
write.csv(OPFB130,"OPFB130.csv")
#[128]조세부담률 및 국민부담률(OPFB133)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFB133"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFB133 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFB133=xmleasyfun(url_OPFB133) #함수를 이용한 경우
OPFB133
write.csv(OPFB133,"OPFB133.csv")
#[129]중기 재정수지 전망(OPFB141)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFB141"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFB141 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFB141=xmleasyfun(url_OPFB141) #함수를 이용한 경우
OPFB141
write.csv(OPFB141,"OPFB141.csv")
#[130]중기 재정지출 계획(OPFB140)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFB140"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFB140 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFB140=xmleasyfun(url_OPFB140) #함수를 이용한 경우
OPFB140
write.csv(OPFB140,"OPFB140.csv")
#[131]분야별 재원배분 계획(OPFB129)----------------------------
#parameter setting
baseurl="https://openapi.openfiscaldata.go.kr/OPFB129"
Type='xml' 
pIndex=1 #페이지 위치-기본값 : 1(sample key는 1고정)
pSize=100 #페이지 당 요청 숫자- 기본값 : 100 (sample key는 5 고정)
ACNT_YR=2020
url_OPFB129 = paste0(baseurl,
                     '?Key=',openfin_apikey,
                     '&Type=',Type,
                     '&pIndex=',pIndex,
                     '&pSize=',pSize,
                     '&ACNT_YR=',ACNT_YR
)
OPFB129=xmleasyfun(url_OPFB129) #함수를 이용한 경우
OPFB129
write.csv(OPFB129,"OPFB129.csv")
#[Cautious]지방예산 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지방결산 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지방재정건전성 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지방재정여건 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지방교육재정예산 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지방교육재정결산 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지방교육재정건전성 OPEN API는 지원되지 않습니다.-----------
#[Cautious]지방교육재정여건 OPEN API는 지원되지 않습니다.-----------
#[Cautious]국가통계연보 OPEN API는 지원되지 않습니다.-----------
#FUNCTION LIST---------------------------------------------------
xmleasyfun=function(url){
  temp=read_xml(url)
  temp0=xmlParse(temp)
  df=xmlToDataFrame(getNodeSet(temp0, "//row"))
}
finstatfun=function(url){
  urlinfo=GET(url)
  urlinfo_json=content(urlinfo, as='text')
  urlinfo_json
  urlinfo=fromJSON(txt = urlinfo_json %>% 
                     as.character())
  urlinfo_df=urlinfo$result$list
  urlinfo_df
}
finstatfundt=function(url){
  urlinfo=GET(url)
  urlinfo_json=content(urlinfo, as='text')
  urlinfo_json
  urlinfo=fromJSON(txt = urlinfo_json %>% 
                     as.character())
  urlinfo_df=urlinfo$result$list
  urlinfo_df
  DT::datatable(urlinfo_df)
}

 

 

반응형

댓글