Upgrade to Pro — share decks privately, control downloads, hide ads and more …

InterLab 2013: Opening up your data with web se...

InterLab 2013: Opening up your data with web service APIs (and how to make this easier)

The labs have a lot of great data that we often need to share. There’s also a push from the White House to make data more open and machine readable within the government. Web service APIs can be an excellent way to easily share your data both externally and internally. However, if you’re building APIs, there are things to think through like API keys, access control, analytics, rate limiting, documentation, and more. But these are the boring parts of releasing and managing your APIs, so join us to find out how you can quickly leverage existing resources to minimize the amount of time you have to spend thinking about such things. This lets you can focus on the fun parts of actually sharing your data and seeing the benefits.

So come hear about the basics of APIs, how they can benefit your team, and real-world success stories from NREL. Also hear about how we’ve teamed up with data.gov to launch api.data.gov, a free service aimed at helping federal agencies publish and manage their APIs in an easy way. Finally, learn about how all this relates to the Digital Government Strategy and the Open Data Policy, and how you can leverage these resources to more efficiently release APIs, fulfilling these policy requirements, but, more importantly, making your users happy.

Avatar for Nick Muerdter

Nick Muerdter

August 07, 2013

More Decks by Nick Muerdter

Other Decks in Programming

Transcript

  1. Meet
 Joe Schmoe…
 
 He wants to build an app!

    Photo by Christian Montone! http://flickr.com/photos/christianmontone/4520976000!
  2. require "sinatra"! require "multi_json"! require "sinatra/json"! require "sequel"! ! DB

    = Sequel.sqlite("fuel_prices.db")! ! get "/fuel-prices.json" do! records = DB.fetch("SELECT *! FROM fuel_prices ORDER BY date DESC")! ! return json(records.to_a)! end  
  3. get "/fuel-prices/latest.json" do! latest_date = DB.fetch("SELECT MAX(date) AS max_date! FROM

    fuel_prices").get(:max_date)! ! records = DB.fetch("SELECT *! FROM fuel_prices! WHERE date = ? ORDER BY date DESC", latest_date)! ! return json(records.to_a)! end! ! get "/fuel-prices/fuels/:fuel.json" do! records = DB.fetch("SELECT *! FROM fuel_prices! WHERE fuel = ? ORDER BY date DESC", params[:fuel])! ! return json(records.to_a)! end  
  4. API Bonanza!! “Make Open Data, Content, and Web APIs the

    New Default”! ! “Make Existing High-Value Data and Content Available through Web APIs”!