본문 바로가기

Data Science/Data Collection

[04. 금융감독원 API] 012. 사업보고서 주요정보 – 이사ㆍ감사의 개인별 보수현황

728x90

이사ㆍ감사의 개인별 보수현황 API 코드를 작성해보자.

 

[그림 4.12] 이사ㆍ감사의 개인별 보수현황 개발가이드

 

import json
import pandas as pd
import requests

def get_director_audit_individual_remuneration(api_key, code, year, report_code):
    fullUrl = 'https://opendart.fss.or.kr/api/hmvAuditIndvdlBySttus.json?crtfc_key=%s&corp_code=%s&' \
              'bsns_year=%s&reprt_code=%s' % (api_key, code, year, report_code)

    response = requests.get(fullUrl, headers={'User-Agent': 'Mozilla/5.0'})
    result = response.text
    result = json.loads(result)

    if result['status'] == '000':
        data = pd.DataFrame(result['list'])

        return data

if __name__ == '__main__':
    api_key ='*'
    code = '00126380'
    year = '2018'
    report_code = '11011'

    director_audit_individual_remuneration = get_director_audit_individual_remuneration(api_key, code, year, report_code)
    print(director_audit_individual_remuneration)


결과 값
       rcept_no   corp_cls  ...  mendng_totamt mendng_totamt_ct_incls_mendng
0  20190401004781        Y  ...  2,584,000,000                             -
1  20190401004781        Y  ...  3,070,000,000                             -
2  20190401004781        Y  ...  3,342,000,000                             -
3  20190401004781        Y  ...  4,082,000,000                             -
4  20190401004781        Y  ...  4,140,000,000                             -
5  20190401004781        Y  ...  4,536,000,000                             -
6  20190401004781        Y  ...  7,034,000,000                             -
728x90