Steps for using Google custom search API in .NET
I am trying to use Google custom search API in my .NET project. I have an API Key provided by my company. I have created a custom search engine using my Google account and copied the 'cx' value. I am using the following code: string apiKey = "My company Key"; string cx = "Cx"; string query = tbSearch.Text; WebClient webClient = new WebClient(); webClient.Headers.Add("user-agent", "Only a test!"); string result = webClient.DownloadString(String.Format("https://www.googleapis.com/customsearch/v1?key={0}&cx={1}&q={2}&alt=json", apiKey, cx, query)); I am getting the following error: "The remote