I've added the AlchemyAPI service to my Python app on Bluemix. I can see the API key in the service credentials of the AlchemyAPI service. Where, in the app code or files should I specify this key so that I can call the service? The code runs fine and does everything except the part where I call AlchemyAPI.
I followed the Getting started tutorial here, but it just stops with "Get the key" and doesn't tell me what to do with it.
Some things that I tried but which did not work:
- Added an entry to the
manifest.yml
file, like this. Did not work.
services: - the_alchemy-service_name applications: - path: . env: ALCHEMY_KEY: the_actual_key
- In the app code, called the key before calling AlchemyAPI. Did not work.
VCAP_SERVICES = os.getenv('VCAP_SERVICES') key = (VCAP_SERVICES['alchemy_api'][0]['credentials']['apikey']) from alchemyapi import AlchemyAPI alchemyapi = AlchemyAPI()