Wornik API fails on python

15 views
Skip to first unread message

Ozgur Ozkan

unread,
Apr 28, 2024, 9:55:31 PMApr 28
to Wordnik API
Hello,

Currently Wordnik API fails on python:

>>> r = Wordnik()

>>> randomWord = r.get_random_word()

Retry, exception: list indices must be integers or slices, not str

Retry, exception: list indices must be integers or slices, not str

Retry, exception: list indices must be integers or slices, not str

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/ozgur/.pyenv/versions/3.11.3/lib/python3.11/site-packages/random_word/utils/retry_generator.py", line 25, in fn

    raise exception

  File "/Users/ozgur/.pyenv/versions/3.11.3/lib/python3.11/site-packages/random_word/utils/retry_generator.py", line 20, in fn

    return f(*args, **kwargs)

           ^^^^^^^^^^^^^^^^^^

  File "/Users/ozgur/.pyenv/versions/3.11.3/lib/python3.11/site-packages/random_word/services/wordnik.py", line 75, in get_random_word

    return result["word"]

           ~~~~~~^^^^^^^^

TypeError: list indices must be integers or slices, not str

>>> 


Even with paid API key pro account!


Ozgur Ozkan

unread,
Apr 28, 2024, 9:56:01 PMApr 28
to Wordnik API
It affects production. Please have a look! Thank you.

Erin McKean

unread,
Apr 30, 2024, 12:50:02 AMApr 30
to wordn...@googlegroups.com
Hi Ozgur, I just answered your other email -- we're doing a database migration this weekend and we had to make some changes to the randomWord endpoint. We thought we hadn't broken anything but I'm happy to take a look at a longer code sample if that will help!

Thanks!

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/8c5b625f-0860-4b33-869c-7f270ede4c33n%40googlegroups.com.

Erin McKean

unread,
Apr 30, 2024, 12:50:06 AMApr 30
to wordn...@googlegroups.com
Hi Ozgur, it should be working now; please let me know if not!

Thanks for using Wordnik!

Yours,

Erin
Reply all
Reply to author
Forward
0 new messages