Skip to content

REST interface endpoints

Common format

The endpoints of the REST interface are the Web addresses of the API resources.

The addresses of analysis and classification 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 book.

Document analysis resources

Full document analysis resources have paths like this:

analyze/context/language

The boxed parts are placeholders:

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/language

The boxed parts are placeholders:

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.

Some examples of document classification endpoints:

  • Classification of an English text with the iptc taxonomy:

    https://nlapi.expert.ai/v2/categorize/iptc/en
    
  • Classification of a German text with the geotax taxonomy:

    https://nlapi.expert.ai/v2/categorize/geotax/de
    

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 categories' ​tree ​for a given taxonomy in a given language must be requested with the GET method and has this path:

taxonomies/taxonomy/language

The boxed parts are placeholders:

  • taxonomy must be replaced with the name of the taxonomy
  • language 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.