Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public api #34

Open
duncte123 opened this issue May 18, 2020 · 12 comments
Open

Public api #34

duncte123 opened this issue May 18, 2020 · 12 comments

Comments

@duncte123
Copy link

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

@turtlesoupy
Copy link
Owner

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?

@duncte123
Copy link
Author

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.

@turtlesoupy
Copy link
Owner

@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?

@duncte123
Copy link
Author

duncte123 commented May 19, 2020

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

@turtlesoupy
Copy link
Owner

turtlesoupy commented May 19, 2020 via email

@turtlesoupy
Copy link
Owner

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

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

@duncte123
Copy link
Author

@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

@desegura
Copy link

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

@turtlesoupy
Copy link
Owner

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

@desegura
Copy link

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
Copy link

desegura commented Jun 2, 2020

I know it will be expensive but very usefull

@CreativityTheEmotion
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants