Skip to content

Instantly share code, notes, and snippets.

@guysoft
Created December 31, 2018 10:05
Show Gist options
  • Save guysoft/08415a6f4ae7c6e3d4ec23c05f268703 to your computer and use it in GitHub Desktop.
Save guysoft/08415a6f4ae7c6e3d4ec23c05f268703 to your computer and use it in GitHub Desktop.
Get google calendar reminder api
#!/usr/bin/env python3
## How to use
##
## 1. enter http://calendar.google.com/
## 2. press ctrl+alt+J in chrome to ender the developer tools and select the "network" tab. In firefox ctrl+shift+elif
## 3. refresh and make sure "reminders" is checked.
## 4. search for "reminder" in url filters and look for a url of the form: https://reminders-pa.clients6.google.com/v1internalOP/reminders/list?key=
## 5. Copy the key and the followind headers and cookies below:
## For mor info see: https://issuetracker.google.com/issues/36760283
SID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
HSID = 'xxxxxxxxxxxxxxxxx'
SSID = 'xxxxxxxxxxxxxxxxx'
APISID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
SAPISID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Authorization = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
import requests
cookies = {
'SID': SID,
'HSID': HSID,
'SSID': SSID,
'APISID': APISID,
'SAPISID': SAPISID,
}
headers = {
'Authorization': Authorization,
'Content-Type': 'application/json+protobuf',
'X-Origin': 'https://calendar.google.com',
}
params = (
('key', key),
)
response = requests.post('https://reminders-pa.clients6.google.com/v1internalOP/reminders/list', headers=headers, params=params, cookies=cookies)
data = response.json()
for reminder in data["1"]:
print(reminder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment