Using the new Bing Web Search API from Java and Clojure
I wrote a simple wrapper that is on github for calling the new API. The old API will not work starting in August 2012 so it was time to update. The README file on github has a simple example for using the JAR created by this project in a Clojure project (a pre-built JAR is also included in the github repository).
The wrapper is simple, but will save you a few minutes writing one yourself if you need to use Bing Web Search in Java, Clojure, JRuby, etc.
You get 100 free searches/day with the new API and there is a charge if you need more API calls per day.
Thanks. I tried it. I get the Json response. How can I parse it to get the URLs in search results from all pages?
ReplyDeleteI have an example for parsing the JSON in Clojure on the github page https://github.com/mark-watson/bing_search_java - example code:
ReplyDelete(ns knowledgespace.engine.search
(:import [com.markwatson.search Bing])
(:import [com.markwatson.search Translate]))
(use '[clojure.data.json :only (read-json)])
(defn search [query]
(read-json (Bing/search query)))
(defn translate [text from-language to-language]
(read-json (Bing/search query)))
For Java clients you can use Google's GSON library or go to son.org for alternatives.