LoginSignup
3
3

More than 5 years have passed since last update.

プリトレアイテム検索API

Last updated at Posted at 2015-09-02

プリトレアイテム検索API

プリトレに登録済みのアイテムの検索APIです。
なんかで使うときあったらどうぞ。
連絡不要ですけど連絡くれたらよろこびます

呼び出し

jQuery
var url = "https://pripara.trade/api/item_search/?callback=?",
    param = {
        "ts": new Date().getTime(),
        "q": "検索ワード",
        "item_category": "アイテムカテゴリ ※1",
        "item_type": "アイテムタイプ ※2",
        "item_brand": "アイテムブランド ※3",
        "item_color": "アイテムカラー ※4",
        "p": "(int)ページ番号(0〜)"
    };

    $.getJSON(url, param, (function(data) {
        if(data.result) {
           // 見つかったとき
        } else {
           // 1件もなかったとき
        }
    }));

PHPでもGETパラメータ同じなら動きます(callbackは消してね)
item_***パラメータが無い場合は空データ送ってください。

※1 アイテムカテゴリ

  • トップス
  • ボトムス
  • シューズ
  • ワンピース
  • ヘアアクセ
  • アゲアゲ

スカートとかパンツってカテゴリありますが、ボトムスで統一(アイテム自体にはそのままのデータであります)
ヘアアクセもなぜかアクセサリーとか分裂してる…(統合して検索返します)
ほかにも、
べスト、カットソー、パーカ、ミニスカートってカテゴリあったけど該当のものに修正しました…

※2 アイテムタイプ

  • ラブリー
  • ポップ
  • クール
  • ナチュラル
  • セレブ
  • プレミアム

※3 アイテムブランド

  • twinkle
  • candy
  • holic
  • baby
  • fortune
  • marionette
  • dreaming
  • classic
  • silky
  • coco
  • more
  • prince
  • buki
  • RONI
  • pretty
  • prismstone
  • ps_dream
  • resette_jewel
  • lovedevi
  • dear
  • zoo

※4 アイテムカラー

  • 黄緑

「MR」の検索結果

{

    "result":true,
    "req":{
        "q":"MR",
        "p":1,
        "item_type":"",
        "item_brand":"",
        "item_color":"",
        "item_category":""
    },
    "total":"9",
    "nav":{
        "page":1,
        "prev":false,
        "next":true
    },
    "items":[
        {
            "id_str":"MR-005",
            "name":"ミステリーHTサイリウムワンピ",
            "category":"ワンピース",
            "type":"クール",
            "brand":"HolicTrick",
            "rarity":"MR",
            "like":2290,
            "color":"黒",
            "img":"/storage/i/secret.png"
        },

        ... 中略 ...

        {
            "id_str":"H-MR-002",
            "name":"ミステリーCAサイリウムヘアアクセ",
            "category":"ヘアアクセ",
            "type":"ポップ",
            "brand":"CandyAlamode",
            "rarity":"",
            "like":0,
            "color":"白",
            "img":"/storage/i/9x1772.jpg"
        }
    ]

}

返り値について

result
(boolean)true / false
req
q
(string)リクエストした検索ワード
p
(int)リクエストしたページ番号
item_type
(string)リクエストしたアイテムタイプ
item_brand
(string)リクエストしたアイテムブランド
item_color
(string)リクエストしたアイテムカラー
item_category
(string)リクエストしたアイテムカテゴリ
total
(init)検索した条件での総マッチ数
nav
page
(int)現在のページ番号
prev
(boolean)前の1ページへのリンクが有効:true / false
next
(boolean)次の1ページへのリンクが有効:true / false
items
id_str
(string)アイテムID
name
(string)アイテム名
category
(string)アイテムカテゴリ
type
(string)アイテムタイプ
brand
(string)アイテムブランド
rarity
(string)レアリティ
like
(int)初期状態のいいね数
color
(string)カラー
img
(string)http://pripara.trade/ からの画像パス

itemsの順番はユーザーの所持コーデ管理の登録データ数を元に所持数が多い順で出力されています。
後日ソートも付ける予定です(予定は未定)。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3