Skip to content

Instantly share code, notes, and snippets.

@ricrogz
Created December 23, 2016 15:45
Show Gist options
  • Save ricrogz/bef9042e1e4928f8b9cda720cac72b53 to your computer and use it in GitHub Desktop.
Save ricrogz/bef9042e1e4928f8b9cda720cac72b53 to your computer and use it in GitHub Desktop.
Google Custom Search JSON API example
# coding: utf-8
api = "api_key"
search_id = "search_id_code"
query = "query words"
url="https://www.googleapis.com/customsearch/v1?key={}&cx={}&q={{}}&fields=items(link)&dateRestrict=y2&start=11".format(api, search_id);
a = requests.get(url.format(query)); print(a.status_code); a.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment