Table of Contents

    API

    Mock Server

    Use this URL to access a mockup of the API server. Your traffic will be recorded and compared to the documentation. You'll find your traffic analysis in the inspector or directly here in the documentation, right next to each resource.

Skyttle API Documentation

Skyttle API performs keyword extraction, named entity extraction and phrase-level sentiment analysis for texts in English, French, German, and Russian.

You can find demos, tutorials, and subscription plans on the Skyttle website.

Request fields

text: the text to be analysed, max. 10,000 characters; multiple documents can be included into each requests, each document put into a tag.

user: username, get in touch to get one, or subscribe via Mashape

pwd: password, get in touch to get one, or subscribe via Mashape

lang: optional, the language of the text; one of: en (English), fr (French), de (German), ru (Russian); default: en

keywords: optional, 0 or 1: whether keywords should be extracted; default: 1

sentiment: optional, 0 or 1: whether sentiment should be analysed; default: 0

annotate: optional, 0 or 1: whether XML annotation of the input text should be produced ; default: 0

domain: optional, one of: electronics, retail, hospitality, telecom, automotive, or your custom domain (get in touch to set up one); for English only; default: None

Note: If you subscribe via Mashape, then you should omit the user and pwd parameters and instead send your Mashape key in the X-Mashape-Authorization header of the request (see example clients below).

Response fields

docs: a list of objects, corresponding to analysed documents, each object having the following fields:

  • terms: an object with the fields:
    • id: the unique, cross-document id of the keyword
    • term: the string representing the keyword
    • count: the count of the keyword in the document
  • sentiment: a list of objects, each with the following fields:
    • text: a stretch of text expressing sentiment, positive or negative
    • polarity: one of: pos, neg
  • sentiment_scores: an object with the fields:
    • pos: percentage of positive content in the document
    • neg: percentage of negative content in the document
    • neu: percentage of neutral content in the document

doc_text: the text of the document annotated for keywords and sentiment

warnings: a list of string representations of warning

Response codes

200 - OK

400 - Bad Request: a required parameter is missing or is invalid

401 - Unauthorized: invalid login/password

404 - Not Found: the requested URL was not found

500 - Internal Server Error: a problem with the server, please try again later

Example clients

Example requests

POST

/v0.1/

Extract keywords only, English

Response

200 (OK)
Content-Type: application/json
{u'docs': [{u'terms': [{u'count': 1, u'term': u'meals', u'id': u'af74d302b526b714ceb624cacd0bb9670b0462d0'}, {u'count': 1, u'term': u'restaurant', u'id': u'84f4966b50704820129d35025588feac9a9c1485'}], u'doc_id': u'0', u'language': u'en'}], u'errors': [], u'warnings': []}

POST

/v0.1/

Extract sentiment only, German

Response

200 (OK)
Content-Type: application/json
{u'docs': [{u'doc_id': u'0', u'sentiment': [{u'polarity': u'pos', u'text': u'und das Essen war ok'}, {u'polarity': u'neg', u'text': u'aber dieses Mal waren wir sehr entt\xe4uscht.'}], u'language': u'de', u'sentiment_scores': {u'neg': 72.4, u'neu': 0.0, u'pos': 27.6}}], u'errors': [], u'warnings': []}

POST

/v0.1/

Extract keywords and sentiment, annotate the text, English

Response

200 (OK)
Content-Type: application/json
{u'docs': [{u'terms': [{u'count': 1, u'term': u'meals', u'id': u'af74d302b526b714ceb624cacd0bb9670b0462d0'}, {u'count': 1, u'term': u'restaurant', u'id': u'84f4966b50704820129d35025588feac9a9c1485'}], u'language': u'en', u'sentiment': [{u'polarity': u'pos', u'text': u'and the meals have been ok'}, {u'polarity': u'neg', u'text': u'but this time we were deeply disappointed.'}], u'doc_text': u'<s id="0">We have visited this <t id="84f4966b50704820129d35025588feac9a9c1485" class="term">restaurant</t> a few times in the past, <c class="pos" id="1">and the <t id="af74d302b526b714ceb624cacd0bb9670b0462d0" class="term">meals</t> have been ok</c>, <c class="neg" id="2">but this time we were deeply disappointed.</c></s>', u'sentiment_scores': {u'neg': 34.8, u'neu': 42.8, u'pos': 22.4}, u'doc_id': u'0'}], u'errors': [], u'warnings': []}

POST

/v0.1/

Extract keywords and sentiment, annotate the text, Russian

Response

200 (OK)
Content-Type: application/json
{u'docs': [{u'terms': [{u'count': 1, u'term': u'\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f', u'id': u'cb3cc69186a207cc7670781974f9692c1994b868'}], u'language': u'ru', u'sentiment': [{u'polarity': u'pos', u'text': u'\u041c\u044b \u0431\u044b\u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u0441\u0442\u043e\u0440\u0430\u043d\u0435 \u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u043c'}, {u'polarity': u'neg', u'text': u'\u043d\u043e \u0432\u0447\u0435\u0440\u0430 \u043c\u044b \u0431\u044b\u043b\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u044b.'}], u'doc_text': u'<s id="0"><c class="pos" id="0">\u041c\u044b \u0431\u044b\u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u0441\u0442\u043e\u0440\u0430\u043d\u0435 \u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0438 <t id="cb3cc69186a207cc7670781974f9692c1994b868" class="term">\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f</t> \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u043c</c>, <c class="neg" id="1">\u043d\u043e \u0432\u0447\u0435\u0440\u0430 \u043c\u044b \u0431\u044b\u043b\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u044b.</c></s>', u'sentiment_scores': {u'neg': 50.0, u'neu': 16.7, u'pos': 33.3}, u'doc_id': u'0'}], u'errors': [], u'warnings': []}

POST

/v0.1/

Extract keywords, sentiment, annotate the text for the "Electronic Goods" domain, English

Response

200 (OK)
Content-Type: application/json
{u'docs': [{u'terms': [{u'count': 1, u'term': u'lasts long', u'id': u'eb849bdc51a3797d93a8b8dd38932b52bef9ee50'}, {u'count': 1, u'term': u'battery', u'id': u'858d77d6cdd6159633960146e75ef04a7dac9cdb'}, {u'count': 1, u'term': u'heavy', u'id': u'da814a4a2ad9e5afd421dafc775b293cc8b4bb7d'}, {u'count': 1, u'term': u'device', u'id': u'c0374964d1807496adc7213847c288806c5b1833'}, {u'count': 1, u'term': u'powerful', u'id': u'0ecd0c127c9fb1d320deb022d728773c60c7dcfa'}], u'language': u'en', u'sentiment': [{u'polarity': u'neg', u'text': u'The device is quite heavy'}, {u'polarity': u'pos', u'text': u"but it's really powerful and the battery lasts long"}], u'doc_text': u'<s id="0"><c class="neg" id="0">The <t id="c0374964d1807496adc7213847c288806c5b1833" class="term">device</t> is quite <t id="da814a4a2ad9e5afd421dafc775b293cc8b4bb7d" class="term">heavy</t></c>, <c class="pos" id="1">but it\'s really <t id="0ecd0c127c9fb1d320deb022d728773c60c7dcfa" class="term">powerful</t> and the <t id="858d77d6cdd6159633960146e75ef04a7dac9cdb" class="term">battery</t> <t id="eb849bdc51a3797d93a8b8dd38932b52bef9ee50" class="term">lasts long</t></c></s>', u'sentiment_scores': {u'neg': 19.6, u'neu': 54.3, u'pos': 26.1}, u'doc_id': u'0'}], u'errors': [], u'warnings': []}