getWafResults — Retrieving traffic statistics for a site
The getWafResults
method retrieves the traffic statistics for a site.
The API endpoint is:
https://api.sitelock.com/v1/partner
Request Format
-
SiteLockOnlineRequest: This element is used to delineate the full API request.
-
authentication: The partner’s username, password, and branding
-
username: The partner’s API username
-
password: The partner’s API password
-
partner: (Optional) The brand name to use in messaging
-
-
getWafResults: The method name
-
site_id: The ID of the site for which to retrieve traffic statistics
-
time_range: The time range for which to fetch data. The value can be one of the following:
-
today: From midnight today until the current time
-
last_7_days: From midnight 7 days ago until midnight today
-
last_30_days: From midnight 30 days ago until midnight today
-
last_90_days: From midnight 90 days ago until midnight today
-
month_to_date: From midnight of the first day of the month until midnight today
-
-
visits_timeseries: The number of visits by type (humans/bots) over time
-
hits_timeseries: The number of hits by type (humans/bots) over time and per second
-
bandwidth_timeseries: The amount of bytes (bandwidth) and bits per second (throughput) transferred via the SiteLock network from clients to proxy servers and vice-versa over time.
-
requests_geo_dist_summary: The total number of requests routed via the SiteLock network, grouped by the data center location
-
visits_dist_summary: The total number of visits per client application and country
-
caching: The total number of requests and bytes cached by the SiteLock network
-
caching_timeseries: The number of requests and bytes cached by the SiteLock network, with one day resolution info regarding the caching mode
-
threats: The total number of security incidents per threat type and additional information regarding the configuration of the site with respect to each threat type. Each threat consists of the following:
-
name: The name of the threat
-
incidents: The total number of security incidents of this threat type. A negative value represents N/A, for example, data isn’t available.
-
status: The status of this security rule for the site, such as
ok
,warning
, orerror
-
status_text: The name of this security rule for the site, such as
Block
orNot Supported
-
followup: The followup action
-
followup_text: The name of the followup action, such as View incidents or Upgrade
-
-
-
All the timestamps will be specified as the number of milliseconds since midnight, 1 January 1970 (UNIX time * 1000) GMT. |
Example request
<SiteLockOnlineRequest>
<authentication>
<user>Username</user>
<password>Password</password>
</authentication>
<getWafResults>
<site_id>10900</site_id>
<time_range>last_7_days</time_range>
<visits_timeseries />
<bandwidth_timeseries />
<requests_geo_dist_summary />
<visits_dist_summary />
<caching />
<caching_timeseries />
<threats />
</getWafResults>
</SiteLockOnlineRequest>
Example response
<SiteLockOnlineResponse>
<getWafResults>
<status>ok</status>
<message>ok</message>
<visits_timeseries>
<type>
<name>Human visits</name>
<data_records>
<data_record>
<requests>14</requests>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<requests>13</requests>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
<type>
<name>Bot visits</name>
<data_records>
<data_record>
<requests>291</requests>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<requests>329</requests>
<timestamp>1549497600000</timestamp>
</data_record>
</data_records>
</type>
</visits_timeseries>
<bandwidth_timeseries>
<type>
<name>Bandwidth</name>
<data_records>
<data_record>
<bytes>14022254</bytes>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<bytes>22565358</bytes>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
<type>
<name>Bits per second</name>
<data_records>
<data_record>
<bits_per_second>1298</bits_per_second>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<bits_per_second>2098</bit_per_second>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
</bandwidth_timeseries>
<requests_geo_dist_summary>
<type>
<name>Requests by data-center location</name>
<data_records>
<data_record>
<datacenter_location>Hong Kong</datacenter_location>
<requests>47</requests>
</data_record>
...
<data_record>
<datacenter_location>Dallas, TX</datacenter_location>
<requests>273</requests>
</data_record>
</data_records>
</type>
</requests_geo_dist_summary>
<visits_dist_summary>
<type>
<name>Visits by country</name>
<data_records>
<data_record>
<country>AU</country>
<requests>38</requests>
</data_record>
...
<data_record>
<country>US</country>
<requests>1524</requests>
</data_record>
</data_records>
</type>
<type>
<name>Visits by client application</name>
<data_records>
<data_record>
<client_application>WordPress</client_application>
<requests>275</requests>
</data_record>
...
<data_record>
<client_application>Chrome</client_application>
<requests>34</requests>
</data_record>
</data_records>
</type>
</visits_dist_summary>
<caching>
<saved_bytes>48993568</saved_bytes>
<saved_requests>1738</saved_requests>
<total_bytes>139689049</total_bytes>
<total_requests>15726</total_requests>
</caching>
<caching_timeseries>
<type>
<name>Standard Requests Caching</name>
<data_records>
<data_record>
<requests>200</requests>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<requests>208</requests>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
<type>
<name>Standard Bandwidth Caching</name>
<data_records>
<data_record>
<bytes>6062696</bytes>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<bytes>6381310</bytes>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
<type>
<name>Advanced Requests Caching</name>
<data_records>
<data_record>
<requests>4</requests>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<requests>12</requests>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
<type>
<name>Advanced Bandwidth Caching</name>
<data_records>
<data_record>
<bytes>3133</bytes>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<bytes>4135</bytes>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
<type>
<name>Total requests</name>
<data_records>
<data_record>
<requests>1197</requests>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<requests>2318</requests>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
<type>
<name>Total bandwidth</name>
<data_records>
<data_record>
<bytes>13439574</bytes>
<timestamp>1549238400000</timestamp>
</data_record>
...
<data_record>
<bytes>37254990</bytes>
<timestamp>1549756800000</timestamp>
</data_record>
</data_records>
</type>
</caching_timeseries>
<threats>
<threat>
<name>Visitors from blacklisted URLS</name>
<followup>Add URLS</followup>
<followup_text>Add URLS</followup_text>
<incidents>0</status>
<status>ok</followup>
<status_text>No URLs in blacklist</followup>
</threat>
...
<threat>
<name>Illegal Resouce Access</name>
<followup>View Incidents</followup>
<followup_text>View Incidents</followup_text>
<incidents>23</status>
<status>ok</followup>
<status_text>Block Request</followup>
</threat>
</threats>
</getWafResults>
</SiteLockOnlineResponse>