forked from simonw/python-guardianapi
-
Notifications
You must be signed in to change notification settings - Fork 1
License
waynemoore/python-guardianapi
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Usage
=====
>>> from guardianapi import Client
>>> client = Client('my-api-key-goes-here')
>>> results = client.search(q = 'ocelots')
>>> results.count()
36
>>> for item in results:
... print item['webTitle']
This will return the first ten results. To retrieve everything (by
paginating across all pages automatically), do the following:
>>> for item in results.all():
... print item['webTitle']
To access the filters for a result set:
# Warning -- filters not currently working
>>> for filter in results.filters():
... print filter
Some API responses include URLs to make further requests. Here's how to start
a request using a full API URL:
>>> url = results.filters()[0]['apiUrl']
>>> new_results = client.request(url)
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Python 100.0%