gnavi v0.0.3
#About
Node.jsからぐるなびAPIを利用するためのクライアントモジュールです。
ご利用の際には、まずぐるなびWebサービスへのユーザ登録をして、アクセスキーを取得してください。
This is a client module for utilizing GURUNAVI API from Node.js.
Please get your access key for GURUNAVI Web Service before using this module.
#Usage
##Initialize
var client = require("gnavi").initClient("YOUR_KEYID_HERE");##Methods ###restSearch(options,callback)
- options : {object}
callback : function(err,data){}
client.restSearch({format:"json"},function(err,data){
if(err) throw err;
console.log(data)
});レストラン検索API(ver.1)を使うことができます。optionsに指定できる項目と値については、ぐるなびAPIドキュメント
をご覧ください。
This method accesses to Restaurant Search API ver.1. You could learn about detail prameters of options in document of GURUNAVI API
###restSearch2(options,callback)
- options : {object}
callback : function(err,data){}
client.restSearch({format:"xml"},function(err,data){
if(err) throw err;
console.log(data)
});レストラン検索API(ver.2)を使うことができます。optionsに指定できる項目と値については、ぐるなびAPIドキュメント
をご覧ください。
This method accesses to Restaurant Search API ver.2. You could learn about detail prameters of options in document of GURUNAVI API
###ouen(options,callback)
- options : {object}
callback : function(err,data){}
client.ouen({format:"json", latitude:35.65858, longitude:139.745433, range:2},function(err,data){
if(err)throw err;
console.log(data);
});応援口コミAPIを使うことができます。optionsに指定できる項目と値については、ぐるなびAPIドキュメント
をご覧ください。
This method accesses to Ouen Kuchikomi API. "Ouen Kuchikomi" is word-of-mouth advertising posted by users for cheering a restaurant. You could learn about detail prameters of options in document of GURUNAVI API
###areaSearch(options,callback)
- options : {object}
callback : function(err,data){}
client.areaSearch({format:"xml"},function(err,data){
if(err)throw err;
console.log(data);
});エリアマスタ取得APIを使うことができます。ドキュメントには、指定可能項目は書かれていませんが、formatをjsonかxmlで指定することができます。
This method accesses to Area Master API. Document of the API does not mention about parameters of options, but it is able to signify format as json or xml.
###prefSearch(options,callback)
- options : {object}
callback : function(err,data){}
client.prefSearch({format:"json"},function(err,data){
if(err)throw err;
console.log(data);
});都道府県マスタ取得APIを使うことができます。ドキュメントには、指定可能項目は書かれていませんが、formatをjsonかxmlで指定することができます。
This method accesses to Prefecture Master API. Document of the API does not mention about parameters of options, but it is able to signify format as json or xml.
###gAreaSearch(scale,options,callback)
- scale : "string"
- options : {object}
callback : function(err,data){}
client.gAreaSearch("large",{lang:"ja",format:"xml"},function(err,data){
if(err)throw err;
console.log(data);
});エリア(L・M・S)マスタ取得APIを使うことができます。L、M、Sの選択は、scaleに"large"、"middle"、"small"で指定します。ドキュメントには、lang以外の指定項目は書かれていませんが、formatをjsonかxmlで指定することができます。
This method accesses to Scaled Area Master API. The scale is defined as Large, Middle, and Small, which is signified in scale by string: "large", "middle", and "small". Document of the API does not mention about parameters of options except for lang, but it is able to signify format as json or xml.
###categorySearch(scale,options,callback)
- scale : "string"
- options : {object}
callback : function(err,data){}
client.categorySearch("large",{format:"json"},function(err,data){
if(err)throw err;
console.log(data);
});(大・小)業態マスタ取得APIを使うことができます。大・小の選択は、scaleに"large"、"small"で指定します。ドキュメントには、指定可能項目は書かれていませんが、formatをjsonかxmlで指定することができます。
This method accesses to Scaled Category Master API. The scale is defined as Large and Small, which is signified in scale by string: "large" and "small". Document of the API does not mention about parameters of options, but it is able to signify format as json or xml.
#Test The test is performed by jasmine-node.
$ jasmine-node spec/ --config keyid YOUR_KEYID_HERE##Licence MIT