도서 상세

OAK_PORTAL

  • URL

    http://api.kcisa.kr/openapi/service/rest/meta14/getNLKF021801

  • 설명

    국립중앙도서관의 OAK(OpenAccessKorea)PORTAL를 외부 개발자 및 사용자가 이를 활용 할 수 있도록 전달하는 API 서비스입니다. 국립중앙도서관의 OAK(OpenAccessKorea)PORTAL에서 제공하는 전문 학술정보의 목록정보와 상세정보 등 다양한 정보를 제공합니다.

  • 기관명

    국립중앙도서관

    갱신주기

    연간

  • 서비스 분야/주체

    API유형

    REST

  • 등록일

    May 24, 2018

    활용도

    574

오픈 API

요청인자

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

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

false
pageNo string
페이지수

false

출력 값

출력 값 상세표
No 변수명 출력설명
1 title 자원의 명칭
2 creator 주된 책임을 진 개체
3 issuedDate 발행일
4 collectionDb 소속(통제)DB
5 subjectCategory 기관별주제분류체계
6 subDescription 보조 서술
7 description 내용 (기존 = description(내용) + ' ' + abstract(자원의 대한 요약))
8 rights 자원에 대한 권리
9 medium 자원의물리적(물질적)상태
10 sourceTitle 참조자원제목 (기존 = reference(참조한자원) + ' ' + source(유래자원에 대한 참조))
11 url 지식정보자원위치정보
12 affiliation 소속

메시지 설명

메시지 설명 상세표
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/meta14/getNLKF021801"); /*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/meta14/getNLKF021801'; /*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("creator" + $(this).find("creator").text());
console.log("issuedDate" + $(this).find("issuedDate").text());
console.log("collectionDb" + $(this).find("collectionDb").text());
console.log("subjectCategory" + $(this).find("subjectCategory").text());
console.log("subDescription" + $(this).find("subDescription").text());
console.log("description" + $(this).find("description").text());
console.log("rights" + $(this).find("rights").text());
console.log("medium" + $(this).find("medium").text());
console.log("sourceTitle" + $(this).find("sourceTitle").text());
console.log("url" + $(this).find("url").text());
console.log("affiliation" + $(this).find("affiliation").text());

});

};

}
xhr.send('');