Read google custom search cse keys for more information.
“CX” parameter is mandatory and we get it after entering the domain name, so basically it is domain-specific. So now the question is how to get “CX” that would be global and valid for all of the domains.
Google Custom Search Engine (CSE) and Custom Search API (Key enabled from Cloud Developer Console) are different products. Since there is no built-in API with CSE engine, if users want to retrieve results using JSON API, they will need to use the API key (enabled from Cloud Developer Console) along with the CSE engine ID and query. The results will be served as per the CSE configuration.
Since results will be served as per the “SItes to search” configuration on CSE control panel, the CSE Search Engine ID i.e cx value is per CSE Engine and there is nothing as Global CSE Search Engine. This cx value (CSE Search Engine ID) has to be mentioned in the JSON API query and its unique value.
Build a fully customizable Search without any coding