Extract Entities API

Extract entities from a text. An entity is a word or a group of words that represent a concept. For example, the word "Canada" represents the concept of a country. The word "Jim Carrey" represents the concept of a person. The word "Tesla" represents the concept of a company. The API will return a list of entities found in the text. The entities are classified into different types such as person, location, organization, etc.

Supported entity types: PER, LOC, ORG

Type Code Example
Location LOC Ireland
Person PER Michael Jordan
Organization ORG Tesla

GET
https://api.apileague.com/extract-entities
Example Request and Response
GET
https://api.apileague.com/{{ examples.getExtractEntities }}
{
    "entities": [
        {
            "type": "PER",
            "value": "Jim Carrey",
            "start_position": 0,
            "end_position": 10,
            "image": "https://upload.wikimedia.org/wikipedia/commons/8/8b/Jim_Carrey_2008.jpg"
        },
        {
            "type": "LOC",
            "value": "Canada",
            "start_position": 28,
            "end_position": 34,
            "image": null
        }
    ]
}
cURL
Java
Javascript
Python
Go
C#
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}

Frequently Asked Questions

What types of entities can be extracted?

The API currently supports the extraction of Persons (PER), Locations (LOC), and Organizations (ORG).

Does it provide images for the entities?

Yes, if available, the API attempts to provide a relevant image URL for the extracted entities, particularly for famous people.

Can it handle multiple languages?

The API is primarily optimized for English text but may work with other languages depending on the context and entity names.

How is the Extract Entities API different from the Detect Sentiment API?

The Extract Entities API identifies specific people, places, and organizations in the text, while the Detect Sentiment API analyzes the overall emotional tone of the text.

Questions? Need Help? Ask Away