NAV
shell

Introduction

Welcome to the Motapi API. You can use our API to access NLP endpoints, which allow you to get semantic insights from a submited text.

All endpoints are accessible on the https://api.motapi.com domain.

Our API servers do not record any request content nor response. They only count the requests count and debit your API calls credit.

All requests are http POST request unless otherwise specified.

Authentication

Motapi expects for the API key to be included in all API requests to the server in a header that looks like the following:

x-api-key: your-api-key

Make sure to replace your-api-key with your API key.

Request body

All requests require an http header Content-Type: application/json.

All requests require a json object with a text property and an associated UTF-8 string value.

example:

# With shell, you can just pass the correct header with each request
curl "https://api.motapi.com/endpoint" \
 -H "Content-Type: application/json" \
 -H "x-ap-key: <your-api-key>" \
  --request POST \
  --data '{"text":"The string to be processed."}' \

Make sure to replace your-api-key with your API key.

Readability

Get all readability scores

curl "https://api.motapi.com/readability/all" \
 -H "Content-Type: application/json" \
 -H "x-ap-key: <your-api-key>" \
  --request POST \
  --data '{"text":"The string to be processed."}' \

The above command returns JSON structured like this:

[
{
  "flesch": 48.04,
  "kincaid": 15.25,
  "fog": 17.43,
  "smog": 0.0,
  "ari": 21.91,
  "coleman_liau": 0.0,
  "lix": 53.57,
  "linsear_write": 0.0
}
]

This endpoint returns all readability scores for a given text.

HTTP Request

POST https://api.motapi.com/readability/all

Request JSON body object properties

Property Required Description
text true UTF-8 string

Emotion

Get all emotions score intensities

curl "https://api.motapi.com/emotion/intensity" \
 -H "Content-Type: application/json" \
 -H "x-api-key: <your-api-key>" \
  --request POST \
  --data '{"text":"The string to be processed."}' \

The above command returns JSON structured like this:

{
  "anger": 0.0,
  "anticipation": 0.0,
  "disgust": 0.0,
  "fear": 0.0,
  "joy": 0.083333336,
  "sadness": 0.073,
  "surprise": 0.0,
  "trust": 0.29933333
}

This endpoint returns all emotions score intensities for a given text.

HTTP Request

POST https://api.motapi.com/emotion/intensity

Request JSON body object properties

Property Required Description
text true UTF-8 string
language false ISO 639-1 2 letters language code. example : "fr"

Errors

The Kittn API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The kitten requested is hidden for administrators only.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The kitten requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.