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

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:

factual.crosswalk().factual_id("110ace9f-80a7-47d3-9170-e9317624ebd9").data()

BAM! Tasty data, check it out:

{
  "url": "http://www.allmenus.com/ca/los-angeles/69110-california-pizza-kitchen/info",
  "factual_id": "110ace9f-80a7-47d3-9170-e9317624ebd9",
  "namespace_id": "69110",
  "namespace": "allmenus"
},
{
  "url": "http://api.bitehunter.com/v2.0/restaurants/id/67e030af8d75b7d595bf5e86d6ad5126",
  "factual_id": "110ace9f-80a7-47d3-9170-e9317624ebd9",
  "namespace_id": "67e030af8d75b7d595bf5e86d6ad5126",
  "namespace": "bitehunter"
},
{
  "url": "http://www.facebook.com/pages/California-Pizza-Kitchen-Westwood-VillageUCLA/152206654808652",
  "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

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:

(init! YOUR_KEY YOUR_SECRET)
 
(select restaurants-us
  (around {:lat 34.06021 :lon -118.4183 :miles 3})
  (search "cigar")
    (where
      (= :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,
  :hours
  "{\"1\":[[\"16:00\",\"2:00\"]],\"2\":[[\"16:00\",\"2:00\"]],\"3\":[[\"16:00\",\"2:00\"]],\"4\":[[\"16:00\",\"2:00\"]],\"5\":[[\"16:00\",\"2:00\"]],\"6\":[[\"19:00\",\"2:00\"]]}",
  :owner "Rigo Fernandez",
  :latitude 34.058085,
  :meal_dinner true,
  :meal_cater true,
  :parking true,
  :region "CA",
  :address "9715 Santa Monica Blvd",
  :website "http://www.buenavistacigarclub.com/",
  :tel "(310) 273-8100",
  :category "Shopping > Tobacco Shops",
  :$distance 969.9574})

Haskell

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" ]
result

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