동영상 검색 API
동영상 검색 API는 모든 동영상 서비스에 대한 검색 결과를 외부 개발자 및 사용자에게 RSS,JSON,XML 형식으로 전달하는 API 서비스입니다. 동영상의 유용한 정보를 자신의 블로그나 자사 웹 서비스에 제공할 수 있게 해 줍니다.
요청 주소(Request URL) #
- http://apis.daum.net/search/vclip
요청 변수 (Request Parameters) #
- 공통 인증 변수: 모든 API 서비스 요청시 공통적으로 넣어야 할 변수는 아래와 같습니다.
인증 파라미터 #
- 인증에 사용되는 공통 파라미터를 설명합니다.
| 요청 변수 | 값 | 설명 |
| apikey | 40 byte hexadecimal string (필수) | 모든 오픈 API 호출에 공통으로 사용되는 인증키 입니다. Daum 회원이면, apikey를 발급 받을 수 있습니다. 오픈 API는 검색, UCC, 디앤샵 API로 구분됩니다. 나중에 다른 API가 추가될 수 도 있습니다. 각 API별로 Daum 회원은 하나의 apikey 만을 발급받을 수 있습니다. 그리고, 이 apikey로는 허가된 API만 호출 할 수 있습니다. 예) apikey=4125603e35da5d8820b07dc7b19050dbc838336b |
| apid | 20 byte hexadecimal string | 오픈 API를 이용하여 어플리케이션 이나 웹 사이트를 작성한 개발자 분들은 프로그램 등록을 할 수 있습니다. apid 는 등록된 프로그램에 대해서 오픈 API 인증 시스템에서 제공한 프로그램 아이디 입니다. 일부 오픈 API는 apid 파라미터를 필수로 요구하는 경우가 있습니다. 등록된 프로그램은 이 DNA 사이트를 통해서 홍보되며, 개발자 본인의 의사에 따라 다른 사용자가 다운받아 설치할 수 있게 됩니다. 예) apid=ba8c53ab7970189d93a7 |
서명 인증 파라미터 #
- 서명된 오픈 API는 인증키가 다른 사용자에 의해서 도용 되는 것을 보호해 줍니다.
- 서명은 필수적인 파라미터가 아닙니다. 그러나, 일부 오픈 API는 반드시 서명을 요구합니다.
- 서명에 사용되는 파라미터를 설명합니다.
| 이름 | 값 | 설명 |
| ts | YYYYMMDDhhmmss | 오픈 API를 호출하는 시간. UTC Time 으로 변환되서 전달되어야 합니다. 서명 값(sig)을 전달할 때 반드시 포함되어야 합니다. 예, ts=20060501153010 |
| nonce | 16 byte hexadecimal string | 랜덤한 8byte binary 값. ts 와 함께 서명의 재 사용여부를 확인하는데 사용됩니다. 서명 값(sig)을 전달할 때 반드시 포함되어야 합니다. 예, nonce=bd149ae021feb132 |
| sigalg | "hmacsha1" | 서명에 사용하는 알고리즘 이름. "hmacsha1" 으로 고정되어 있습니다. 실제 사용하는 알고리즘은 RFC 2014 에 정의되어 있는 HMACSHA-1 입니다. 서명 값(sig)을 전달할 때 반드시 포함되어야 합니다. |
| sig | 40 byte hexadecimal string | 오픈 API 호출 URL 전체에 대해서 서명키로 서명한 값. 예) sig=b45de8a31aed6e58b831dd72087bb4ed71fcaf98 |
- 서명 값 만들기 & 소스 예제 코드 : HowToSign
- 서비스 인증 변수: 본 서비스에서 사용되는 변수는 아래와 같습니다.
| 요청 변수 | 값 | 설명 |
| q | string (필수) | 검색을 원하는 질의 |
| result | integer : 기본값 10, 최소 1, 최대 20 | 한 페이지에 출력될 결과수 |
| pageno | integer : 기본값 1, 최소 1, 최대 500 | 검색 결과 페이지 번호 |
| sort | string : excat(기본값), date, recommand | exact:정확도순, date:날짜순, recommand:추천순 |
| output | string : json(기본값), xml, json | 결과형식 |
| tagsearch | string : off(기본값), on | off:일반검색, on:tag검색 |
- 샘플 URL
출력 방식 (Response Method) #
- RSS방식으로 제공 가능합니다.
- JSON방식으로 제공 가능합니다.
- XML방식으로 제공 가능합니다.
출력 결과 (Response Elements) #
- 출력 결과
| 출력 변수 | 값 | 설명 |
| title | string | 검색 제목 |
| desc | string | 검색 결과의 간략한 소개 |
| totalCount | integer | 전체 검색 결과의 수 |
| sort | string | 검색 결과의 정렬순 |
| result | integer | 한 페이지에 보여질 결과 수 |
| pageno | integer | 검색 결과의 페이지 번호 |
| q | string | 검색어 |
| item | - | 개별 검색 결과 정보 |
| title | string | 개별 검색 결과의 제목 |
| description | string | 개별 검색 결과의 본문 요약 |
| tag | string | 태그목록 |
| thumbnail | string | 썸네일 URL |
| link | string | 동영상 Play URL |
| cpname | string | 출처 |
| author | string | 작성자 |
| playcnt | integer | Play 횟수 |
| score | integer | 평점 |
| date | Date | 날짜 |
| playtime | integer | 재생시간 |
| bitrate | integer | 동영상의 BitRate |
| thumb_0 | string | 첫번째 썸네일 URL |
| time_0 | interger | 첫번째 썸네일의 시간 |
| thumb_1 | string | 두번째 썸네일 URL |
| time_1 | interger | 두번째 썸네일의 시간 |
| thumb_2 | string | 세번째 썸네일 URL |
| time_2 | interger | 세번째 썸네일의 시간 |
| thumb_3 | string | 네번째 썸네일 URL |
| time_3 | interger | 네번째 썸네일의 시간 |
| thumb_4 | string | 다섯번째 썸네일 URL |
| time_4 | interger | 다섯번째 썸네일의 시간 |
| thumb_5 | string | 여섯번째 썸네일 URL |
| time_5 | interger | 여섯번째 썸네일의 시간 |
출력 결과 샘플 페이지 #
* JSON 출력 결과
{
"channel":{
"item":[{
"thumb_4":"http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/4.jpg",
"time_0":"0",
"title":"Re: sg워너비 웨딩mp3파일 구합니다..daum998@hanmail.net",
"playcnt":"100",
"link":"http://k.daum.net/qna/view.html?qid=3LAAw",
"pubDate":"20070829014937",
"time_3":"106",
"thumb_3":"http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/3.jpg",
"thumbnail":"http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/0.jpg",
"playtime":"213",
"thumb_0":"http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/0.jpg",
"time_4":"142",
"thumb_2":"http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/2.jpg",
"score":"0",
"time_5":"177",
"time_1":"35",
"thumb_1":"http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/1.jpg",
"description":"메일로,,",
"tag":"가요",
"time_2":"71",
"bitrate":"800",
"thumb_5":"http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/5.jpg",
"cpname":"신지식",
"author":"별해린"
},
{
"thumb_4":"http://cfs.flvs.daum.net/files/23/37/95/51/6077669/4.jpg",
"time_0":"0",
"title":"반항하지마 1-1화 (cafe.daum.net/MUSVIDEO : 스타일 Diary)",
"playcnt":"69",
"link":"http://tvpot.daum.net/clip/ClipView.do?clipid=4089045",
"pubDate":"20070815105419",
"time_3":"721",
"thumb_3":"http://cfs.flvs.daum.net/files/23/37/95/51/6077669/3.jpg",
"thumbnail":"http://vclip.search.hanmail.net/v2/a/53/8b/tvpot_4089045.jpg",
"playtime":"1443",
"thumb_0":"http://cfs.flvs.daum.net/files/23/37/95/51/6077669/0.jpg",
"time_4":"962",
"thumb_2":"http://cfs.flvs.daum.net/files/23/37/95/51/6077669/2.jpg",
"score":"2",
"time_5":"1202",
"time_1":"240",
"thumb_1":"http://cfs.flvs.daum.net/files/23/37/95/51/6077669/1.jpg",
"description":"G.T.O. 반항하지마 1 - (1) 화",
"tag":"반항하지마,cafe,daum,스타일,Diary",
"time_2":"481",
"bitrate":"800",
"thumb_5":"http://cfs.flvs.daum.net/files/23/37/95/51/6077669/5.jpg",
"cpname":"tv팟",
"author":"흑풍회단장"
}],
"tagsearch":"off",
"sort":"exact",
"title":"Search vclip Daum Open API",
"result":"10",
"totalCount":10035,
"q":"daum",
"pageno":"1",
"desc":"Daum Open API search result"
}
}
* RSS 출력 결과
<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title> Daum Open API - vclip Search - query : 'daum'</title> <link>http://apis.daum.net/search/vclip</link> <description>Daum Open API search result</description> <lastBuildDate>Wed, 29 Aug 2007 14:20:25 +0900</lastBuildDate> <generator>Daum Open API :: Search - vclip</generator> <totalCount>10035</totalCount> <tagsearch>off</tagsearch> <sort>exact</sort> <result>10</result> <pageno>1</pageno> <q>daum</q> <item> <title>Re: sg워너비 웨딩mp3파일 구합니다..daum998@hanmail.net</title> <description>메일로,,</description> <tag>가요</tag> <thumbnail>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/0.jpg</thumbnail> <link>http://k.daum.net/qna/view.html?qid=3LAAw</link> <cpname>신지식</cpname> <author>별해린</author> <playcnt>100</playcnt> <score>0</score> <pubDate>Wed, 29 Aug 2007 01:49:37 +0900</pubDate> <playtime>213</playtime> <bitrate>800</bitrate> <thumb_0>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/0.jpg</thumb_0> <time_0>0</time_0> <thumb_1>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/1.jpg</thumb_1> <time_1>35</time_1> <thumb_2>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/2.jpg</thumb_2> <time_2>71</time_2> <thumb_3>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/3.jpg</thumb_3> <time_3>106</time_3> <thumb_4>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/4.jpg</thumb_4> <time_4>142</time_4> <thumb_5>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/5.jpg</thumb_5> <time_5>177</time_5> </item> <item> <title>반항하지마 1-1화 (cafe.daum.net/MUSVIDEO : 스타일 Diary)</title> <description>G.T.O. 반항하지마 1 - (1) 화</description> <tag>반항하지마,cafe,daum,스타일,Diary</tag> <thumbnail>http://vclip.search.hanmail.net/v2/a/53/8b/tvpot_4089045.jpg</thumbnail> <link>http://tvpot.daum.net/clip/ClipView.do?clipid=4089045</link> <cpname>tv팟</cpname> <author>흑풍회단장</author> <playcnt>69</playcnt> <score>2</score> <pubDate>Wed, 15 Aug 2007 10:54:19 +0900</pubDate> <playtime>1443</playtime> <bitrate>800</bitrate> <thumb_0>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/0.jpg</thumb_0> <time_0>0</time_0> <thumb_1>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/1.jpg</thumb_1> <time_1>240</time_1> <thumb_2>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/2.jpg</thumb_2> <time_2>481</time_2> <thumb_3>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/3.jpg</thumb_3> <time_3>721</time_3> <thumb_4>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/4.jpg</thumb_4> <time_4>962</time_4> <thumb_5>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/5.jpg</thumb_5> <time_5>1202</time_5> </item> </channel> </rss>* XML 출력 결과
<?xml version="1.0" encoding="UTF-8" ?> <channel> <title>Search vclip Daum Open API</title> <desc>Daum Open API search result</desc> <totalCount>10035</totalCount> <tagsearch>off</tagsearch> <sort>exact</sort> <result>10</result> <pageno>1</pageno> <q>daum</q> <item> <title>Re: sg워너비 웨딩mp3파일 구합니다..daum998@hanmail.net</title> <description>메일로,,</description> <tag>가요</tag> <thumbnail>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/0.jpg</thumbnail> <link>http://k.daum.net/qna/view.html?qid=3LAAw</link> <cpname>신지식</cpname> <author>별해린</author> <playcnt>100</playcnt> <score>0</score> <pubDate>20070829014937</pubDate> <playtime>213</playtime> <bitrate>800</bitrate> <thumb_0>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/0.jpg</thumb_0> <time_0>0</time_0> <thumb_1>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/1.jpg</thumb_1> <time_1>35</time_1> <thumb_2>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/2.jpg</thumb_2> <time_2>71</time_2> <thumb_3>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/3.jpg</thumb_3> <time_3>106</time_3> <thumb_4>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/4.jpg</thumb_4> <time_4>142</time_4> <thumb_5>http://vclip01.search.hanmail.net/video/files/26/58/37/90/6317183/5.jpg</thumb_5> <time_5>177</time_5> </item> <item> <title>반항하지마 1-1화 (cafe.daum.net/MUSVIDEO : 스타일 Diary)</title> <description>G.T.O. 반항하지마 1 - (1) 화</description> <tag>반항하지마,cafe,daum,스타일,Diary</tag> <thumbnail>http://vclip.search.hanmail.net/v2/a/53/8b/tvpot_4089045.jpg</thumbnail> <link>http://tvpot.daum.net/clip/ClipView.do?clipid=4089045</link> <cpname>tv팟</cpname> <author>흑풍회단장</author> <playcnt>69</playcnt> <score>2</score> <pubDate>20070815105419</pubDate> <playtime>1443</playtime> <bitrate>800</bitrate> <thumb_0>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/0.jpg</thumb_0> <time_0>0</time_0> <thumb_1>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/1.jpg</thumb_1> <time_1>240</time_1> <thumb_2>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/2.jpg</thumb_2> <time_2>481</time_2> <thumb_3>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/3.jpg</thumb_3> <time_3>721</time_3> <thumb_4>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/4.jpg</thumb_4> <time_4>962</time_4> <thumb_5>http://cfs.flvs.daum.net/files/23/37/95/51/6077669/5.jpg</thumb_5> <time_5>1202</time_5> </item> </channel>
오류 메시지 #
- 공통 오류 메시지는 다음과 같습니다.
오류는 다음과 같은 XML로 전달됩니다.
<?xml version="1.0" encoding="UTF-8"?>
<apierror>
<code></code>
<message></message>
<dcode></code>
<dmessage></dmessage>
</apierror>
오류 XML의 각 항목은 아래와 같은 값을 가집니다.
| 오류 코드 (code|dcode) | 오류(message) | 상세 오류(dmessage) | 설명 |
| 10 | | invalid request | 오픈 API 호출이 공통 호출 규약에 맞지 않은 경우에 전달된다. | |
| 10 | 11 | invalid request | apikey missing | apikey 파라미터가 없음 |
| 10 | 12 | invalid request | Missing auth parameter 'ts'. | ts 파라미터가 없음 |
| 10 | 13 | invalid request | Missing auth parameter 'nonce'. | nonce 파라미터가 없음 |
| 10 | 14 | invalid request | Missing auth parameter 'sigalg'. | sigalg 파라미터가 없음 |
| 10 | 15 | invalid request | Missing auth parameter 'sig'. | sig 파라미터가 없음 |
| 10 | 18 | invalid request | Missing parameter 'apid'. | apid 파라미터가 없음 |
| 20 | | unknown ap instance | 프로그램 인증 실패. | |
| 20 | 21 | unknown ap instance | invalid apikey | 유효하지 않은 apikey |
| 20 | 22 | unknown ap instance | unregistered apikey | 등록되지 않은 apikey |
| 20 | 23 | unknown ap instance | unregistered apid | 등록되지 않은 apid |
| 20 | 24 | unknown ap instance | Signature sigkey is not valid. | 유효하지 않은 서명키 |
| 20 | 25 | unknown ap instance | invalid apid | 유효하지 않은 apid |
| 20 | 26 | unknown ap instance | SignatureKey is not issued to this apikey. | apikey 해당하지 않는 서명키 |
| 20 | 27 | unknown ap instance | ts, nonce are reused. | ts,nonce 재사용 오류 |
| 20 | 28 | unknown ap instance | Unsupported Sign Algorithm. | 지원하지 않는 서명 알고리즘 |
| 30 | | unknown daumuser | apikey 소유자의 Daum 인증 실패. | |
| 40 | | access denied | 서비스 접근 거부 | |
| 40 | 41 | access denied | valid api call but traffic overed | 하루 api 호출 traffic 초과 |
| 40 | 42 | access denied | apikey does not match api category | 이 apikey 로 호출할 수 있는 api 가 아님 |
| 40 | 43 | access denied | unsigned call | 서명되지 않은 호출 |
| 40 | 44 | access denied | unregistered ip | 등록되지 않은 IP 주소 |
| 40 | 45 | access denied | apid doesnot use api | 프로그램이 이 api를 사용하고 있지 않음 |
| 404 | no such api | 해당 오픈 API 서비스가 없음 | |
| 500 | system error | 오픈 API 서비스 내부 시스템 에러. | |
| 504 | service timeout | 오픈 API 서비스 연결 실패. 서비스 시스템 과부하 또는 장애로 인한 서비스 연결 실패. | |
| 100 | | service api runtime error | 오픈 API 서비스 실행 오류. 101~299 값을 가지며, 각 API 에서 정의함. |
- 이 서비스의 오류 메시지는 다음과 같습니다.
| 오류 코드(dcode) | 오류 설명(dmessage) |
| 101 : Required parameter | 필수 Parameter를 요청하지 않았습니다. 필수 Parameter 가 dummy일 경우 '...&dummy=&'와 같이 값을 입력하지 않았거나 Parameter를 name자체를 입력하지 않았을 경우에 해당 에러메세지를 발생합니다. |
| 111 : Exceeded maximum value | Parameter의 값이 integer일 경우, 입력된 값이 최대값을 초과하면 해당 에러 메세지를 발생합니다. |
| 112 : Belowed minimum value | Parameter의 값이 integer일 경우, 입력된 값이 최소값의 미만이면 해당 에러 메세지를 발생합니다. |
| 121 : Invalid value | Parameter의 type이 잘못 입력되었습니다. parameter 값이 integer일 경우 string값으로 입력되면 해당 에러 메세지를 발생합니다. |
| 122 : Not allowed value | Parameter에 허용되지 않은 값이 입력되었습니다. Parameter에 제한된 값이 있을 경우 허용되지 않은 값이 입력되면 해당 에러 메세지를 발생합니다. |
| 131 : System error | System의 오류가 있을시 해당 에러 메세지를 발생합니다. |
트래픽 제한 #
- 오픈 API는 하나의 apikey에 대해서 하루 5,000 회의 호출 만을 허용합니다.
- 트래픽 제어는 보안을 위한 측면이 크며, 증가 추이에 따라 트래픽 허용 수를 늘리는 정책을 사용할 예정입니다.
- 상용 서비스를 위해 또는 사용자 증가로 인하여 허용 traffic 수를 늘리고자 할때에는 어플리케이션 등록을 마치고, 해당 apid에 대해 별도로 traffic 을 조정할 수 있습니다.
샘플 코드 #
- PHP 코드
- JavaScript 코드



