Response

The output contains information about the status of the request and about the categories in which the text has been classified. The information provided is the same for the different output formats and the naming convention used for all fields is lowercase_separated_by_underscore.

Response output

These are the fields included in the response document.

Name Description
status

Contains information about the extraction process and whether it has finished successfully. It is formed by a status code (code), a natural number that identifies the result, and a message (msg), a string describing the result. In addition, the field (credits) contains a natural number that indicates the credits consumed in the request and (remaining_credits) shows the number of credits left to the user to get to the credit limit.

You can find all the possible status codes returned by the API with an explanation and tips on how to manage them in our error codes catalog.

A request is any HTTP request done to the API to analyze less than 500 words. If the text sent is longer than that, then it will be considered that more than a request is made, more specifically, as many requests as we would need if the text were divided in chunks of 500 words.

For instance, an HTTP request with 1013 words, will count as three requests, so 3 credits will be consumed; an HTTP request with a text 25648 words long would count as 25648/500 = 51.296 => 52 credits, and so on.

Did you know...?

Only the successful requests to the API will consume credits. In other words, the credits specified in the answer will only count as credits consumed when code=0.

category_list

List of categories in which the input text is classified. Each category (category) contains the following fields:

  • code: category code
  • label: category description
  • abs_relevance: absolute relevance value of the category
  • relevance: relative relevance value of the category, a number in the 0-100% range, and computed with respect to the top ranked result
  • term_list: list of the relevant terms of the category. Each term contains the value of the term and a numeric value of how the term affects the abs_relevance of the category

Response examples

The format in which this information will be shown will depend on the value of the of parameter.

    The 85th Academy Awards ceremony took place February 24, 2013.
{
    "status": {
        "code": "0",
        "msg": "OK",
        "credits": "5"
    },
    "category_list": [
        {
            "code": "01021001",
            "label": "arts, culture and entertainment - entertainment (general) - entertainment award",
            "abs_relevance": "0.48236102",
            "relevance": "100"
        },
        {
            "code": "08006000",
            "label": "human interest - award and prize",
            "abs_relevance": "0.28744578",
            "relevance": "60"
        }
    ]
}
<?xml version="1.0" encoding="utf-8"?>
<response>
    <status code="0" credits="5">OK</status>
    <category_list>
        <category>
            <code>
                <![CDATA[01021001]]>
            </code>
            <label>
                <![CDATA[arts, culture and entertainment - entertainment (general) - entertainment award]]>
            </label>
            <abs_relevance>0.48236102</abs_relevance>
            <relevance>100</relevance>
        </category>
        <category>
            <code>
                <![CDATA[08006000]]>
            </code>
            <label>
                <![CDATA[human interest - award and prize]]>
            </label>
            <abs_relevance>0.28744578</abs_relevance>
            <relevance>60</relevance>
        </category>
    </category_list>
</response>
  

Check the response document DTD: XML DTD.