API Key#

Need an API key?

If you still need an API key get in touch and let our solution engineers set you up with a free trial.

There are two options for configuring your API key. One involves setting a .env file on your computer which contains your API key:

Once this .env file has been set, this will enable your API key to be read from any script run in the subsequent directory tree.

echo "TWINLAB_API_KEY=<your_api_key>" > .env
echo TWINLAB_API_KEY=<your_api_key> > .env
echo "TWINLAB_API_KEY=<your_api_key>" > .env
echo "TWINLAB_API_KEY=<your_api_key>" > .env

Setting this function will enable you not to have to store your API key on your computer’s operating system.

import twinlab as tl

API_KEY = '<your_api_key>'

tl.set_api_key(API_KEY)

Warning

While we offer the flexibility to utilize the set_api_key() functionality, this should be used with care not to publicly expose your API key when sharing files.