Cloudflare.stats()

Retrieve domain statistics for a given time frame

Usage

Hover over inputs/exits for more info.

var Cloudflare = require('machinepack-cloudflare');


// Retrieve domain statistics for a given time frame

Cloudflare.stats({

token: '8afbe6dea02407989af4dd4c97bb6e25',

email: 'sample@example.com',

domain: 'example.com',

interval: 20,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Authentication could not be completed.

notAuthorized: function () {

 

},

// Some other input was not valid.

invalidInput: function () {

 

},

// You have exceeded your allowed number of API calls.

apiLimit: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

token required

The API key made available on your Cloudflare account page.

'8afbe6dea02407989af4dd4c97bb6e25'
email required

The e-mail address associated with your Cloudflare account.

'sample@example.com'
domain required

The target domain.

'example.com'
interval required

The The time interval for the statistics.

20

Exits

error

An unexpected error occurred.

notAuthorized

Authentication could not be completed.

invalidInput

Some other input was not valid.

apiLimit

You have exceeded your allowed number of API calls.

success

OK.

{ timeZero: 1333051372000,
  timeEnd: 1335643372000,
  count: 1,
  has_more: false,
  objs: 
   [ { cachedServerTime: 1335816172000,
       cachedExpryTime: 1335859372000,
       trafficBreakdown: 
        { pageviews: { regular: 2640, threat: 27, crawler: 4 },
          uniques: { regular: 223, threat: 16, crawler: 4 } },
       bandwidthServed: { cloudflare: 78278.706054688, user: 58909.374023438 },
       requestsServed: { cloudflare: 4173, user: 3697 },
       pro_zone: false,
       pageLoadTime: null,
       currentServerTime: 1335824051000,
       interval: 20,
       zoneCDate: 1307574643000,
       userSecuritySetting: 'Medium',
       dev_mode: 0,
       ipv46: 5,
       ob: 0,
       cache_lvl: 'agg' } ] }