문화유산 상세

국립지방박물관 문화행사 통합정보

  • URL

    http://api.kcisa.kr/openapi/service/CNV/API_CNV_043/request

  • 설명

    국립중앙박물관과 전국 13개 소속 국립지방박물관의 교육 및 문화행사 소식 정보를 통합 제공합니다.

  • 기관명

    국립중앙박물관

    갱신주기

    상시

  • 서비스 분야/주체

    API유형

    REST

  • 등록일

    Jan 7, 2022

    활용도

    2,486

  • 데이터갱신일

    2022-01-07

오픈 API

요청인자

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

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

false
pageNo string
페이지수

false

출력 값

출력 값 상세표
No 변수명 출력설명
1 publisher 연계기관ID
2 collectionDb 자원명
3 creater 연계기관명
4 title 제목
5 sourceAgency 원천기관코드
6 collectedDate 수집일
7 description 설명
8 localId 원천기관자료식별자
9 url URL
10 subDescription 부가설명
11 viewCount 조회수
12 imageObject 이미지
13 videoObject 동영상
14 spatialCoverage 관련장소
15 charge 유료/무료
16 contactPoint 문의안내
17 period 기간
18 sizing 규격

메시지 설명

메시지 설명 상세표
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/CNV/API_CNV_043/request"); /*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/CNV/API_CNV_043/request'; /*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("publisher" + $(this).find("publisher").text());
console.log("collectionDb" + $(this).find("collectionDb").text());
console.log("creater" + $(this).find("creater").text());
console.log("title" + $(this).find("title").text());
console.log("sourceAgency" + $(this).find("sourceAgency").text());
console.log("collectedDate" + $(this).find("collectedDate").text());
console.log("description" + $(this).find("description").text());
console.log("localId" + $(this).find("localId").text());
console.log("url" + $(this).find("url").text());
console.log("subDescription" + $(this).find("subDescription").text());
console.log("viewCount" + $(this).find("viewCount").text());
console.log("imageObject" + $(this).find("imageObject").text());
console.log("videoObject" + $(this).find("videoObject").text());
console.log("spatialCoverage" + $(this).find("spatialCoverage").text());
console.log("charge" + $(this).find("charge").text());
console.log("contactPoint" + $(this).find("contactPoint").text());
console.log("period" + $(this).find("period").text());
console.log("sizing" + $(this).find("sizing").text());

});

};

}
xhr.send('');