Skip to content

Instantly share code, notes, and snippets.

@jackiekazil
Last active December 29, 2015 18:48
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 jackiekazil/7712806 to your computer and use it in GitHub Desktop.
Save jackiekazil/7712806 to your computer and use it in GitHub Desktop.
Python example on how to extract data from USDA.
import requests
import sys
key = sys.argv[1]
base = 'http://api.data.gov/USDA/ERS/data/Arms/Surveys'
url = '%s?api_key=%s' % (base, key)
response = requests.get(url)
print response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment