Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 737 Bytes

README.md

File metadata and controls

28 lines (21 loc) · 737 Bytes

STAT API

A simple wrapper around the getstat.com API.

Usage example

from stat_api import Stat
subdomain = 'try'
api_key = 'yourapikey'
stat = Stat(subdomain, api_key)
data = stat.request("/sites/list", project_id=999)

data should now be a Python object of the returned sites as per the documentation.

Bulk job helper

from stat_api import StatBulk
subdomain = 'try'
api_key = 'yourapikey'
stat_bulk = StatBulk(subdomain, api_key)
data = stat_bulk.create_job_and_wait_for_result("/bulk/ranks", date="2015-05-24")

This will create a bulk job, then poll STAT until the job is done and finally return the result.