Skip to content

Instantly share code, notes, and snippets.

@beweinreich
Last active October 4, 2018 19:42
Show Gist options
  • Save beweinreich/b6e657efdc0f69c4efb6061f8ad7c739 to your computer and use it in GitHub Desktop.
Save beweinreich/b6e657efdc0f69c4efb6061f8ad7c739 to your computer and use it in GitHub Desktop.
import requests
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer REPLACE_ME'}
url = 'https://api.density.io/v2/spaces'
response = requests.get(url, headers=headers)
json_data = response.json()
for result in json_data['results']:
print('{name}: {current_count}\n').format(name=result['name'], current_count=result['current_count'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment