Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created November 26, 2014 21:20
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 geobabbler/da8c144bf49d0a0b0209 to your computer and use it in GitHub Desktop.
Save geobabbler/da8c144bf49d0a0b0209 to your computer and use it in GitHub Desktop.
Import JSON from StackExchange tags API to CSV
import requests
from pprint import pprint
r = requests.get('https://api.stackexchange.com/2.2/tags?page=1&pagesize=100&order=desc&sort=popular&site=gis')
data = r.json()
print "tag,count"
for tag in data["items"]:
print tag["name"] + "," + str(tag["count"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment