I got the free edition api key from here:
https://developers.google.com/custom-search/v1/introduction/?apix=true
It goes in the “header”: “{\“Content-Type\“: \“application/json\“, \“Accept\“: \“application/json\“, \“User-Agent\“: \“My Custom Search Client/1.0\“, \“X-Goog-Api-Key\“: \“Your key\“}”
Created the custom search engine here:
https://programmablesearchengine.google.com/controlpanel/all
“url”: “https://www.googleapis.com/customsearch/v1?q=hello+world&cx= Your custom engine number"
There are other "&" options you can do.
I think a &num=100 will get you 100 search results. But not sure.
OK, here is the complete list of options for the custom search:
https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list
The docs says you can do 10,000 searches a day with the free key, they are serving ads through the searches. Don't take my word on that.
Oh, and it is a get, not a post.
This is my workflow to do the google searches:
I am working on a little function to fully form the google url with all the options built in and some unit testing.
No comments:
Post a Comment