Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple wrapper for the new (2012) Bing Web Search API
branch: master


latest commit 25f7d603aa
@mark-watson authored

A wrapper for the new (2012) Microsoft Bing Web Search, Translate and Spelling Correction APIs

You will need an auth token from Microsoft for search. Currently, 100 searches/day are free.

I set the following in my environment for search correction:


Substitute your Microsoft BING API key.

For spelling correction, set:


(again, substitute your key)

For using the translation services you will also need an application key:

BING_API_APP=e12 ..... 413

You can get an App API key at

The free translation tier is currently 2 megabytes of translated text per month.

I wrote the search and spelling wrappers myself. For translation, I use the wrapper from uses library from:

I also use this wrapper library in Clojure:

  (:import [ Bing])
  (:import [ Translate]))
(use '[ :only (read-json)])

(defn search [query]
  (read-json (Bing/search query)))

(defn translate [text from-language to-language]
  (read-json (Bing/search query)))

You can extend the languages supported by editing the file For now, the to and from languages can be: "chinese", "french", "japanese", "hungarian", "spanish", "english", and "spanish".

(ns test
  (:require [ :as search]))

(println (search/search "parrot"))

(println (search/translate "parrot" "english" "spanish"))

I then include the JAR file in my Clojure project using the kluge I mentioned in a blog article:

Another way to integrate this wrapper in a Clojure lein project

For lein1 based projects, if I am not making frequent changes to Java code that I use in a Clojure project then I set the Java source path in my project.clj file:

   :java-source-path "src/java"

and copy my Java code into PROJECT_DIR/src/java/

notes for local maven install:

➜ bing_search_java git:(master) ✗ lein localrepo install bing.jar local/bing 0.1.0 ➜ bing_search_java git:(master) ✗ lein localrepo list | grep bing local/bing (0.1.0)

Something went wrong with that request. Please try again.