0

I am accessing Google Calendar API for holiday events in Pakistan. I want to get the holidays by selecting the year. But I am not able to find any solution in which i could send the year as a parameter in the API. The url that I am hitting to get the respective holidays is:

https://www.googleapis.com/calendar/v3/calendars/en.pk%23holiday%40group.v.calendar.google.com/events?key=AIzaSyCj39smrGYzOMLMDPwu5VJtaWZqHD234UM

Please help me out to search the holidays according to the given year where i can add an extra parameter like:

"&year=2016"

and get the relevant year's result.

Thanks.

Sufyan
  • 3
  • 3
  • 1
    Possible duplicate of [Get Calendar events between two dates](https://stackoverflow.com/questions/15516985/get-calendar-events-between-two-dates) – meskobalazs Feb 14 '18 at 12:43

1 Answers1

0

You can use the timeMin and timeMax datetime parameters to set the bounds of the query. With these parameters, you would only get the holidays from 2016:

timeMin: 2016-01-01T00:00:00Z
timeMax: 2017-01-01T00:00:00Z

Reference here: https://developers.google.com/google-apps/calendar/v3/reference/events/list

meskobalazs
  • 15,741
  • 2
  • 40
  • 63
  • I have tried this but it is not working. I added this to my URL but it is not showing me the desired result. https://www.googleapis.com/calendar/v3/calendars/en.pk%23holiday%40group.v.calendar.google.com/events?key=AIzaSyCj39smrGYzOMLMDPwu5VJtaWZqHD234UM&timeMin=2016-01-01T00:00:00Z&timeMax=2017-01-01T00:00:00Z – Sufyan Feb 14 '18 at 12:44
  • It seems that the calendar itself does not contain those dates. The `en.pk` starts from 2017, and e.g. `hu.hungarian` starts from 2014. – meskobalazs Feb 14 '18 at 13:07