Skip to content

Instantly share code, notes, and snippets.

@markglenfletcher
Created September 27, 2015 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markglenfletcher/d415252e9bfdb39855d6 to your computer and use it in GitHub Desktop.
Save markglenfletcher/d415252e9bfdb39855d6 to your computer and use it in GitHub Desktop.
ONS API hit
api_key = 'omit'
root_url = "http://data.ons.gov.uk/ons/api/data/"
api_url_gen = -> (path,key,params) { "#{root_url}#{path}?apikey=#{key}&#{params}" }
datasets_url = api_url_gen.call('contexts.json',api_key,'')
HTTParty.get datasets_url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment