this-word-does-not-exist icon indicating copy to clipboard operation
this-word-does-not-exist copied to clipboard

Public api

Open duncte123 opened this issue 4 years ago • 12 comments

I was wondering if it was possible for thisworddoesnotexist.com to have an API that other developers can use so they don't have to set this project up themselves

duncte123 avatar May 18 '20 20:05 duncte123

It's definitely possible, but hosting costs can be pretty expensive for inference queries. @duncte123 can you tell me a bit more about your use case?

turtlesoupy avatar May 18 '20 20:05 turtlesoupy

Of course I can, my use case would be a command on a discord bot that displays the words and mimics the formatting on the website. This could be achieved by web-scraping but an api is just easier to work with.

duncte123 avatar May 19 '20 05:05 duncte123

@duncte123 sweet, that's very cachable. I cached 100,000 words for the website in this file: https://github.com/turtlesoupy/this-word-does-not-exist/blob/master/website/data/words.json.gz

The JSON format should be pretty obvious once unzipping. Maybe load it in and start from there?

turtlesoupy avatar May 19 '20 05:05 turtlesoupy

That json is definitely workable, the only thing that I'm missing in the data are the permalinks for linking back to the site

duncte123 avatar May 19 '20 06:05 duncte123

Ah okay, that’s a little tricker. How about I throw up a JSON endpoint. One sec

-Thomas

On Mon, May 18, 2020 at 11:50 PM Duncan Sterken [email protected] wrote:

That json is definitely workable, the only thing that I'm missing in the data are the hashes for linking back to the site

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/turtlesoupy/this-word-does-not-exist/issues/34#issuecomment-630620684, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADNQTVBRGI7VXFDQZBYSGLRSIT3FANCNFSM4NEMY53A .

turtlesoupy avatar May 19 '20 07:05 turtlesoupy

@duncte123 try https://www.thisworddoesnotexist.com/api/random_word.json

I reserve the right to add a mandatory API key in the future!

turtlesoupy avatar May 19 '20 07:05 turtlesoupy

@duncte123 try https://www.thisworddoesnotexist.com/api/random_word.json

I reserve the right to add a mandatory API key in the future!

Thank you so much, I'll make sure to sign up for the API key if it ever becomes required

duncte123 avatar May 19 '20 07:05 duncte123

nice API @turtlesoupy what about to include a query function that allows to ask for 8 characters lenght words? e.g

desegura avatar May 19 '20 15:05 desegura

@desegura can you describe your use case as well? Generating from scratch is quite expensive unless it’s in a cache

turtlesoupy avatar May 19 '20 16:05 turtlesoupy

imagine this call: "https://www.thisworddoesnotexist.com/?len=7" returning: "zupital" e.g

I mean a way to stablish the length of the word

desegura avatar May 19 '20 19:05 desegura

I know it will be expensive but very usefull

desegura avatar Jun 02 '20 09:06 desegura

Would there be a way to send an API request to define a specific word, analogous to the website's "Write your own" feature?

CreativityTheEmotion avatar Apr 04 '22 13:04 CreativityTheEmotion