Getting 404s

24 views
Skip to first unread message

Edward Banner

unread,
Aug 2, 2024, 9:16:51 AM8/2/24
to Wordnik API
Hello 👋

I am trying to get a random 5 letter word. I was running into the same issue mentioned here with not real words so I added minCorpusCount=10000 and minDictionaryCount=20 as suggested there.

Now I'm getting some real words, but only in like every 1 out of 10 calls. The other 9 calls I'm getting a {'statusCode': 404, 'error': 'Not Found', 'message': 'Not Found'} response.

Any suggestions for how I could modify my query to get real words and avoid the 404s?

This is my current query for context:

minLength=5&maxLength=5&minCorpusCount=10000&minDictionaryCount=20

Erin McKean

unread,
Aug 2, 2024, 11:08:39 AM8/2/24
to wordn...@googlegroups.com
Hi Edward!

Thanks for using the Wordnik API! We recently made some tweaks to the random word endpoint to reduce the number of less-wordlike words being returned, so now the minDictionaryCount=20 parameter is probably too high, which is resulting in more 404s. I would tweak the minCorpusCount and minDictionaryCount downward until you start seeing more hits.

We're working on an update that should improve our sampling process; if you want access to the beta when it's released you can sign up for our beta API testers list here: http://eepurl.com/bPCg0D.

I hope this helps!

Erin
---------------------
Erin McKean
Wordnik
@emc...@xoxo.zone/@wor...@wordnik.social
Wordnik is a 501(c)3 nonprofit organization
The Wordnik mission: every English word, available to everyone, everywhere

--
You received this message because you are subscribed to the Google Groups "Wordnik API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wordnik-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wordnik-api/919fb6d4-1e5f-4a6f-b658-5d57b4a9275dn%40googlegroups.com.

Edward Banner

unread,
Aug 2, 2024, 1:55:59 PM8/2/24
to Wordnik API
Thanks, I'll try it out!

I'm not sure I understand the 404s though... is it basically a bug? My expectation is the endpoint should never 404, as long as there is at least one word which matches the criteria.

Erin McKean

unread,
Aug 2, 2024, 2:06:12 PM8/2/24
to wordn...@googlegroups.com
Yep, your understanding is not wrong! Unfortunately, the datastore we're using for this is just not really optimized for random sampling over a dataset as large as ours, which is why we're working to update this API. We had to make a tradeoff between making the call more performant (faster responses and cheaper for us to run) vs. making it have better recall for filtered queries. :(

We do have a working prototype of the new endpoint but we have to do a bit more stress-testing before the beta release, as it's one of our most-used endpoints.

Thanks again!

Erin

Reply all
Reply to author
Forward
0 new messages