API Key
Required
site_token |
Site ID. This is available in the Site Manager and will be something like GSN-1234567-X |
metric |
Metric to retrieve. Available metrics:
|
Optional
| Parameter | Description | Default |
timezone |
Retrieve the data tailored to a specific timezone. See full list of supported timezone identifiers | UTC |
grouping |
The unit of time in which data points will be grouped. Available values are:
hour unit is currently only available to the pageviews, ppv and nvr metrics. All other metrics are grouped by day or longer. |
day |
| Time frame options: | ||
start |
Timestamp for the start of time frame. Can be in UNIX timestamp or YYYY/MM/DD [HH:MM] formats. For example: 1289401200 or 2010/11/10 15:00 |
Start of last period |
end |
Timestamp for the end of time frame. Can be in UNIX timestamp or YYYY/MM/DD [HH:MM] formats. For example: 1289368800 or 2010/11/10 |
Now |
period |
Retrieves stats for the last specified period of time. Overrides any start and end range limits. Options are:
day will retrieve data for the past 24 hours. |
week |
limit |
Limit the dataset to a certain number of points Note: Does not apply to pageviews, nvr and ppv metrics.Example: Use this to limit how many pages are returned in the topcontent dataset. |
30 |
This function supports multiple output formats. View the list of available output formats
The request rate limit is 1 request for every 10 seconds, with a maximum of 150 requests per hour.
Array of historical data for the given metric.
http://api.gosquared.com/trends.xml?api_key=API_KEY&site_token=GSN-1234567-X&metric=pageviews
<?xml version="1.0" encoding="UTF-8"?>
<data>
<day>
<hits>1254</hits>
<uniques>620</uniques>
<stat_start>1288803600</stat_start>
<time_grouping>2010307</time_grouping>
<display_time>Wed, 03 Nov 10</display_time>
</day>
<day>
<hits>3459</hits>
<uniques>1941</uniques>
<stat_start>1288828800</stat_start>
<time_grouping>2010308</time_grouping>
<display_time>Thu, 04 Nov 10</display_time>
</day>
<day>
<hits>3769</hits>
<uniques>1755</uniques>
<stat_start>1288915200</stat_start>
<time_grouping>2010309</time_grouping>
<display_time>Fri, 05 Nov 10</display_time>
</day>
<day>
<hits>2381</hits>
<uniques>1107</uniques>
<stat_start>1289001600</stat_start>
<time_grouping>2010310</time_grouping>
<display_time>Sat, 06 Nov 10</display_time>
</day>
<day>
<hits>2459</hits>
<uniques>1250</uniques>
<stat_start>1289088000</stat_start>
<time_grouping>2010311</time_grouping>
<display_time>Sun, 07 Nov 10</display_time>
</day>
<day>
<hits>3542</hits>
<uniques>1839</uniques>
<stat_start>1289174400</stat_start>
<time_grouping>2010312</time_grouping>
<display_time>Mon, 08 Nov 10</display_time>
</day>
<day>
<stat_start>1289280608</stat_start>
<hits>3580</hits>
<uniques>1566</uniques>
<time_grouping>2010313</time_grouping>
<display_time>Tue, 09 Nov 10</display_time>
<axis_label>9</axis_label>
</day>
<day>
<stat_start>1289348885</stat_start>
<hits>2690</hits>
<uniques>1183</uniques>
<time_grouping>2010314</time_grouping>
<display_time>Wed, 10 Nov 10</display_time>
<axis_label>10</axis_label>
</day>
</data>