- HOME >
- API/マッシュアップニュース
API/マッシュアップニュース
2009.01.14Google検索機能を組み込む為のJavaScriptライブラリ&検索結果を取得する「Google AJAX Search API」
CATEGORY:API紹介
Google AJAX Search API は、Google検索機能を自分のサイトに組み込む事ができるJavaScriptライブラリです。
JavaScriptライブラリ以外にも、GETリクエストからJSON形式で検索結果を取得する事ができますので、Flashやサーバサイドプログラムで検索結果データだけを利用した場合はこちらが便利です。
サンプルリクエスト(Paris Hiltonを検索)
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton
サンプルレスポンス(JSON形式)
{”responseData”: {
“results”: [
{
"GsearchResultClass": "GwebSearch",
"unescapedUrl": "http://en.wikipedia.org/wiki/Paris_Hilton",
"url": "http://en.wikipedia.org/wiki/Paris_Hilton",
"visibleUrl": "en.wikipedia.org",
"cacheUrl": "http://www.google.com/search?qu003dcache:TwrPfhd22hYJ:en.wikipedia.org",
"title": "u003cbu003eParis Hiltonu003c/bu003e - Wikipedia, the free encyclopedia",
"titleNoFormatting": "Paris Hilton - Wikipedia, the free encyclopedia",
"content": "[1] In 2006, she released her debut album…”
},
{
“GsearchResultClass”: “GwebSearch”,
“unescapedUrl”: “http://www.imdb.com/name/nm0385296/“,
“url”: “http://www.imdb.com/name/nm0385296/“,
“visibleUrl”: “www.imdb.com”,
“cacheUrl”: “http://www.google.com/search?qu003dcache:1i34KkqnsooJ:www.imdb.com”,
“title”: “u003cbu003eParis Hiltonu003c/bu003e”,
“titleNoFormatting”: “Paris Hilton”,
“content”: “Self: Zoolander. Socialite u003cbu003eParis Hiltonu003c/bu003e…”
},
…
],
“cursor”: {
“pages”: [
{ "start": "0", "label": 1 },
{ "start": "4", "label": 2 },
{ "start": "8", "label": 3 },
{ "start": "12","label": 4 }
],
“estimatedResultCount”: “59600000″,
“currentPageIndex”: 0,
“moreResultsUrl”: “http://www.google.com/search?oeu003dutf8u0026ieu003dutf8…”
}
}
, “responseDetails”: null, “responseStatus”: 200}


