Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 2.17 KB

File metadata and controls

50 lines (31 loc) · 2.17 KB

OpenCalais Entity Extraction

Overview

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.

Obtain an API Key

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).

Locate OpenCalais API Key

Copy the long string of characters next to Your Key.

Create environment variable

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.

Additional Resources