The Python script in this directory demonstrates how to call the OpenCalais API to perform entity extraction. The example uses a paragraph of text from an FDA medical device recall announcement.
Before using this code, you must register for an API key.
Once you've registered for an API key, log in to your new Reuters/Refinitiv account at https://permid.org/.
Once you're logged in, you can obtain your API key by clicking on the "APIs" link in the upper right. Then click on the big green "Display my API token" button (shown below).
Copy the long string of characters next to Your Key
.
Next, create the below shell environment variable by exporting it in ~/.bash_profile
and substituting your API key:
Linux users should add the export to to
~/.bashrc
# ~/.bash_profile
export OPENCALAIS_API_KEY="YOUR_API_KEY"
You can now look up the API key in Python code using os.environ['OPENCALAIS_API_KEY']
, as demonstrated in this example script.