REST interface endpoints
Common format
The endpoints of the REST interface are the Web addresses of the API resources.
The addresses of document analysis, document classification and information detection resources must be requested with the HTTP POST
method by sending the document to be processed.
The addresses of self-documentation resources must be requested with the HTTP GET
method without sending any data.
All endpoints share this format:
https://nlapi.expert.ai/v2/resource path
Resources' output is documented in a specific sub-section of this manual.
Document analysis resources
Full document analysis resources have paths like this:
analyze/context name/language
The boxed parts are placeholders:
context name
must be replaced with the name of the contextlanguage code
must be replaced with the ISO 639-1 language code
For example, this resource:
https://nlapi.expert.ai/v2/analyze/standard/en
performs the full analysis of the English text submitted as POST data using the standard
context.
Partial analysis resources paths have a third parameter, the analysis name:
analyze/context/language/analysis
For example, this resource:
https://nlapi.expert.ai/v2/analyze/standard/en/disambiguation
performs only the deep linguistic analysis of an English text.
The mapping between API capabilities and analysis names follows:
Capability | Analysis name | Example path for standard context and English language |
---|---|---|
Full document analysis | n/a | analyze/standard/en |
Deep linguistic analysis | disambiguation |
analyze/standard/en/disambiguaton |
Keyphrase extraction | relevants |
analyze/standard/en/relevants |
Named entities recognition | entities |
analyze/standard/en/entities |
Relation extraction | relations |
analyze/standard/en/relations |
Sentiment analysis | sentiment |
analyze/standard/en/sentiment |
Available languages depend on the context.
Some examples of document analysis endpoints follow.
-
Full analysis of a Spanish text with the
standard
context:https://nlapi.expert.ai/v2/analyze/standard/es
-
Named entity recognition on a French text with the
standard
context:https://nlapi.expert.ai/v2/analyze/standard/fr/entities
-
Keyphrase extraction on an Italian text with the
standard
context:https://nlapi.expert.ai/v2/analyze/standard/it/relevants
Document classification resources
The path of document classification resources has this format:
categorize/taxonomy name/language code
The boxed parts are placeholders:
taxonomy name
must be replaced with the name of the taxonomylanguage code
must be replaced with the ISO 639-1 language code
For example:
https://nlapi.expert.ai/v2/categorize/iptc/en
is the resource that classifies English texts according to the iptc
taxonomy.
Available languages depend on the taxonomy.
Other examples of document classification endpoints:
-
Classification of a Spanish text with the
iptc
taxonomy:https://nlapi.expert.ai/v2/categorize/iptc/es
-
Classification of a German text with the
geotax
taxonomy:https://nlapi.expert.ai/v2/categorize/geotax/de
Information detection resources
The path of information detection resources has this format:
detect/detector name/language code
The boxed parts are placeholders:
detector name
must be replaced with the name of the detectorlanguage code
must be replaced with the ISO 639-1 language code
For example:
https://nlapi.expert.ai/v2/detect/pii/en
is the resource that detects information in English texts using the pii
detector.
Available languages depend on the detector.
Self-documentation resources
contexts
The contexts
resource returns information about the contexts that can be used for document analysis.
It must be requested with the GET
method and has this path:
contexts
taxonomies
The taxonomies
resource returns the list of the taxonomies that can be used for document classification.
It must be requested with the GET
method and has this path:
taxonomies
taxonomies child resources
The resource that returns the category tree for a given taxonomy in a given language must be requested with the GET
method and has this path:
taxonomies/taxonomy name/language code
The boxed parts are placeholders:
taxonomy name
must be replaced with the name of the taxonomylanguage code
must be replaced with the ISO 639-1 language code
For example, this resource:
https://nlapi.expert.ai/v2/taxonomies/iptc/en
returns the categories' tree of the English iptc
taxonomy.
detectors
The detectors
resource returns the list of the detectors that can be used for information detection.
It must be requested with the GET
method and has this path:
detectors