Forecast

Display and estimate trends in website traffic in the future.

This api call returns an estimate of the number of unique visitors who will visit your site by the end of the current day, week, and month. These forecasts are estimates based on historical data.

API Usage

This API produces a json array. Use this URL to perform GET or POST requests.

Parameters

At least one of the following parameters are required:

date Calculate trends from specified date entered as yyyy-MM-dd. Default is the current date.

timezone The timezone used. Use this option if more than one timezone is being recorded, by default the site's defined timezone is used.
login Your opentracker login email. Default is [demo@opentracker.net].
password Your password.
ticketId A ticketId can be used to provide credentials with an expiring token. A ticketId can be used instead of a login/ password combination. Further information can be found here.
segment This is the property field based on which you want to segment the data. By default there are no segments. You can find more information here.
filter You can choose to see no segments [none] (default), see all segments showAllSorts, or by specifying the name of the segment..
site The site for which to display data. The default is [www.opentracker.net].
locale The locale parameter is an identifier for a particular combination of language and region (e.g. en_US) and determines the format of the data returned. Default is [en_US]. A list of locales can be found here.
ignoreLocale Display columns without language translation. [false]|true.
dataType The dataType parameter determines the format of the data returned. Values can be [ json ] | html | jsondatatable | jsonjqgrid
dateFormat The dateFormat parameter determines the format of dates returned. An example is dateFormat=yyyy-dd-MM. The syntax can be found here.

Examples

To calculate the trend forecast to the website www.opentracker.net for the user "demo@opentracker.net" with password "demo123":
HTTP GET/ POST: trends_forecast.jsp?login=demo@opentracker.net&password=demo123&site=www.opentracker.net

Response

An example:

{ "resultsList": [
{
"forecast for":"visitors",
"today":"3,960 (1,738)",
"this week":"18,543 (18,543)",
"this month":"101,692 (98,412)"}
,
{
"forecast for":"pageviews",
"today":"9,402 (5,093)",
"this week":"56,711 (56,711)",
"this month":"310,299 (300,289)"}
]
}

Errors

If errors are encountered, the first encountered error will be returned of form "Error: exception: message

Error: java.lang.RuntimeException: Login/ site combination is not valid

We would love to hear your feedback. Please use the facebook comment box below