usage

Check the number of objects processed and delivered for a given time period.

An HTTPS GET request sent to:

https://api.datasift.com/v1.3/usage

A successful call to this endpoint returns: 200 OK plus a JSON object.

Parameters

Parameter Description
period
optional
default = hour

"day", "hour", or "current".

Example values: current

Examples

  1. Here's an example of a call to /v1.3/usage for the past day:

    curl -X GET https://api.datasift.com/v1.3/usage?period=day 
        -H 'Authorization: datasift-user:your-datasift-api-key'

    DataSift returns JSON such as this:

    {
         "start": "Mon, 07 Nov 2011 11:15:00 +0000",
         "end": "Mon, 07 Nov 2011 12:15:00 +0000",
         "streams": {
             "693f5134c73a62ed85ef271040bf266b": {
                  "licenses": {
                      "facebook":365,
                      "twitter":18062
                  },
                  "seconds": 3600
             },
             "14af4134c73a62ed65ef1f1040bf321e": {
                  "licenses": {
                      "facebook":344,
                      "twitter":26062
                  },
                  "seconds": 3900
             }
         }
      }

    Property: Description:
    start The start of the period you requested.
    end The end of the period you requested.
    licenses The number of objects of each type that DataSift delivered to you in the peried you requested.
    seconds The total number of seconds you have been connected to the stream during the interval defined by the start and end values. If you consume a stream in two or more ways simultaneously, it will be the sum of the connection times. For example, this will happen if you consume via Push and the Streaming API simultaneously, or if you simply connect to the same hash twice.
  2. Here's an example of a call to /v1.3/usage with period set to current:

    curl -X GET https://api.datasift.com/v1.3/usage?period=current 
        -H 'Authorization: datasift-user:your-datasift-api-key'

    DataSift returns JSON such as this:

    {
          "start": "Mon, 28 May 2012 11:20:00 +0000",
          "end": "Mon, 28 May 2012 11:25:00 +0000",
          "streams": {
              "24f17c834b685c20b8f4472421a721e7": {
                  "licenses": {
                      "links": 36,
                      "salience.entities": 151,
                      "salience.sentiment": 231,
                      "sentiment.topics": 26,
                      "trends": 4
                  },
                  "seconds": 300
              }
          }
      }

Notes

  1. All calls to the API must be properly authenticated with a DataSift username and API key.
  2. If no time period is given then it will select usage from the last 24 hours. The 'current' period returns usage data from the last logged five-minute window.
  3. Please take a look at our Billing page or Billing FAQ to understand how DataSift calculates the total cost of a stream.
  4. All calls to the API must be versioned. The current version is v1.3.

Resource information

Rate limit cost: 25

Requires authentication: Yes

Response formats: JSON, JSONP