3

I am looking for a program (Windows 7), Google Chrome extension, or script that can look at my Google Calendar and generate a list of time slots when I am available for the next X days, e.g. :

  • Monday, April 13 from 10 AM to 1 PM
  • Monday, April 13 any time after 3 PM
  • Tuesday, April 14 any time after 1 PM
  • Wednesday, April 15 from 10 AM to 1 PM
  • Wednesday, April 15 any time after 3 PM
  • Friday, April 17 any time after 11:30 AM
  • Monday, April 20 from 10 AM to 1 PM
  • Monday, April 20 any time after 3 PM
  • Tuesday, April 21 any time after 1 PM
  • Wednesday, April 22 from 10 AM to 1 PM
  • Wednesday, April 22 any time after 3 PM
  • Friday, April 24 any time after 11:30 AM
  • etc.
3

With python plus the Google Calendar API you can use the calendar.freebusy.query method. This can also be used from Google App Engine and you can find more information here.

This returns returns: An object of the form:

{
"timeMax": "A String", # The end of the interval.
"kind": "calendar#freeBusy", # Type of the resource ("calendar#freeBusy").
"calendars": { # List of free/busy information for calendars.
  "a_key": { # Free/busy expansions for a single calendar.
    "busy": [ # List of time ranges during which this calendar should be regarded as busy.
      {
        "start": "A String", # The (inclusive) start of the time period.
        "end": "A String", # The (exclusive) end of the time period.
      },
    ],
    "errors": [ # Optional error(s) (if computation for the calendar failed).
      {
        "domain": "A String", # Domain, or broad category, of the error.
        "reason": "A String", # Specific reason for the error. Some of the possible values are:
            # - "groupTooBig" - The group of users requested is too large for a single query.
            # - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query.
            # - "notFound" - The requested resource was not found.
            # - "internalError" - The API service has encountered an internal error.  Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list.
      },
    ],
  },
},
"groups": { # Expansion of groups.
  "a_key": { # List of calendars that are members of this group.
    "errors": [ # Optional error(s) (if computation for the group failed).
      {
        "domain": "A String", # Domain, or broad category, of the error.
        "reason": "A String", # Specific reason for the error. Some of the possible values are:
            # - "groupTooBig" - The group of users requested is too large for a single query.
            # - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query.
            # - "notFound" - The requested resource was not found.
            # - "internalError" - The API service has encountered an internal error.  Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list.
      },
    ],
    "calendars": [ # List of calendars' identifiers within a group.
      "A String",
    ],
  },
},
"timeMin": "A String", # The start of the interval.

}

This should be simple to use to generate what you need.

You can have a play in the API Explorer just remember to turn on the OAuth switch.

Note that minimum parameters are:

{ "timeMin":"2015-01-01T00:00:00Z" "timeMax":"2015-02-01T00:00:00Z" }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.