문화산업 상세

KOBIS_영화목록

  • URL

    http://api.kcisa.kr/openapi/service/rest/meta16/getkobis04

  • 설명

    영화진흥위원회의 영화관입장권 통합전산망(KOBIS)에서 제공하는 영화 정보를 외부 개발자 및 사용자가 이를 활용 할 수 있도록 전달하는 API 서비스입니다. 제목, 부제목, 장르, 제작지역 등 다양한 영화정보를 제공합니다.

  • 기관명

    영화진흥위원회

    갱신주기

    연간

  • 서비스 분야/주체

    API유형

    REST

  • 등록일

    2020-05-10

    활용도

    1,029

오픈 API

요청인자

요청인자 상세표
변수명 타입 변수설명 필수여부
serviceKey string
서비스키

true
numOfRows string
세션당 요청레코드수

false
pageNo string
페이지수

false

출력 값

출력 값 상세표
No 변수명 출력설명
1 title 자원의 명칭
2 alternativeTitle 대체 (기존 = alternativeTitle(대체) + ' ' + subTitle(부제))
3 creator 주된 책임을 진 개체
4 createdDate 제작일
5 collectionDb 소속(통제)DB
6 issuedDate 발행일
7 subjectCategory 기관별주제분류체계
8 description 내용 (기존 = description(내용) + ' ' + abstract(자원의 대한 요약))
9 spatialCoverage 관련장소 (기존 = spatial(공간) + ' ' + venue(장소))
10 medium 자원의물리적(물질적)상태
11 language 언어
12 rights 자원에 대한 권리
13 url 지식정보자원위치정보
14 state 상태
15 affiliation 소속
16 subDescription 보조 서술

메시지 설명

메시지 설명 상세표
0000 정상 처리
F2013 서비스 주소 호출 실패
9999 서비스 점검중(내부 서비스 호출 장애)

활용 명세

샘플 데이터

>샘플 데이터 상세

샘플코드

/* Java Sample */
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.io.BufferedReader;
import java.io.IOException;

public class openApi {
public static void main(String[] args) throws IOException {

StringBuilder urlBuilder = new StringBuilder("http://api.kcisa.kr/openapi/service/rest/meta16/getkobis04"); /*URL*/
urlBuilder.append("?" + URLEncoder.encode("serviceKey","UTF-8") + "=서비스키"); /*서비스키*/
urlBuilder.append("&" + URLEncoder.encode("numOfRows","UTF-8") + "=" + URLEncoder.encode("세션당 요청레코드수", "UTF-8")); /*세션당 요청레코드수*/
urlBuilder.append("&" + URLEncoder.encode("pageNo","UTF-8") + "=" + URLEncoder.encode("페이지수", "UTF-8")); /*페이지수*/

URL url = new URL(urlBuilder.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

conn.setRequestMethod("GET");
conn.setRequestProperty("Content-type", "application/json");
System.out.println("Response code: " + conn.getResponseCode());

BufferedReader rd;
if(conn.getResponseCode() >= 200 && conn.getResponseCode() <= 300) {

rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));

} else {

rd = new BufferedReader(new InputStreamReader(conn.getErrorStream()));

}

StringBuilder sb = new StringBuilder();
String line;
while ((line = rd.readLine()) != null) {

sb.append(line);

}
rd.close();
conn.disconnect();
System.out.println(sb.toString());

}

}
/* Javascript Sample*/
var xhr = new XMLHttpRequest();
var url = 'http://api.kcisa.kr/openapi/service/rest/meta16/getkobis04'; /*URL*/
var queryParams = '?' + encodeURIComponent('serviceKey') + '=' + '서비스키'; /*서비스키*/
queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('세션당 요청레코드수'); /*세션당 요청레코드수*/
queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('페이지수'); /*페이지수*/

xhr.open('GET', url + queryParams);
xhr.onreadystatechange = function () {
if (this.readyState == 4) {

console.log('status: ' + this.status);
console.log('resultCode: ' + $(this.responseText).find('resultCode').text());
console.log('resultMsg: ' + $(this.responseText).find('resultMsg').text());

var item = $(this.responseText).find('item');
$(item).each(function(){

console.log("title" + $(this).find("title").text());
console.log("alternativeTitle" + $(this).find("alternativeTitle").text());
console.log("creator" + $(this).find("creator").text());
console.log("createdDate" + $(this).find("createdDate").text());
console.log("collectionDb" + $(this).find("collectionDb").text());
console.log("issuedDate" + $(this).find("issuedDate").text());
console.log("subjectCategory" + $(this).find("subjectCategory").text());
console.log("description" + $(this).find("description").text());
console.log("spatialCoverage" + $(this).find("spatialCoverage").text());
console.log("medium" + $(this).find("medium").text());
console.log("language" + $(this).find("language").text());
console.log("rights" + $(this).find("rights").text());
console.log("url" + $(this).find("url").text());
console.log("state" + $(this).find("state").text());
console.log("affiliation" + $(this).find("affiliation").text());
console.log("subDescription" + $(this).find("subDescription").text());

});

};

}
xhr.send('');