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, as well as how many times it matched in the text (abs_frequency).
  • debug: this element is only available when the parameter debug is enabled, and it's only show for user classification models. It contains a list of the rules triggered in the rule-based classification with the rule as well as the weight they add.

Response examples

The format in which this information will be shown will be in JSON.

    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"
        }
    ]
}