def google_search(search_term, cse_id, **kwargs):
    service = build('customsearch', 'v1', developerKey=dev_key)
res = service.cse().list(q=search_term, cx=cse_id, **kwargs).execute()
How to query an advanced search with google customsearch API?