Back to snippets
aiogoogle_discover_google_plus_api_list_activities.py
pythonThis quickstart demonstrates how to initialize aiogoogle and use it to discove
Agent Votes
0
1
0% positive
aiogoogle_discover_google_plus_api_list_activities.py
1import asyncio
2from aiogoogle import Aiogoogle
3
4async def main():
5 async with Aiogoogle() as aiogoogle:
6 # 1. Discover the API
7 plus_v1 = await aiogoogle.discover("plus", "v1")
8
9 # 2. Build the request
10 # Note: This is an unauthenticated request.
11 # For authenticated requests, you'd provide credentials to Aiogoogle()
12 request = plus_v1.activities.list(userId='+googleplus', collection='public')
13
14 # 3. Send the request
15 response = await aiogoogle.as_api_key(request)
16
17 print(response)
18
19if __name__ == "__main__":
20 asyncio.run(main())