Links

Getting started with our API

Welcome to Caravel's API documentation! Using Caravel's API you can
  • Predict topics and intents
  • Predict sentiment
  • Predict emotions
That's not all. With Caravel's API you can get granular. Send over any text document to our API, one by one or in bulk, and Caravel's API will pre-processes your text analyzing for sentiment, emotions, and classifications down to the sentence level.
You can use any classifier you build in your Caravel account with our API – giving you the ability to leverage our prebuilt models, zero-shot classification, and trainable classifiers in your own code!

Getting your key

  • Create your account and team on the Caravel Platform
  • Head over to your Workspace Settings by clicking on your team name in the left side nav.
  • Click on the Account tab
  • Click Generate Key and copy the key to your clipboard
This is the key you will use to make calls to Caravel's API. If at anytime you need a new key, click Regenerate Key and it will deactivate your old key and give you a new one.

Predicting sentiment

Our API provides a global endpoint you can use if you only want to classify sentiment.
post
/v1/sentiment
Classify Sentiment
cURL
Python
Node
curl --location --request POST 'https://api.caravelapp.com/v1/sentiment' \
--header 'X-Api-Key: YOUR API KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"texts": [
"Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
]
}'
import http.client
import json
conn = http.client.HTTPSConnection("api.caravelapp.com")
payload = json.dumps({
yth "texts": [
"Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
]
})
headers = {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/sentiment", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.caravelapp.com/v1/sentiment',
'headers': {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
]
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Run in Postman

Predicting emotions

We also provide a similar global endpoint for predicting just emotions.
post
/v1/emotions
Classify Emotions
cURL
Python
Node
curl --location --request POST 'https://api.caravelapp.com/v1/emotions' \
--header 'X-Api-Key: YOUR API KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"texts": [
"Is there a button to raise/lower hand? It would come in handy in the Safe Driving Mode page."
]
}'
import http.client
import json
conn = http.client.HTTPSConnection("api.caravelapp.com")
payload = json.dumps({
"texts": [
"Is there a button to raise/lower hand? It would come in handy in the Safe Driving Mode page."
]
})
headers = {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/emotions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.caravelapp.com/v1/emotions',
'headers': {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Is there a button to raise/lower hand? It would come in handy in the Safe Driving Mode page."
]
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Run in Postman

Predicting topics and intents with a Classifier

You can create your own text classifiers that you can use with Caravel's API to predict topics and intents.
post
/v1/classifiers/{classifier_id}
Classify

Creating a Classifier

There are two type of text classifiers: Ensembles and Tags.
Ensembles classify without training data. With Ensembles you can combine any of the following techniques to classify text: keyword matching, prebuilt machine learning models, sentiment matching, and zero-shot classification (also known as inference).
Use Tag Classifiers to annotate text in your feed to train a classifier.
We offer a myriad of prebuilt classifiers in our library to help you get started right away.
Once you've created a classifier, you'll need the Classifier ID to use it with our API. Copy and paste the Classifier ID from the URL in your browser's address bar.

Using your Classifier in the API

Be sure to input your Classifier ID and API Key in the follow examples.
cURL
Python
Node
curl --location --request POST 'https://api.caravelapp.com/v1/classifiers/YOUR-CLASSIFIER-ID' \
--header 'X-Api-Key: YOUR API KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
]
}'
import http.client
import json
conn = http.client.HTTPSConnection("api.caravelapp.com")
payload = json.dumps({
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
]
})
headers = {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/classifiers/YOUR-CLASSIFIER-ID", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.caravelapp.com/v1/classifiers/YOUR-CLASSIFIER-ID',
'headers': {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
]
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Run in Postman

Classifying in bulk

If you need to classify more than one piece of text at a time, Caravel's API accepts multiple documents in the texts parameter. Each document is classified asynchronously for high-speed performance when working with bulk data and the results are returned once all documents have been classified.
Bulk classification is limited to 50 text documents at a time. If you need to classify more than this per request, please contact our support team at [email protected].
To classify in bulk, simply input multiple text documents into the texts array in your request:
cURL
Python
Node
curl --location --request POST 'https://api.caravelapp.com/v1/classifiers/290c5812-3acf-47b3-928b-2ecc8c966d25' \
--header 'X-Api-Key: fyMxf8eKa0DL18znJq5SB6N5S64' \
--header 'Content-Type: application/json' \
--data-raw '{
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other.",
"Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other.",
"Super app but viratual brackgroud cant use is in mobile version please arrange it. but i gave 5stares",
"Good app. Yay 👍. I gave a review and the developers team looked into the review and enabled the host and co host to raise hands. Now one more thing, a raise/lower hand button would come in handy in the Safe Driving Mode page.",
"This app works only on Pc browser...can'\''t use it on phone, only while using desktop browser mode.. waste of time for majority"
]
}'
import http.client
import json
conn = http.client.HTTPSConnection("api.caravelapp.com")
payload = json.dumps({
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other.",
"Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other.",
"Super app but viratual brackgroud cant use is in mobile version please arrange it. but i gave 5stares",
"Good app. Yay 👍. I gave a review and the developers team looked into the review and enabled the host and co host to raise hands. Now one more thing, a raise/lower hand button would come in handy in the Safe Driving Mode page.",
"This app works only on Pc browser...can't use it on phone, only while using desktop browser mode.. waste of time for majority"
]
})
headers = {
'X-Api-Key': 'fyMxf8eKa0DL18znJq5SB6N5S64',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/classifiers/290c5812-3acf-47b3-928b-2ecc8c966d25", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.caravelapp.com/v1/classifiers/YOUR-CLASSIFIER-ID',
'headers': {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other.",
"Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other.",
"Super app but viratual brackgroud cant use is in mobile version please arrange it. but i gave 5stares",
"Good app. Yay 👍. I gave a review and the developers team looked into the review and enabled the host and co host to raise hands. Now one more thing, a raise/lower hand button would come in handy in the Safe Driving Mode page.",
"This app works only on Pc browser...can't use it on phone, only while using desktop browser mode.. waste of time for majority"
]
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

Getting segments

Caravel's API makes fine-grain text analysis easy, enabling you to get the sentiment, emotions, and classified topics and intents of every sentence in a text document. Simply pass in include_segments option to get sentence level insights and Caravel returns all your classifications down to the sentence.
cURL
Python
Node
curl --location --request POST 'https://api.caravelapp.com/v1/classifiers/YOUR-CLASSIFIER-ID' \
--header 'X-Api-Key: YOUR API KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
],
"include_segments": true
}'
import http.client
import json
conn = http.client.HTTPSConnection("api.caravelapp.com")
payload = json.dumps({
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
],
"include_segments": True
})
headers = {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/classifiers/YOUR-CLASSIFIER-ID", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.caravelapp.com/v1/classifiers/YOUR-CLASSIFIER-ID',
'headers': {
'X-Api-Key': 'YOUR API KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"It’s hard to remember now, but there was a time, in the not-too-distant past, when people didn’t utter the phrase “go on mute” every single day. That’s just one of the ways Zoom has changed the landscape/society/fabric of space-time; what started as a videoconferencing app for business has become our go-to way (and word) for connecting with people in other places. Zoom’s meteoric rise came due to timing and circumstance, sure, but the app has met its moment with an elegant design, reliable performance, and constantly evolving features. But in the end, its real meaning is bigger: Zoom keeps us connected with each other."
],
"include_segments": true
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});