NAV
shell python

Introduction

data.popong.com의 데이터는 다음의 서비스들에 사용되었습니다:

현재 국회 홈페이지는 매일 새로 발의되는 의안 데이터를 수집하기 힘든 구조로 되어 있습니다. 한 번에 처리되는 의안의 양도 많아서 사람이 일일이 다운로드 받고 분석하기에 번거롭습니다. 또한, 의원 및 후보자 데이터에는 고유 식별자(ID)가 부여되어 있지 않아 동명이인 등을 처리하는데 어려움이 많습니다. 따라서 정치 데이터를 이용하여 연구 및 개발을 하려는 경우, 실제로 연구개발에 투입되는 시간 만큼, 혹은 그 이상으로 데이터를 준비하는데 많은 시간과 비용이 들고 있습니다.

그래서 저희는, 매일 선관위와 국회 등 국가 공식 홈페이지에 업데이트 되는 정보를 수집하는 자동화 툴을 만들었습니다. 수집한 데이터는 객체마다 고유 ID를 부여하고 객체 간 유기적으로 연결하는 등 연구자 및 개발자의 편의를 위한 전처리 과정을 거친 후 데이터베이스에 저장하였습니다. 데이터는 아래의 두 가지 형태로 제공됩니다.

저희는 이 데이터가 더 많은 시민들의 손에서 다루어질 때 가장 유용하게 쓰일 수 있고 빛이 날 것이라고 생각합니다. 입법 데이터는 본디 시민의 것이기 때문입니다. 이에, 연구 및 개발을 위한 데이터를 배포하니 많이 이용해주시기 바랍니다.

Authentication

Open API를 사용하기 위해서는 API key가 필요합니다.

지금은 별도의 API key의 발급 절차가 없으며, api_key의 값으로 test를 사용하시면 됩니다. API key는 차후 등록하도록 요청될 수 있습니다.

Batch data

다음의 데이터는 한번에 편리하게 다운 받을 수 있습니다.

Open API (v0.1)

Bill

Get all bills

curl "http://api.popong.com/v0.1/bill/?api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/bill/?api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/bill/

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

The above command returns JSON structured like this:

{
    "items": [
        {
            "status": "폐기",
            "is_processed": true,
            "status_id": 8,
            "link_id": "PRC_P1K2Z0L6A2U6V1P6N0C0R3L3E3N5T6",
            "status_ids": [ 1, 2, 8 ],
            "sponsor": "이명수의원 등 10인",
            "decision_date": "2013-02-18",
            "id": "1900326",
            "proposed_date": "2012-06-26",
            "name": "고용정책 기본법 일부개정법률안",
            "assembly_id": 19,
            "summary": "제안이유 및 주요내용 현행법 제7조제1항에서 ... 보장하고자 함(안 제41조제1항 신설).",
            "document_url": "http://likms.assembly.go.kr/filegate/servlet/FileGate?bookId=787430CC-1342-113A-8AE6-9F243D90C0B3&type=1"
        },
        ...
    ],
    "kind": "popong#bills",
    "next_page": 2
}
Key Description
status Current status of the bill.
is_processed Whether the bill is processed (처리) or not processed (계류).
status_id Current status ID of the bill. The list of status IDs can be found here.
link_id The unique ID of the bill used in the National Assembly website. For example: http://likms.assembly.go.kr/bill/jsp/BillDetail.jsp?bill_id=<link_id>
status_ids The list of statuses the bill goes through. The list of status IDs can be found here.
sponsor The sponsor and the total number of cosponsors.
decision_date The final decision of the bill. Value should be null if the bill is still processing.
id Bill’s unique ID, provided by the national assembly. You can also see the bill’s info at: http://pokr.kr/bill/<id>.
proposed_date The proposed date of the bill.
name Title of the bill.
assembly_id The assembly the bill was proposed.
summary The summary of the bill. Can be null.
document_url URL of the bill’s proposal PDF. Can be null.

Search bills

curl "http://api.popong.com/v0.1/bill/search?q=데이터&s=김영환&api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/bill/search?q=데이터&s=김영환&api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/bill/search

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
q string false LIKE search for value in the name field.
s string false LIKE search for value in the sponsor field.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

Same structure as above.

Get a specific bill

curl "http://api.popong.com/v0.1/bill/152445?api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/bill/152445?api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/bill/<id>

URL Parameters

Parameter Type Required Description
id string true The unique ID of the bill to retrieve.

Query Parameters

Parameter Type Required Description
api_key string true Your API key.

Return Values

Same structure as above.

Person

Get all people

curl "http://api.popong.com/v0.1/person/?api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/person/?api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/person/

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

The above command returns JSON structured like this:

{
    "items": [
        {
            "wiki": "/wiki/%EB%B0%95%EC%98%81%EC%84%A0_(1960%EB%85%84)",
            "address_id": ["11", "11170", null],
            "name": "박영선",
            "twitter": "Park_Youngsun",
            "gender": "f",
            "image": "http://www.assembly.go.kr/photo/9770347.jpg",
            "name_cn": "朴映宣",
            "blog": "http://blog.naver.com/dolphin6010",
            "birthday": "1960-01-22",
            "facebook": "parkys21",
            "address": "서울 구로구 신도림로19길",
            "name_en": "PARK Young-sun",
            "education": "서강대학교 언론대학원 졸업(문학석사)",
            "homepage": "http://www.pys21.net",
            "id": 1960211,
            "education_id": ["7001818", null, null, null, null]
        },
        ...
    ],
    "kind": "popong#people",
    "next_page": 2
}
Key Description
wiki URL path for person in the Korean Wikipedia. For example: http://ko.wikipedia.org/wiki/%EC%86%90%ED%95%99%EA%B7%9C.
address_id Administrative address IDs of the person in three levels: provinces (시도), municipalities (시군구), submunicipalities (읍면동). null if value is unknown. Address IDs can be seen here.
name Name of the person in Hangul.
twitter Twitter handle of the person. For example: http://twitter.com/<twitter>.
gender Gender of the person. Either “m” (male) or “f” (female).
image URL for an image of the person. Mostly from www.assembly.go.kr or data.popong.com.
name_cn Name of the person in Chinese characters.
blog URL for the person’s blog.
birthday Birthday of the person in the format: “%Y-%m-%d”.
facebook Facebook handle of the person. For example: http://facebook.com/<facebook>.
address Address of the person.
name_en Name of the person in Alphabets.
education Person’s last attended educational institute.
homepage URL of the person’s homepage.
id Person’s unique ID, provided by Team POPONG. Consisted of the birth year of the person and a random number. You can also see the person’s info at: http://pokr.kr/person/<id>.
education_id The ID list of the educational institutes the person attended. The list of educational institute IDs can be found here

Search people

curl "http://api.popong.com/v0.1/person/search?q=박&api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/person/search?q=박&api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/person/search

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
q string false LIKE search for value in the name field.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

Same structure as above.

Get a specific person

curl "http://api.popong.com/v0.1/person/19521114&api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/person/19521114&api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/person/<id>

URL Parameters

Parameter Type Required Description
id string true The unique ID of the person to retrieve.

Query Parameters

Parameter Type Required Description
api_key string true Your API key.

Return Values

Same structure as above.

Party

Get all parties

curl "http://api.popong.com/v0.1/party/?api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/party/?api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/party/

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

The above command returns JSON structured like this:

{
    "items": [
        {
            "color": null,
            "logo": "http://data.popong.com/parties/images/83.png",
            "size": 163,
            "id": 83,
            "name": "자유선진당"
        },
        ...
    ],
    "kind": "popong#parties",
    "next_page": 2
}
Key Description
color HEX value for the party color.
logo URL for the party’s logo.
size Number of members in the party.
id Unique ID of the party, provided by Team POPONG. The list of party IDs can be seen here.
name Name of the party.

Search parties

curl "http://api.popong.com/v0.1/party/search?q=통합&api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/party/search?q=통합&api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/party/search

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
q string false LIKE search for value in the name field.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

Same structure as above.

Get a specific party

curl "http://api.popong.com/v0.1/party/<id>?api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/party/<id>?api_key=test")

HTTP Request

GET http://api.popong.com/v0.1/party/<id>

URL Parameters

Parameter Type Required Description
id string true The unique ID of the person to retrieve.

Query Parameters

Parameter Type Required Description
api_key string true Your API key.

Return Values

Same structure as above.

Open API (v0.2) - Unstable

Main changes in this version are as follows:

Bill

Get all bills

curl "http://api.popong.com/v0.2/bill/?api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/bill/?api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/bill/

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

The above command returns JSON structured like this:

{
    "items": [
        {
            "sponsor": "김용태의원등 4인 외 281인",
            "document_url": null,
            "proposed_date": "1992-10-08",
            "name": "국무총리및국무위원출석요구의건(경제에관한질문II)",
            "assembly_id": 14,
            "decision_date": "1992-10-08",
            "cosponsors": [
                { "id": 1936134, "name": "김용태" },
                { "id": 1940116, "name": "김정남" },
                { "id": 1948129, "name": "이철" },
                ...
            ],
            "status": "정부이송",
            "id": "140077",
            "summary": null
        },
        ...
    ],
    "kind": "popong#bills",
    "next_page": 2
}
Key Description
sponsor The sponsor and the total number of cosponsors.
document_url URL of the bill’s proposal PDF. Can be null.
proposed_date The proposed date of the bill.
name Title of the bill.
assembly_id The assembly the bill was proposed.
decision_date The final decision of the bill. Value should be null if the bill is still processing.
cosponsors The list of cosponsors of the bill, with person ID and person name.
status Current status of the bill.
id Bill’s unique ID, provided by the national assembly. You can also see the bill’s info at: http://pokr.kr/bill/<id>.
summary The summary of the bill. Can be null.

Search bills

curl "http://api.popong.com/v0.2/bill/search?q=데이터&s=김영환&api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/bill/search?q=데이터&s=김영환&api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/bill/search

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
q string false LIKE search for value in the name field.
s string false LIKE search for value in the sponsor field.
assembly_id string false Filter with the assembly_id field.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

Same structure as above.

Get a specific bill

curl "http://api.popong.com/v0.2/bill/152445?api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/bill/152445?api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/bill/<id>

URL Parameters

Parameter Type Required Description
id string true The unique ID of the bill to retrieve.

Query Parameters

Parameter Type Required Description
api_key string true Your API key.

Return Values

Same structure as above.

Person

Get all people

curl "http://api.popong.com/v0.2/person/?api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/person/?api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/person/

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

The above command returns JSON structured like this:

{
    "items": [
        {
            "wiki": "/wiki/%EB%B0%95%EC%98%81%EC%84%A0_(1960%EB%85%84)",
            "image": "http://www.assembly.go.kr/photo/9770347.jpg",
            "birthday": "1960-01-22",
            "facebook": "parkys21",
            "address": "서울 구로구 신도림로19길",
            "name_en": "PARK Young-sun",
            "education": "서강대학교 언론대학원 졸업(문학석사)",
            "id": 1960211,
            "name": "박영선",
            "gender": "f",
            "name_cn": "朴映宣",
            "homepage": "http://www.pys21.net",
            "twitter": "Park_Youngsun",
        },
        ...
    ],
    "kind": "popong#people",
    "next_page": 2
}
Key Description
wiki URL path for person in the Korean Wikipedia. For example: http://ko.wikipedia.org/wiki/%EC%86%90%ED%95%99%EA%B7%9C.
image URL for an image of the person. Mostly from www.assembly.go.kr or data.popong.com.
birthday Birthday of the person in the format: “%Y-%m-%d”.
facebook Facebook handle of the person. For example: http://facebook.com/<facebook>.
address Address of the person.
name_en Name of the person in Alphabets.
education Person’s last attended educational institute.
id Person’s unique ID, provided by Team POPONG. Consisted of the birth year of the person and a random number. You can also see the person’s info at: http://pokr.kr/person/<id>.
name Name of the person in Hangul.
gender Gender of the person. Either “m” (male) or “f” (female).
name_cn Name of the person in Chinese characters.
homepage URL of the person’s homepage.
twitter Twitter handle of the person. For example: http://twitter.com/<twitter>.

Search people

curl "http://api.popong.com/v0.2/person/search?q=박&api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/person/search?q=박&api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/person/search

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
q string false LIKE search for value in the name field.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

Same structure as above.

Get a specific person

curl "http://api.popong.com/v0.1/person/19521114&api_key=test"
import requests
requests.get("http://api.popong.com/v0.1/person/19521114&api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/person/<id>

URL Parameters

Parameter Type Required Description
id string true The unique ID of the person to retrieve.

Query Parameters

Parameter Type Required Description
api_key string true Your API key.

Return Values

Same structure as above.

Party

Get all parties

curl "http://api.popong.com/v0.2/party/?api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/party/?api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/party/

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

The above command returns JSON structured like this:

{
    "items": [
        {
            "color": null,
            "logo": "http://data.popong.com/parties/images/83.png",
            "id": 83,
            "name": "자유선진당"
        },
        ...
    ],
    "kind": "popong#parties",
    "next_page": 2
}
Key Description
color HEX value for the party color.
logo URL for the party’s logo.
id Unique ID of the party, provided by Team POPONG. The list of party IDs can be seen here.
name Name of the party.

Search parties

curl "http://api.popong.com/v0.2/party/search?q=통합&api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/party/search?q=통합&api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/party/search

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
q string false LIKE search for value in the name field.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

Same structure as above.

Get a specific party

curl "http://api.popong.com/v0.2/party/<id>?api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/party/<id>?api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/party/<id>

URL Parameters

Parameter Type Required Description
id string true The unique ID of the person to retrieve.

Query Parameters

Parameter Type Required Description
api_key string true Your API key.

Return Values

Same structure as above.

Statement

Get all statements

curl "http://api.popong.com/v0.2/statement/?api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/statement/?api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/statement/

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

The above command returns JSON structured like this:

{
    "items": [
        {
            "content": "전면전 도발할 능력이 없다 하는 데 대해서는 우리 후보자님께서 아까는 전부 다 국민들에게 생중계됐단 말이에요. 그래서 그 부분에 대해서 명쾌하게, 한 15초 내에 명쾌하게 다시 한번 얘기하십시오.",
            "date": "2013-03-08",
            "speaker": "백군기 위원",
            "url": "http://pokr.kr/meeting/19314151672/dialog#1253599",
            "meeting_id": 19314151672,
            "person_id": 19501102,
            "sequence": 700,
            "id": 1253599
        },
        ...
    ],
    "kind": "popong#statements",
    "next_page": 2
}
Key Description
content Content of the statement.
date Date when the statement occurred.
speaker Speaker of the statement.
url URL of the statement in http://pokr.kr.
meeting_id Unique ID of the meeting of which the statement occurred, provided by Team POPONG. The ID is consisted of the Assembly ID (대) + Session ID (회) + Sitting ID (차) + an MD5 of the committee name. (The exact code can be seen here.)
person_id Person ID of the speaker, provided by Team POPONG. You can also see the person’s info at: http://pokr.kr/person/<id>.
sequence The sequence number among statements in the corresponding meeting.
id Unique ID of the statement.

Search statements

curl "http://api.popong.com/v0.2/statement/search?q=육아&api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/statement/search?q=육아&api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/statement/search

Query Parameters

Parameter Type Required Description
api_key string true Your API key.
q string false LIKE search for value in the name field.
sort string false Column name to sort by.
order string false Sorting order. Can be set to either “asc” (ascending) or “desc” (descending). (default: desc)
page int false Page number for request. (default: 1)
per_page int false Number of items to be returned per request. (default: 20)

Return Values

Same structure as above.

Get a specific statement

curl "http://api.popong.com/v0.2/statement/<id>?api_key=test"
import requests
requests.get("http://api.popong.com/v0.2/statement/<id>?api_key=test")

HTTP Request

GET http://api.popong.com/v0.2/statement/<id>

URL Parameters

Parameter Type Required Description
id string true The unique ID of the statement to retrieve.

Query Parameters

Parameter Type Required Description
api_key string true Your API key.

Return Values

Same structure as above.