Return to Blog

Factual Releases Drivers that Matter: Python, Clojure, Haskell

As Factual adds more data and features to its APIs, it’s important that developers have it easy. So we’ve put our heart into releasing client side drivers that matter. Yes, we’ve got drivers like the Java driver and the PHP driver and stuff like that, if that’s what you need. But we’ve also fielded a few drivers that matter in their own special ways:


Python is the greatest scripting language ever created. It does “everything-is-an-object” and gets it right, has a general feel of solid design, and is an unmitigated joy to hack with. Grab Factual’s Python driver (it’s in PyPI), authenticate, and get going:

from factual import Factual
factual = Factual(YOUR_KEY, YOUR_SECRET)

factual.table("places").search("sushi santa monica")

That gives you businesses in Santa Monica that match a full text search for “sushi”. Select one and use Factual’s Crosswalk to get more info from other respected web authorities:


BAM! Tasty data, check it out:

  "url": "",
  "factual_id": "110ace9f-80a7-47d3-9170-e9317624ebd9",
  "namespace_id": "69110",
  "namespace": "allmenus"
  "url": "",
  "factual_id": "110ace9f-80a7-47d3-9170-e9317624ebd9",
  "namespace_id": "67e030af8d75b7d595bf5e86d6ad5126",
  "namespace": "bitehunter"
  "url": "",
  "factual_id": "110ace9f-80a7-47d3-9170-e9317624ebd9",
  "namespace_id": "152206654808652",
  "namespace": "facebook"

That Crosswalk stuff, BTW, is neat-o. See how Factual gives you links out to guys like Facebook and AllMenus? There’s also Crosswalk data for Yelp, Foursquare, and lots of others.


Clojure is a Lisp and Lisp is the most powerful programming language known to mankind. Virtually free reign with macros, closures, DSLs… it’s crazy.

If you want to use the world’s most powerful programming language to query the world’s most powerful open data platform, grab PrettyQL (available via Clojars) and make it happen:


(select restaurants-us
  (around {:lat 34.06021 :lon -118.4183 :miles 3})
  (search "cigar")
      (= :alcohol true)
      (= :meal_dinner true)
      (= :parking_free true)))

That pretty snippet of code searches for a cigar shop near me where I can have dinner and drinks and not pay for parking. Check out the spicy results, mate:

({:open_24hrs false,
  :status "1",
  :country "US",
  :longitude -118.408088,
  :factual_id "5e2c36e4-aeb8-49b8-8652-defcd8ad5808",
  :parking_free true,
  :payment_cashonly false,
  :name "Buena Vista Cigar Club",
  :postcode "90210",
  :locality "Beverly Hills",
  :alcohol true,
  :alcohol_bar true,
  :owner "Rigo Fernandez",
  :latitude 34.058085,
  :meal_dinner true,
  :meal_cater true,
  :parking true,
  :region "CA",
  :address "9715 Santa Monica Blvd",
  :website "",
  :tel "(310) 273-8100",
  :category "Shopping > Tobacco Shops",
  :$distance 969.9574})


Haskell is the king of purely-functional, lazy, statically-typed languages. Write some Haskell and know that “if your code compiles it runs correctly”. Enjoy the same level of confidence using Factual… just plug in the Factual Haskell driver (factual-api in Cabal), and away you go:

let token = generateToken yourKey yourSecret

let query = ResolveQuery [ ResolveStr "name" "McDonalds"
                         , ResolveStr "address" "10451 Santa Monica Blvd" ]

That runs Factual’s Resolve service on a few business attributes and gives you back a “resolved” Factual entity. Now you can have confidence in your code AND your data.

But wait there’s more!

This was a whirlwind tour of a few selected client side drivers for Factual. But this hardly touches the full set of Factual’s live data and APIs. And there’s more data on the way, and more features on top of that.

We’ve also published drivers for Java, Ruby, PHP and iOS, with .NET and Android on the way. Just in case you’re… you know… into that sort of thing.

Best wishes,
Aaron Crow
Software Engineer