An Introduction to google web API web service, using Visual Basic dot Net
- Start VS.Net IDE
- Create a ASP.Net Web Application.
- Right Click on the Solution Explorer and Select Add Web Reference
Or Project > Add Web Reference. - It Shows an Add Web Reference dialog.
- Enter the WSDL path to the URL textbox (“http://api.google.com/GoogleSearch.wsdl”)
- Click on the Add Reference button to add web reference to project.
- Put a Textbox, a Button on the form.
- Following code in the button click.
'Create an instance of google Search Service, returns GoogleSearchResult
Dim _google As New com.google.api.GoogleSearchService
'Create an instance of GoogleSearchResult, to get the search results.
Dim _result As New com.google.api.GoogleSearchResult
Try
'Check API Reference for more details.,Key - Unique key, from google.
_result = doGoogleSearch("key" ,Textbox1.text,0,10, true, "", true, "","","")
'Writing the number of Results found and time required to get the results in seconds.
Response.Write(_result.estimatedTotalResultsCount & " In " & _result.searchTime & " seconds")
Catch ex as Exception
throw ex
Finally
_result = nothing
_google = nothing
End Try
You can get the key from google on request, you need a google account for this.
Here is only a small intro to the google APIs you can impliment a search engine in your site using this.
For more details visit Google API Home Page
This code is in ASP.Net 1.1.