Querying calendar events via the Google Calendar API
<p>Do you want to pull all meetings & events from <strong>your or any shared Google calendar</strong> via the Google calendar API in Python? This blogpost provides step-for-step instructions on how to setup <strong>authentication</strong>, <strong>request calendar events</strong> and handle the <strong>pagination token</strong>. For the full code, check the <a href="https://github.com/chrieke/calendar-insights/blob/main/query_google_calendar_api.ipynb" rel="noopener ugc nofollow" target="_blank">calendar-insights repository</a>.</p>
<p><img alt="" src="https://miro.medium.com/v2/resize:fit:700/1*Hxj5GCeOlILo0uxUf4JXfw.jpeg" style="height:468px; width:700px" /></p>
<h2><strong>Setup Google Calendar API</strong></h2>
<p>First we need to <strong>activate the </strong><a href="https://developers.google.com/calendar/api/guides/overview" rel="noopener ugc nofollow" target="_blank"><strong>Google Calendar API</strong></a><strong> for a Google cloud project</strong> of our choice. Use an existing project or create a new one: At the top of the <a href="https://console.cloud.google.com/" rel="noopener ugc nofollow" target="_blank">Google Cloud Console dashboard</a>, click on the project selection and “New Project”, enter a name e.g. “calendar-insights” and click “Create”. Then, in the <a href="https://console.developers.google.com/" rel="noopener ugc nofollow" target="_blank">Google API dashboard</a>, click <em>Enable APIs and services</em>. Search for the Google Calendar API and click <em>Enable</em>.</p>
<p>Next, to enable API queries from our local computer, we need to create and <strong>download authentication credentials</strong> for that project. In the <a href="https://console.cloud.google.com/apis/credentials" rel="noopener ugc nofollow" target="_blank">Credentials section</a> of the API dashboard, click <em>Create Credentials</em> and <em>OAuth Client ID. </em>Select Application type “Desktop app”. Then click “Download JSON” and store the credentials file on your local PC.</p>
<p><a href="https://chrieke.medium.com/querying-calendar-events-via-the-google-calendar-api-771782e24f62"><strong>Read More</strong></a></p>