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.5/usage

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

Parameters

Parameter Description
period
optional

Allows you to view interaction consumption for the last day, hour, or five minute
period.

For example, if you choose "day" aggregation you will receive your interaction usage for the last
rolling 24 hour period

Accepted Values: current, hour, day

Default: hour

Examples

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

    curl -X GET 'https://api.datasift.com/v1.5/usage?period=day' \
        -H 'Authorization: username:api_key'

    DataSift returns JSON such as this:

    {
        "start": "Mon, 19 Dec 2016 11:15:00 +0000",
        "end": "Mon, 19 Dec 2016 12:15:00 +0000",
        "streams": {
          "693f5134c73a62ed85ef271040bf266b": {
            "licenses": {
              "facebook_page": 3653,
              "interaction": 3653,
              "links": 1806
            },
            "seconds": 3600
          },
          "14af4134c73a62ed65ef1f1040bf321e": {
            "licenses": {
              "interaction": 8827,
              "links": 2606,
              "tumblr": 8827,
            },
            "seconds": 3600
          },
          "f58960515270834568bd00835a8c10fe": {
            "licenses": {},
            "seconds": 641
          }
        }
      }

    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.5/usage with period set to current:

    curl -X GET 'https://api.datasift.com/v1.5/usage?period=current' \
        -H 'Authorization: username:api_key'

    DataSift returns JSON such as this:

    {
        "start": "Mon, 19 Dec 2016 11:20:00 +0000",
        "end": "Mon, 19 Dec 2016 11:25:00 +0000",
        "streams": {
          "24f17c834b685c20b8f4472421a721e7": {
            "licenses": {
              "interaction": 231,
              "links": 36,
              "salience.entities": 151,
              "salience.sentiment": 231,
              "sentiment.topics": 26,
              "wordpress": 231
            },
            "seconds": 300
          }
        }
      }

See Also

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.5.

Resource information

Rate limit cost: 25

Requires authentication: Yes

Response formats: JSON, JSONP