dpu

Calculate the DPU cost of consuming a stream.

An HTTPS GET request sent to:

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

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

Parameters

Parameter Description
hash
optional

A unique pointer to a compiled filter.

This parameter is optional but you must specify either a hash or a historics_id.

Example values: 2459b03a13577579bca76471778a5c3d

historics_id
optional

A unique pointer to a Historics query.

This parameter is optional but you must specify either a hash or a historics_id.

Example values: 96e501ae6c2b0ae3633f

Examples

  1. Here's an example of a call to /v1.3/dpu:

    curl -X GET https://api.datasift.com/v1.3/dpu?hash=9fe133a7ee1bd2757f1e26bd78342458 
        -H 'Authorization: datasift-user:your-datasift-api-key'

    DataSift returns this JSON:

    {
         "dpu": 0.2,
         "detail": {
             "contains": {
                 "count": 2,
                 "dpu": 0.2,
                 "targets": {
                     "interaction.content": {
                         "count": 1,
                         "dpu": 0.1
                     },
                     "interaction.title": {
                         "count": 1,
                         "dpu": 0.1
                     }
                 }
             }
         }
      }

  2. You can call /dpu with a historics_id:

    curl -X GET https://api.datasift.com/v1.3/dpu?historics_id=96e501ae6c2b0ae3633f 
        -H 'Authorization: datasift-user:your-datasift-api-key'

    DataSift returns this JSON:

    {
      "dpu": 1.4583333333333,
      "detail": {}
    }

    If the historics_id is incorrect or if that Historics query has been deleted, you will receive:

    {
      "error": "No historic found with the ID 96e501ae6c2b0ae3633f"
    }

Property: Description:
dpu The cost in DPUs to run this stream. The output indicates that the CSDL code for this stream uses the interaction.content target once and the interaction.title target once. Each costs 0.1 DPUs. The overall cost is therefore 0.2 DPUs.

Notes

  1. All calls to the API must be properly authenticated with a DataSift username and API key.
  2. Please take a look at our Billing page or Billing FAQ to understand how DataSift calculates the total cost of a stream.
  3. All calls to the API must be versioned. The current version is v1.3.

Resource information

Rate limit cost: 5

Requires authentication: Yes

Response formats: JSON, JSONP