Use Google Programmable Search Engine API to get results – integrated with my personal search tool

How to integrate Google search in the Shell command line.

Pocket Keyboard + iSH + Radar Search

API URL

https://www.googleapis.com/customsearch/v1?key={Your API key}&q={search keyword}&cx={Your CX}&start={1}&num={10}
Get API Key:https://console.cloud.google.com/apis/credentials
Get CX:https://programmablesearchengine.google.com/controlpanel/all
This is the search data returned in JSON format, it’s that simple.

GoogleAPI Programmable Search Engine JSON
Search Result in JSON format

API Reference:

https://developers.google.com/custom-search/v1/reference/rest/v1/Search

Integrated into my private search tool

op 11 means to open the link on line 11 in the default browser. s gg 2. means change to page 2.

Compare with regular search

Google Programmable Search on iPhone iSH Shell command line
Google Programmable Search on iPhone iSH Shell