Mohamed Khamis
Mohamed Khamis

Reputation: 8029

how to correct spelling mistakes in Google custom API

I am using Google's custom search API, I make an HTTP request to a URL that looks like this:

https://www.googleapis.com/customsearch/v1?key=<my-key>&cref=&num=10&q=how+can+i+do+htis

if you search for "how can i do htis" on Google you are told "Showing results for how can i do this", and give you some results (call them result set A)

but if you use the API to search for the misspelled string, you get different results than those of A... Searching with a correctly spelled string gives you result A, which matches the ordinary search service on Google

Is there a way to search directly using the suggested string? I want to use the API I can't afford implementing a spell checker myself that can also correct people names and everything

Upvotes: 7

Views: 3030

Answers (1)

jean-charles
jean-charles

Reputation: 21

I think what you want to do is possible using the spelling suggestions of Google. This is part of the xml-results returned by your query.

See API here.

Upvotes: 2

Related Questions