我很難找出正確的格式來調用谷歌自定義搜索引擎(CSE)的URL來返回XML格式的結果(使用它們的free service進行100次調用天)。我已經建立了一個賬戶和CSE。所以現在我有一個公共的URL https://www.google.com/cse/publicurl?cx=010317493064298903457:5bsx2whinf8
來搜索BBC新聞。但我無法從文檔中找出如何開發URL調用來返回XML格式的結果。Google XML/JSON結果 - 使用自定義搜索引擎
https://www.google.com/cse/publicurl?cx=010317493064298903457:5bsx2whinf8&q=london&start=0&num=10&output=xml_no_dtd
(基於CSE設置選項中提供的代碼)給出了html框架的結果。
http://www.google.com/search?start=0&num=10&q=london&client=google-csbe&output=xml_no_dtd&cx=010317493064298903457:5bsx2whinf8
(在XML API examples之後)也返回HTML。
非常感謝一個想法,我錯了。
本頁頂部的註釋表明XML僅適用於付費用戶:https://developers.google.com/custom-sea rch/docs/xml_results –
也許,但[自定義搜索控制API](https://developers.google.com/custom-search/docs/overview)允許用戶每天撥打100個電話。它默認使用同樣可用的json。 – geotheory
從你的文章我以爲你只對XML感興趣..如果JSON是一個選項,我認爲你必須使用這個方法:https://developers.google。com/custom-search/json-api/v1/reference/cse/list –