The first step for integrating with models at MonkeyLearn is to have your API Token and to be familiar with the MonkeyLearn reference.

If you are an experienced web developer, you may have done web API integrations before, also you may have seen some of the code snippets at monkeylearn.com

Getting your API token

The first step will be to look at your API token, you can get your token at your settings for My Account, under the API Keys option.

If you click the API Keys option, you’ll see the token that you must use to authenticate with the web API every time you make a request:

The following sections show ways to integrate MonkeyLearn API with some of the most popular programming languages (Python, Ruby, Java, PHP, Javascript and .Net). Of course, there are other options that you can also use.

Curl

The simplest way to check an API is through curl command, the following shows how to perform a simple text classification with curl:

curl --data '{"text_list": ["lions are very big animals", "i want to buy an iphone"]}' \
-H "Authorization:Token <YOUR TOKEN GOES HERE>" \
-H "Content-Type: application/json" \
-D - \
https://api.monkeylearn.com/v2/classifiers/<MODEL ID GOES HERE>/classify/

You have to change the place holder <YOUR TOKEN GOES HERE> to your particular token obtained from your account details, and the place holder <MODEL ID GOES HERE> set the id of the corresponding model. The id of the model can be obtained from the URL when you open a model in the GUI or from the API tab.

The text_list parameter is used to set the texts you want to classify.

Official API clients:

Unofficial API clients:

Did this answer your question?