Skip to content

Instantly share code, notes, and snippets.

@calvinhp
Created June 23, 2020 13:27
Show Gist options
  • Save calvinhp/f1eb61bf232abf0a9a588fa3059c9d15 to your computer and use it in GitHub Desktop.
Save calvinhp/f1eb61bf232abf0a9a588fa3059c9d15 to your computer and use it in GitHub Desktop.
import os
from pprint import pprint
import requests
def grab_data():
cdn = os.environ["SE_CDN"]
secret = os.environ["SE_SECRET"]
api_endpoint = f"https://{cdn}:{secret}@api.scaleengine.net/v2"
payload = {
"start_date": "2020-06-18 17:00:00",
"type": "minute",
}
response = requests.get(f"{api_endpoint}/viewers/", params=payload)
pprint(response.json())
if __name__ == "__main__":
grab_data()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment