キーワード検索の結果の取得¶
キーワード検索の結果を取得します。
タグは完全一致、キャプション/ディスクリプションは部分一致で検索されます。
またメディアIDによる検索も可能です。(部分一致)
GET /api/1/videos/search
ノート
このAPIは、認証の仕方によって、結果が異なります。
Referrer + Key での認証の場合は、メディアがアクティブなもののみ、
Digest 認証の場合は、削除されていないメディアが、キーワード検索の結果として返されます。
検索のルール¶
1. キャプション・ディスクリプションは部分一致検索¶
複数キーワードの設定について
- 複数の文字列を指定する場合、AND検索とOR検索が可能です。キーワード間はスペースで区切ってご指定下さい。
 - AND検索の場合は、複数の指定された対象文字列を全て含むメディアが返されます。
- AND検索対象とする文字列は、ダブルクォーテーション”“で括って下さい。
 
 - OR検索の場合は、複数の指定された対象文字列の内、一つでも含むメディアが返されます。
 
2. タグ検索は完全一致検索¶
 タグ[abc]とタグ[abcd]は全く別のタグとして扱われます。
3. メディアID検索は部分一致検索¶
 メディアID検索は部分一致検索です。メディアID[5]を指定すると、メディアID[5, 15, 25, ,,, 51,,]など5を含む全てのメディアIDのメディアが返されます。
4. タグ検索やキャプション/ディスクリプション検索の同時指定¶
 タグ検索とキーワード/ディスクリプション検索は同時に指定することが可能です。メディアID検索は他のキーワードと同時に指定することができません。(想定している挙動を保証致しません。)指定するキーワードと返却されるメディアについての関係例は以下になります。
例
| 指定するキーワード | 指定方法 | 返却される対象メディア | 
|---|---|---|
| タグabcと文字列”def” | #abc “def” | タグabcを持ち,かつキャプション/ディスクリプションにdefを含むメディア | 
| 文字列”abc”と文字列”def” | “abc” “def” | キャプション/ディスクリプションにabcとdefの両方の文字列を含むメディア | 
| 文字列abcと文字列def | abc def | キャプション/ディスクリプションにabcまたはdefのどちらかの文字列を含むメディア | 
| 文字列”abc”と文字列def | “abc” def | キャプション/ディスクリプションにabcの文字列を含むメディア | 
Parameters¶
output_type
- Response 形式
- x : XML 形式で出力
 - 指定無し : JSON 形式で出力
 
 
- Response 形式
 page [必須]
- 表示するページ位置。1 以上の整数。[詳細]
 
num [必須]
- 1 ページあたりの件数。[詳細]
 
keywords [必須]
- 検索キーワード(実際には中括弧{}は入れません。)
- #{string} : タグ検索(完全一致検索)
- 文字列キーワードの直前に#をつけて下さい。
 
 - {string} (OR検索指定)または {“string”} (AND検索指定): キャプション,デスクリプション検索(部分一致AND/OR検索)
 - &{integer} : ID検索(部分一致検索)
 
 - 但し,#(シャープ)は%23とURLエンコードされている必要があり、&(アンパサンド)は%26とURLエンコードされている必要があることに注意して下さい。
 - またスペースは%20です。
 
tile_type
- 一覧取得するタイル種別tile_type の指定がない場合は全タイル種別が適用hd 16:9 / sd 4:3 / r 3:2 / s 1:1
 
tile_quality
- 一覧取得するタイル品質tile_quality の指定がない場合は全タイル品質が適用品質は 1 / 2 / 3 から選択可能
 
level
- 一覧取得するタイルのレベルlevel の指定がない場合は全レベルのタイルが適用レベルは 1 / 2 / 3 / 4 から選択可能
 
Response¶
status
- 処理結果success : 成功それ以外 : 失敗
 
has_next
- 次ページの有無true : 有false : 無
 
total
- 総メディア数
 
info
メディア情報
id
- メディアID
 
caption
- キャプション
 
description
- ディスクリプション
 
tags
- タグ
 
thumbnail_url
サムネイルのURL
- サムネイルURLのルールは{メディアID}_{サムネイルの高さ}_{指定されたフレーム位置}.jpgとなる。また、本fvLIBRARY APIを使用して投稿されたメディアは全て30FPSのタイルに変換されます。そのため投稿したオリジナルメディアのフレーム位置とfabric videoであるmp4のフレーム位置は異なる可能性が有ります。
 
sound_url
- 音声データへのURL
 
tile_info
- タイル情報
- version
- fvエンコーダのバージョン
 
 - type
- タイル種別
 
 - fps
- fps
 
 - frames
- 総フレーム数
 
 - level
- タイルレベル(配列)
 
 - tile_quality
- タイル品質(配列)
 
 - create_date
- 作成日時
 
 - update_date
- 更新日時
 
 - status
- タイルのステータス
 
 
 - version
 
- タイル情報
 create_date
- 作成日時
 
update_date
- 更新日時
 
status
- メディアのステータス0 : 無効1 : 有効
 
Request Example¶
GET
https://example.com/api/1/videos/search?page=1&num=2&keywords=abc
Sample Curl Command¶
Basic認証を使用した方法(キャプション・ディスクリプション検索)
- キャプション・ディスクリプションから”abc”と”def”という文字列をOR検索結果はabcまたはdefという文字列のどちらかがキャプション・ディスクリプションに含まれるメディアが返される。
 
curl --basic -u {your account}:{your password} "https://example.com/api/1/videos/search?page=1&num=2&keywords=abc%20def"
- キャプション・ディスクリプションから”abc”と”def”いう文字列をAND検索結果はabc及びdefという文字列の両方がキャプション・ディスクリプションに含まれるメディアが返される。
 
curl --basic -u {your account}:{your password} 'https://example.com/api/1/videos/search?page=1&num=2&keywords="abc"%20"def"'
- タグabcとキャプション・ディスクリプションから”def”という文字列をAND検索結果はタグabcか付けられているメディアでかつdefという文字列がキャプション・ディスクリプションに含まれるメディアが返される。
 
curl --basic -u {your account}:{your password} 'https://example.com/api/1/videos/search?page=1&num=2&keywords=%23abc%20"def"'
AccessToken認証を使用した方法(タグ検索)
curl --basic -u {your account}:{your password} "https://example.com/api/1/videos/search?page=1&num=2&keywords=%23abc" \
-H "Authorization: Bearer {your access_token}"
Response Example - JSON¶
{
  "status":"success",
  "has_next":true,
  "total":8,
  "info":[
    {
      "id":17,
      "caption":"test caption",
      "tags":[
        "tag",
        "abc",
        "test"
      ],
      "thumbnail_url":[
        "http:\/\/example.com\/r\/p\/images\/tt\/17_144_0.jpg",
        "http:\/\/example.com\/r\/p\/images\/tt\/17_288_0.jpg",
        "http:\/\/example.com\/r\/p\/images\/tt\/17_432_0.jpg",
        "http:\/\/example.com\/r\/p\/images\/tt\/17_576_0.jpg"
      ],
      "sound_url":[
        "http:\/\/example.com\/r\/p\/audios\/ta\/17_1.m4a"
      ],
      "tile_info":{
        "version":"3",
        "type":"hd144",
        "fps":30,
        "frames":4500,
        "level":[
          1,
          2,
          3,
          4
        ],
        "tile_quality":[1,2],
        "create_date":"2013-01-11 12:25:17",
        "update_date":"2013-01-11 12:38:43",
        "status":1
      },
      "create_date":"2013-01-11 12:25:17",
      "update_date":"2013-01-11 15:48:15",
      "status":1
    },
    {
      "id":16,
      "caption":"test caption",
      "tags":[
        "tag",
        "abc",
        "test"
      ],
      "thumbnail_url":[
        "http:\/\/example.com\/r\/p\/images\/tt\/16_144_0.jpg",
        "http:\/\/example.com\/r\/p\/images\/tt\/16_288_0.jpg",
        "http:\/\/example.com\/r\/p\/images\/tt\/16_432_0.jpg",
        "http:\/\/example.com\/r\/p\/images\/tt\/16_576_0.jpg"
      ],
      "sound_url":[
        "http:\/\/example.com\/r\/p\/audios\/ta\/16_1.m4a"
      ],
      "tile_info":{
        "version":"3",
        "type":"hd144",
        "fps":30,
        "frames":3090,
      "level":[
        1,
        2,
        3,
        4
      ],
      "tile_quality":[1,3],
      "create_date":"2013-01-11 12:24:53",
      "update_date":"2013-01-11 12:35:40",
      "status":1
    },
    "create_date":"2013-01-11 12:24:53",
    "update_date":"2013-01-11 12:25:01",
    "status":1
    }
  ]
}
Response Example - XML¶
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>success</status>
<has_next>1</has_next>
<total>8</total>
<info>
  <entry>
    <id>17</id>
    <caption>test caption</caption>
    <tags>
      <entry>tag</entry>
      <entry>abc</entry>
      <entry>test</entry>
    </tags>
    <thumbnail_url>
      <entry>http://example.com/r/p/images/tt/17_144_0.jpg</entry>
      <entry>http://example.com/r/p/images/tt/17_288_0.jpg</entry>
      <entry>http://example.com/r/p/images/tt/17_432_0.jpg</entry>
      <entry>http://example.com/r/p/images/tt/17_576_0.jpg</entry>
    </thumbnail_url>
    <sound_url>
      <entry>http://example.com/r/p/audios/ta/17_1.m4a</entry>
    </sound_url>
    <tile_info>
      <version>3</version>
      <type>hd144</type>
      <fps>30</fps>
      <frames>4500</frames>
      <level>
        <entry>1</entry>
        <entry>2</entry>
        <entry>3</entry>
        <entry>4</entry>
      </level>
      <tile_quality>
       <entry>1</entry>
       <entry>2</entry>
      </tile_quality>
      <create_date>2013-01-11 12:25:17</create_date>
      <update_date>2013-01-11 12:38:43</update_date>
      <status>1</status>
    </tile_info>
    <create_date>2013-01-11 12:25:17</create_date>
    <update_date>2013-01-11 15:48:15</update_date>
    <status>1</status>
  </entry>
  <entry>
    <id>16</id>
    <caption>test caption</caption>
    <tags>
      <entry>tag</entry>
      <entry>abc</entry>
      <entry>test</entry>
    </tags>
    <thumbnail_url>
      <entry>http://example.com/r/p/images/tt/16_144_0.jpg</entry>
      <entry>http://example.com/r/p/images/tt/16_288_0.jpg</entry>
      <entry>http://example.com/r/p/images/tt/16_432_0.jpg</entry>
      <entry>http://example.com/r/p/images/tt/16_576_0.jpg</entry>
    </thumbnail_url>
    <sound_url>
      <entry>http://example.com/r/p/audios/ta/16_1.m4a</entry>
    </sound_url>
    <tile_info>
      <version>3</version>
      <type>hd144</type>
      <fps>30</fps>
      <frames>3090</frames>
      <level>
        <entry>1</entry>
        <entry>2</entry>
        <entry>3</entry>
        <entry>4</entry>
      </level>
      <tile_quality>
        <entry>1</entry>
        <entry>3</entry>
      </tile_quality>
      <create_date>2013-01-11 12:24:53</create_date>
      <update_date>2013-01-11 12:35:40</update_date>
      <status>1</status>
    </tile_info>
    <create_date>2013-01-11 12:24:53</create_date>
    <update_date>2013-01-11 12:25:01</update_date>
    <status>1</status>
  </entry>
</info>
</response>