I am writing a desktop app using PyQt5 which uses the Wordnik API to get word definitions. I do not have server-side access, nor do I wish to invest in acquiring it. Is there any way I can reliably hide my key so I can share my program on GitHub?
-
Sadly no, the meaning of no server is having it all hosted on the client side which means no matter how "well" you hide it, the information can be accessed. however adding a server side shoudn't be hard as it requires just a single route. – Tom Slabbaert Aug 04 '19 at 14:38
2 Answers
At the very least you could store your API key in a separate source file (which you would exclude from the repository via .gitignore
) and check for exceptions while importing that file (see this), alerting to provide own API key if that fails.
Storing the API key in a non-source configuration file is another option, but then your worries are in storing that file in a way that is not accessible to the end user of your application.

- 2,967
- 1
- 16
- 24
Unfortunately, no, our Wordnik terms of service don't allow for sharing keys where they are accessible by end-users. If your app is noncommercial you can share instructions for users to help them apply for and add their own Wordnik keys to their copy of the application (and this also helps you, in that your key won't hit our API limits based on your users).
If this is a commercial application, please get in touch with us (apiteam@wordnik) with more details about your use case as we are looking into how to make this easier. As a small nonprofit with limited engineering resources we can't promise a quick solution but since our mission is to find & share every English word we're always interested in learning more about how folks are using our API. :)
Thanks for using Wordnik!

- 368
- 4
- 15