Programatically Create Custom Search Engine

The Custom Search API used to let you skip the CSE Control Panel altogether and use a client application of your choice to retrieve a list of custom search engines under an account, create and delete custom search engines, and retrieve code for a search box, among other things.

You can use any programming language that lets you issue HTTP requests and parse XML-based responses.

The process of programmatically creating search engines involves the following steps: * Create the custom search engine specification or context XML. To learn more, see Context: Defining a Search Engine. * Create the annotations XML to let Custom Search know which sites to search or ignore, and how to rank the search results. To learn more, see Annotations: Selecting Sites. * Get the authentication token from the Account Authentication API. To learn more, see Authentication. Submit the context XML by sending an authenticated request to the Custom Search server. To learn more, see Creating and Updating the Search Engine Specification. * Send another authenticated request to the Custom Search server to submit the annotations XML. To learn more, see Creating and Updating Annotations.