Getting Google app info from command line

I’m looking for a way to get info from google apps like calendar and gmail from a command line. I found gcalcli for calendar, but i cant figure out how to get info like total events today and total events in the next 5 days. I can get it to show a calendar, an agenda and a week view but I have no idea how to get total events in a day.

I’m looking to use this info to customize polybar to show the number of upcoming events. I plan to do something similar with Gmail notifications so I can see the important details straight from the status bar.