apyhub
ARTIFICIAL INTELLIGENCE

Extract Named Entities from Text API

What it does

Named Entity Extraction identifies people, organisations, locations, and miscellaneous entities in text, and returns each match with character offsets.

Send a text string in the request body, and you get the original text back along with an entities array. Each entity includes the extracted word, its type (PER, ORG, LOC, or MISC), start and end offsets, and a confidence score. The input text is limited to 512 tokens, so it is designed for short passages, snippets, and document segments rather than full-length files.

Use Named Entity Extraction when you need to index articles, route support tickets, enrich content metadata, or prepare text for downstream NLP steps. The offsets make it easier to highlight entities in a UI, map results back to source text, or combine extraction with other text-processing logic.

This endpoint is a good fit for applications that need lightweight entity recognition without building and maintaining their own NLP pipeline.

POST
Extract named entities — persons, locations, organisations, and misc — with character offsets
http://localhost:8080/dosvak/extract-named-entities
QUICKSTARTGUIDE

Quickstart

Send a piece of text to extract named entities from it.

curl -X POST "http://localhost:8080/dosvak/extract-named-entities" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text":"Barack Obama visited Microsoft in Seattle."}'

What you'll get back

Returns a JSON object with text as a string and entities as an array of entity objects.

Each entity object can include start and end integer offsets, type (PER, ORG, LOC, or MISC), word as the extracted text, and score as a number.

{
  "text": "Barack Obama visited Microsoft in Seattle.",
  "entities": [
    {
      "start": 0,
      "end": 12,
      "type": "PER",
      "word": "Barack Obama",
      "score": 0.99
    }
  ]
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Input text (truncated to 512 tokens)

About this endpoint

What it does

Extracts named entities from the input text and returns the original text along with a list of detected entities, including their character offsets, type, surface form, and score.

Request Body

ParameterTypeMandatoryDescription
textStringYesInput text. Maximum length: 512 characters. Truncated to 512 tokens.

Response

Returns a JSON object with a text string field and an entities array field. Each item in entities is an object containing the detected entity’s offsets, label, text, and score.

ParameterTypeMandatoryDescription
textStringNoThe input text as returned by the service.
entitiesObject ArrayNoThe detected entities. Each item includes start, end, type, word, and score.
entities[].endIntegerNoEnd offset of the entity in the text.
entities[].typeENUMNoEntity label. Allowed values: PER, ORG, LOC, MISC.
entities[].wordStringNoThe extracted entity text.
entities[].scoreNumberNoConfidence score for the entity.
entities[].startIntegerNoStart offset of the entity in the text.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.