Get all patches with critical of security in name

I am looking for a way to automatically grab all security and critical patches. Ideally I would like to grab all patches for a certain OS and add them to the baseline automatically. I believe you can do this using the API, my setup is as follows:

Custom Site -

WinPWSTeam - Custom Patch Site

Baselines -

windows 2003
windows 2008
windows 2008R2
Windows 2012
Windows 2012R2
Windows 7

So I would like to grab all Windows 2012R2 security and Critical patches for both windows and Office and then add them to the corresponding baseline in the site.

How would I accomplish this task? Any help would be greatly appreciated.

Hope below link will be helpful to you.