Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update response format

  • Loading branch information...
commit 92dcde4d655339c165b2a3d9272998604e17e422 1 parent c4463e4
@jehiah jehiah authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 bitly_api/bitly_api.py
View
12 bitly_api/bitly_api.py
@@ -141,19 +141,23 @@ def clicks_by_minute(self, hash=None, shortUrl=None):
def link_clicks(self, link, **kwargs):
params = dict(link=link)
- return self._call_oauth2_metrics("v3/link/clicks", params)
+ data = self._call_oauth2_metrics("v3/link/clicks", params)
+ return data["link_clicks"]
def link_referring_domains(self, link, **kwargs):
params = dict(link=link)
- return self._call_oauth2_metrics("v3/link/referring_domains", params)
+ data = self._call_oauth2_metrics("v3/link/referring_domains", params)
+ return data["referring_domains"]
def link_referrers(self, link, **kwargs):
params = dict(link=link)
- return self._call_oauth2_metrics("v3/link/referrers", params)
+ data = self._call_oauth2_metrics("v3/link/referrers", params)
+ return data["referrers"]
def link_countries(self, link, **kwargs):
params = dict(link=link)
- return self._call_oauth2_metrics("v3/link/countries", params)
+ data = self._call_oauth2_metrics("v3/link/countries", params)
+ return data["countries"]
def _call_oauth2_metrics(self, endpoint, params, unit=None, units=None, tz_offset=None, rollup=None, limit=None):
assert self.access_token, "This %s endpoint requires OAuth" % endpoint
Please sign in to comment.
Something went wrong with that request. Please try again.