Make suggestions for misspelled queries
Categories
- 322 All Categories
- 3 Language datasets
- 9 News and updates
- 18 API endpoints
- 15 Review my code
- 6 Tutorials and presentations
- 92 Frequently asked questions
- 5 How to get useful technical help
- 2 Member guidelines
- 12 Suggest an improvement
- 58 Report a bug
- 9 Ask the Community: Other
- 54 Ask the Community: Technical and operational questions
- 61 General
Make suggestions for misspelled queries

Python has a library "from difflib import get_close_matches" that will return a weighted list of words that in some way match the word entered. This is useful to suggest to the user the correct spelling for a query. Is there some way to do this through the API? I had thought of extracting a word list but realized that the size of the list would be prohibitive.
Tagged:
Best Answer
-
AmosDuveen Member, Administrator, Moderator admin
Hi @JackHomeyer,
The 'search' endpoint would certainly help. It has been provided specifically to help with fuzzy matching. You can have a play on our documentation page without racking up any extra hits on your account.
Answers
Could I use the "Search" Endpoint for this? When can I find a example of "Search"?
Hi @JackHomeyer, interesting point that you raised. Let me contact a colleague who knows more about getting data from the API, so you can get a useful answer.
Hi @JackHomeyer,
Yes. If you go to the 'search' endpoint of our documentation page, it shows you the allowable filters, including 'q' (the serach string) and lets you place a call (using the 'try it out' button) to see what the results look like.
As an example, I used the deliberately ambiguous 'runing' ('rune' is not commonly used as a verb, and it could also be a likely misspelling of 'running' or 'ruining'). You can see for yourself that it throws up all sorts of suggestions ( I only included the first 6 of 198, for brevity).
`{
"results": [
{
"id": "runnable",
"matchString": "runing",
"region": "gb",
"matchType": "headword",
"word": "runnable"
},
{
"id": "runnability",
"matchString": "runing",
"region": "gb",
"matchType": "headword",
"word": "runnability"
},
{
"id": "runically",
"matchString": "runing",
"region": "gb",
"matchType": "headword",
"word": "runically"
},
{
"id": "runed",
"matchString": "runing",
"region": "gb",
"matchType": "headword",
"word": "runed"
},
{
"id": "run",
"matchString": "runing",
"region": "gb",
"matchType": "headword",
"word": "run"
},
{
"id": "poker_run",
"matchString": "runing",
"region": "gb",
"matchType": "headword",
"word": "poker run"
},
...
],
"metadata": {
"sourceLanguage": "en",
"limit": 5000,
"total": 198,
"provider": "Oxford University Press",
"offset": 0
}
}`