맞춤형 API 상세

어린이를 위한 공연정보

  • URL

    http://api.kcisa.kr/openapi/service/rest/convergence2018/conver1

  • 설명

    어린이를 위한 공연을 포함한 전시, 행사정보를 제공하고 소개 정보를 비롯하여 요금, 시간, 공연장정보 등을 제공하는 서비스
    어린이를 위한 공연정보

  • 기관명

    한국문화정보원

    갱신주기

    상시

  • 서비스 분야/주체

    API유형

    REST+

  • 등록일

    Dec 28, 2018

    활용도

    3,935

오픈 API

요청인자

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

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

false
pageNo string
페이지수

false
keyword string
검색어

false

출력 값

출력 값 상세표
No 변수명 출력설명
1 address 지번 주소
2 address2 도로명 주소
3 category 행사 구분
4 charge 요금정보
5 contact 전화번호
6 description 예매 정보
7 grade 입장 연령
8 homepage 홈페이지 주소
9 lat 위도
10 lon 경도
11 parkingyn 주차장 보유여부
12 performName 행사명
13 period 행사기간
14 rights 저작자
15 state 할인정보
16 supervisor 행사장소
17 time 행사시간
18 totalCapacity 객석 수
19 remark 유의사항
20 rnum 번호

메시지 설명

메시지 설명 상세표
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/convergence2018/conver1"); /*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")); /*페이지수*/
urlBuilder.append("&" + URLEncoder.encode("keyword","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/convergence2018/conver1'; /*URL*/
var queryParams = '?' + encodeURIComponent('serviceKey') + '=' + '서비스키'; /*서비스키*/
queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('세션당 요청레코드수'); /*세션당 요청레코드수*/
queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('페이지수'); /*페이지수*/
queryParams += '&' + encodeURIComponent('keyword') + '=' + 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("address" + $(this).find("address").text());
console.log("address2" + $(this).find("address2").text());
console.log("category" + $(this).find("category").text());
console.log("charge" + $(this).find("charge").text());
console.log("contact" + $(this).find("contact").text());
console.log("description" + $(this).find("description").text());
console.log("grade" + $(this).find("grade").text());
console.log("homepage" + $(this).find("homepage").text());
console.log("lat" + $(this).find("lat").text());
console.log("lon" + $(this).find("lon").text());
console.log("parkingyn" + $(this).find("parkingyn").text());
console.log("performName" + $(this).find("performName").text());
console.log("period" + $(this).find("period").text());
console.log("rights" + $(this).find("rights").text());
console.log("state" + $(this).find("state").text());
console.log("supervisor" + $(this).find("supervisor").text());
console.log("time" + $(this).find("time").text());
console.log("totalCapacity" + $(this).find("totalCapacity").text());
console.log("remark" + $(this).find("remark").text());
console.log("rnum" + $(this).find("rnum").text());

});

};

}
xhr.send('');