• Introduction

    This document describes how to query the Sentigem Sentiment Analysis API service for computing text sentiment via a RESTful interface. The service is presently an English only service. HTML/XML tags will be ignored but will contribute to the total character count.

    Prerequisites

    • You must have a valid and active API key to use our API service
    • If you don't,

      1. - Sign up with us here and activate your account
      2. - Sign in and use the links on the left to register for an API key
  • Using the Sentigem Sentiment Analysis API

    General usage notes

    GET and POST
    All Sentigem Sentiment Analysis API end-points accept both GET and POST calls. For POST calls, the cURL library is highly encouraged. More about cURL and libcurl
    Response format
    The Sentigem Sentiment Analysis API service response format is JSON only. More about JSON here and here.
    HTTP and HTTPS
    The Sentigem Sentiment Analysis API service only supports HTTPS calls. Should you happen to make an insecure call, that is, a non-HTTPS call, your API key will be invalidated immediately as it's likely to have been compromised at this point. You'll need to generate a new key here
    Cost and Pricing
    Please read our Pricing FAQ for detailed information on cost and pricing.

    The Sentigem Sentiment Analysis API end-points

    End-point #1: Get-Sentiment

    Request URL
    https://api.sentigem.com/external/get-sentiment
    Description
    Actual end-point for computing text sentiment

    Request parameters

    Parameter Value Description
    api-key string (required) Your unique API key
    text string (required) The text to analyze for sentiment

    Response fields

    Field Description
    status The call status. Usually "1" for success and a negative value for failure
    message A short message explaining the call status
    comment A longer, detailed message explaining anything unusual with the call. Usually blank except in exceptional circumstances.
    polarity
    The computed sentiment polarity for the text passed. Can be one of three values:
    • positive
    • neutral
    • negative
    char_count The total character count of all text passed for analysis for a given call. HTML tags will be counted literally.
    cost The amount, in US Dollars, you'll be billed for this API call.
    errors A list of errors associated with this call

    Sample request (GET)

    https://api.sentigem.com/external/get-sentiment?api-key=<your-api-key>&text=<text-to-analyze-for-sentiment>

    Sample response

    
        {
            "status": "1",
            "message": "success",
            "comment": "",
            "polarity": "positive",
            "char_count": "2056",
            "cost": "0.200285",
            "errors": [],
        }
                            
    The status field, above, can have one of several values:

        1  success
       -1  generic failure
       -2  service unavailable for scheduled maintenance
                        

    In any case, the message and/or comment field(s) will have an explanation regarding the status.

    End-point #2: Get-Balance

    Request URL
    https://api.sentigem.com/external/get-balance
    Description
    End-point for retrieving user account balance

    Request parameters

    Parameter Value Description
    api-key string (required) Your unique API key

    Response fields

    Field Description
    status The call status. Usually "1" for success and a negative value for failure
    message A short message explaining the call status
    comment A longer, detailed message explaining anything unusual with the call. Usually blank except in exceptional circumstances.
    balance
    The user account balance in US Dollars
    errors A list of errors associated with this call

    Sample request (GET)

    https://api.sentigem.com/external/get-balance?api-key=<your-api-key>

    Sample response

    
        {
            "status": "1",
            "message": "success",
            "comment": "",
            "balance": "22,000.49",
            "currency": "USD",
            "errors": [],
        }
                            
    The status field, above, can have one of several values:

        1  success
       -1  generic failure
       -2  service unavailable for scheduled maintenance
                        

    In any case, the message and/or comment field(s) will have an explanation regarding the status.

Last updated Monday, March 23th, 2015.<

Javascript is currently not enabled in your browser and as such, most of this site will not work properly. Please enable Javascript in your browser for a full featured experience.