---
title: "Extract named entities from a phrase"
method: POST
path: "/api/v1/predict-entities"
tags: ["NamedEntityRecognition"]
---

# Extract named entities from a phrase

`POST /api/v1/predict-entities`

Extracts named entities from a phrase. If no entities can be found, it returns an empty collection of entities. Each entity contains one or more (ambiguous) interpretations. Each recognized entity will most likely contain only one possible interpretation. 

You can limit the named entities to search for by explicitly providing the entity types. If no types are specified upfront, all entity types will be extracted and returned if possible. 

If no language is specified upfront, the Named Entity Recognition API will try to infer it automatically before proceeding with named entity recognition. An inferred or pre-specified language that is not supported will yield an error.

## Request body

- V1PredictEntitiesRequest — A request for predicting the entities from a given phrase. This process is also referred to as named entity recognition. It is possible to pre-specify the language when calling this endpoint. Otherwise, the Named Entity Recognition API will attempt to infer the language and proceed with extraction of the entities. If no entities could be found, it will return an empty collection.
  - `phrase` string — The phrase to extract named entities from.
  - `language` 'LANGUAGE_INVALID' | 'LANGUAGE_UNDETERMINED' | 'ENG' | 'RUS' | 'DEU' | 'FRA' | 'ITA' | 'JPN' | 'SPA' | 'CEB' | 'TUR' | 'POR' | 'UKR' | 'EPO' | 'POL' | 'SWE' | 'NLD' | 'HEB' | 'ZHO' | 'HUN' | 'ARA' | 'CAT' | 'FIN' | 'CES' | 'FAS' | 'SRP' | 'ELL' | 'VIE' | 'BUL' | 'KOR' | 'NOR' | 'MKD' | 'RON' | 'IND' | 'THA' | 'HYE' | 'DAN' | 'TAM' | 'HIN' | 'HRV' | 'HBS' | 'BEL' | 'KAT' | 'TEL' | 'KAZ' | 'WAR' | 'LIT' | 'GLG' | 'SLK' | 'BEN' | 'EUS' | 'SLV' | 'KAN' | 'MAL' | 'MAR' | 'EST' | 'AZE' | 'MSA' | 'SQI' | 'LAT' | 'BOS' | 'NNO' | 'URD' | 'LAV' | 'MYA' | 'TAT' | 'AFR' | 'OCI' | 'NDS' | 'KIR' | 'AST' | 'TGL' | 'ISL' | 'INA' | 'SIN' | 'GUJ' | 'KHM' | 'BRE' | 'BAK' | 'UZB' | 'BOD' | 'PAN' | 'VOL' | 'ALS' | 'NEP' | 'CYM' | 'JBO' | 'FRY' | 'MON' | 'LTZ' | 'CHE' | 'UIG' | 'TGK' | 'SCO' | 'SAN' | 'CHV' | 'JAV' | 'MIN' | 'IDO' | 'ORI' | 'ASM' | 'NEW' | 'GLE' | 'MLG' | 'ARG' | 'CKB' | 'SWA' | 'BAR' | 'LMO' | 'YID' | 'ARZ' | 'MHR' | 'AZB' | 'SAH' | 'PNB' | 'SUN' | 'BPY' | 'PMS' | 'ILO' | 'WUU' | 'KUR' | 'PUS' | 'ILE' | 'XMF' | 'YUE' | 'GOM' | 'LIM' | 'MWL' | 'COR' | 'SND' | 'HSB' | 'SCN' | 'GLA' | 'PAM' | 'BHO' | 'MAI' | 'VEC' | 'MLT' | 'DIV' | 'WLN' | 'MZN' | 'AMH' | 'QUE' | 'CBK' | 'TUK' | 'ROH' | 'OSS' | 'VLS' | 'YOR' | 'LAO' | 'LEZ' | 'SOM' | 'MYV' | 'DIQ' | 'MRJ' | 'DSB' | 'FRR' | 'HAT' | 'GRN' | 'BXR' | 'KOM' | 'SRD' | 'KRC' | 'BCL' | 'NAP' | 'GLV' | 'AVA' | 'RUE' | 'XAL' | 'PFL' | 'DTY' | 'HIF' | 'COS' | 'LRC' | 'VEP' | 'TYV' | 'NOB' | 'SNA' | 'KIN' | 'IBO' | 'SMO' | 'SOT' | 'MRI' | 'WOL' | 'XHO' | 'HAU' | 'HAW' | 'NYA' | 'ZUL' | 'HMN' — Language code in ISO639-3 format. More info can be found here: https://iso639-3.sil.org/code_tables/639/data.
  - `entityTypes` V1EntityType[] — A collection of entity types that can be detected. If empty, all found types are returned.
  - `timezone` string — The name of the timezone the samples should be detected in. For time or date related entities this ensures that the values are converted to the correct timezone. For an overview of available timezones see [this list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

## Response `200`

A successful response.

- V1PredictEntitiesResponse — Response payload that is returned when predicting entities. Contains an empty list when no entities could be found.
  - `entities` V1Entity[] — The collection of entities that were extracted from the given phrase. The collection is empty if no entities could be found.
    - `text` string — The raw text from the phrase where the entity was found.
    - `type` 'UNKNOWN' | 'AMOUNT_OF_MONEY' | 'CREDIT_CARD_NUMBER' | 'DISTANCE' | 'DURATION' | 'EMAIL' | 'NUMERAL' | 'ORDINAL' | 'PHONE_NUMBER' | 'PRODUCT_QUANTITY' | 'TEMPERATURE' | 'TIME' | 'URL' | 'VOLUME' | 'INTERVAL' | 'PERSON' | 'ORGANISATION' | 'PRODUCT' | 'PLACE' | 'COUNTRY' — Type of entity.
    - `ambiguous` boolean — Describes if the parsed value has multiple possible values. For example `tomorrow at 7` could either mean `tomorrow 07:00` or `tomorrow 19:00`.
    - `startCharIndex` string, uint64 — The starting character index of the entity in the given phrase.
    - `endCharIndex` string, uint64 — The ending character index of the entity in the given phrase.
    - `entityValues` V1EntityValuesWrapper[] — The collection of entity values. If the entity is ambiguous (see `ambiguous`), this collection will contain more than one value. For example `tomorrow at 7` could either mean `tomorrow 07:00` or `tomorrow 19:00`.
      - `amountOfMoney` V1AmountOfMoneyValue — An amount of money expressed in whole units, cents and a currency.
        - `units` string, uint64 — The whole units of money. If the entity is `$3.05`, then `units` is `3`.
        - `cents` integer — The number of cents. If the entity is `$3.05`, then `cents` is `5`.
        - `currencyCode` V1CurrencyCodeIso4217Value — A wrapper for the currency code enum.
          - `value` 'INVALID_CURRENCY_CODE' | 'ADP' | 'AED' | 'AFA' | 'AFN' | 'ALK' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'AOK' | 'AON' | 'AOR' | 'ARA' | 'ARP' | 'ARS' | 'ARY' | 'ATS' | 'AUD' | 'AWG' | 'AYM' | 'AZM' | 'AZN' | 'BAD' | 'BAM' | 'BBD' | 'BDT' | 'BEC' | 'BEF' | 'BEL' | 'BGJ' | 'BGK' | 'BGL' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOP' | 'BOV' | 'BRB' | 'BRC' | 'BRE' | 'BRL' | 'BRN' | 'BRR' | 'BSD' | 'BTN' | 'BUK' | 'BWP' | 'BYB' | 'BYN' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHC' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CSD' | 'CSJ' | 'CSK' | 'CUC' | 'CUP' | 'CVE' | 'CYP' | 'CZK' | 'DDM' | 'DEM' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'ECS' | 'ECV' | 'EEK' | 'EGP' | 'ERN' | 'ESA' | 'ESB' | 'ESP' | 'ETB' | 'EUR' | 'FIM' | 'FJD' | 'FKP' | 'FRF' | 'GBP' | 'GEK' | 'GEL' | 'GHC' | 'GHP' | 'GHS' | 'GIP' | 'GMD' | 'GNE' | 'GNF' | 'GNS' | 'GQE' | 'GRD' | 'GTQ' | 'GWE' | 'GWP' | 'GYD' | 'HKD' | 'HNL' | 'HRD' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'IEP' | 'ILP' | 'ILR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISJ' | 'ISK' | 'ITL' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAJ' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LSM' | 'LTL' | 'LTT' | 'LUC' | 'LUF' | 'LUL' | 'LVL' | 'LVR' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MGF' | 'MKD' | 'MLF' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MTL' | 'MTP' | 'MUR' | 'MVQ' | 'MVR' | 'MWK' | 'MXN' | 'MXP' | 'MXV' | 'MYR' | 'MZE' | 'MZM' | 'MZN' | 'NAD' | 'NGN' | 'NIC' | 'NIO' | 'NLG' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEH' | 'PEI' | 'PEN' | 'PES' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PLZ' | 'PTE' | 'PYG' | 'QAR' | 'RHD' | 'ROK' | 'ROL' | 'RON' | 'RSD' | 'RUB' | 'RUR' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDD' | 'SDG' | 'SDP' | 'SEK' | 'SGD' | 'SHP' | 'SIT' | 'SKK' | 'SLL' | 'SOS' | 'SRD' | 'SRG' | 'SSP' | 'STD' | 'SUR' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJR' | 'TJS' | 'TMM' | 'TMT' | 'TND' | 'TOP' | 'TPE' | 'TRL' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UAK' | 'UGS' | 'UGW' | 'UGX' | 'USD' | 'USN' | 'USS' | 'UYI' | 'UYN' | 'UYP' | 'UYU' | 'UZS' | 'VEB' | 'VEF' | 'VNC' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XEU' | 'XFO' | 'XFU' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XRE' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YDD' | 'YER' | 'YUD' | 'YUM' | 'YUN' | 'ZAL' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZRN' | 'ZRZ' | 'ZWC' | 'ZWD' | 'ZWL' | 'ZWN' | 'ZWR' — The [ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html).
        - `currencyName` string — The name of the currency. Some currency names are not ISO4217 compliant. For those cases, this will hold the currency as a string. These include `"Cent"`, `"Dinar"`, `"Dollar"`, `"Rial"`, `"Riyal"`, `"Pound"`, `"PTS"`.
      - `creditCardNumber` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `distance` V1UnitValues — An amount and a unit of the amount.
        - `unit` string — The unit describing the amount.
      - `duration` V1DurationValues — A duration and the unit of the duration. Durations are normalized to whole seconds.
        - `value` string — The part of the phrase that expresses a duration.
        - `unit` string — The unit used to indicate the duration.
        - `seconds` string, uint64 — The duration normalized to seconds.
      - `emailAddress` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `numeral` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `ordinal` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `phoneNumber` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `productQuantity` V1ProductQuantityValue — A quantity of a product using a certain unit. Example use-cases are parsing of cooking recipes and shopping.
        - `value` string — The amount of the unit.
        - `unit` string — The unit describing the amount.
        - `product` string — The extracted product.
      - `temperature` V1UnitValues — An amount and a unit of the amount.
        - `unit` string — The unit describing the amount.
      - `time` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `url` V1UrlValues — A URL and its domain.
        - `value` string — The extracted url.
        - `domain` string — The domain of the url.
      - `volume` V1UnitValues — An amount and a unit of the amount.
        - `unit` string — The unit describing the amount.
      - `interval` V1IntervalValues — A start time and an end time of an interval.
        - `start` string — The normalized start date in ISO8601 date format.
        - `end` string — The normalized end date in ISO8601 date format.
      - `person` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `organization` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `product` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `place` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.
      - `country` V1DefaultValues — A normalized value of an entity, e.g. for time the ISO8601 date format.
        - `value` string — The normalized value of an entity, e.g. for time the ISO8601 date format.

## Other responses

- `401` — Returned when the user is not authorized.
- `404` — Returned when the resource does not exist.
- `default` — An unexpected error response.

---

[API](https://skmtc.dev/messagebird/apis/namedentityrecognition.md) · [All operations](https://skmtc.dev/messagebird/apis/namedentityrecognition/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/messagebird/namedentityrecognition/revisions/4bcae98ed87c/schema)
