From 0c7abdcf1887285a5dccf0073629521a91cc0276 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 26 Jan 2017 23:50:22 +0100 Subject: api: demo /matches endpoint --- crawler.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crawler.py') diff --git a/crawler.py b/crawler.py index 07ca22f..68b994f 100644 --- a/crawler.py +++ b/crawler.py @@ -37,6 +37,13 @@ class Crawler(object): assert response.status == 200 return await response.json() + async def version(self): + """Returns the current API version.""" + + async with aiohttp.ClientSession() as session: + status = await self._req(session, "status") + return status["data"]["attributes"]["version"] + async def matches(self, region="na", params=None): """Queries the API for matches and their related data. -- cgit v1.3.1