MOStlyREST com_rest_stats

The MOStlyREST com_rest_stats component builds off the solid MOStlyREST com_rest base component. It implements a set of standard REST parameters for interacting with Mambo's statistical data. This provides valuable information to REST clients like the popular site search strings, number of hits per content item, hits by browser type, by operating system, by host, etc. It also provides a replica of mod_whosonline which can be used to see how may guests and registers users are current browsing your site. See the table below for information on allowed parameters and their meaning. See the Bridget sample app for a hands-on example of com_rest_stats.

RESTful API Parameters, Explanations, and Formats

Parameter Value Description
appid string (required) The application ID. See the wiki page on RESTful API registration for more information.
output string: json, xml, php The format the API response is to be returned in. More information on the return formats can be found later in this document.
callback string The name of the callback function to wrap around the JSON data. The following characters are allowed: A-Z a-z 0-9 . [] and _. If output=json has not been requested, this parameter has no effect.
type string: agent, content, whosonline, search Defines the type of request
  • agent = Browser, host, and operating system hit counts
  • content = Content items and their hits count returned in descending order by hit count (accepts a limit param)
  • whosonline = Mirrors mod_whosonline. Provides real-time counts for the number of guests and registered users on a site.
  • search = Returns search terms recorded for the site in descending order by hit count (accepts a limit param)

limit integer Used to limit the number of records returned. Can be used with requests where "type" is either equal to "search" or "content". Could be useful for pulling lists like the top 5 most popular search terms, etc.

Each request must start with a base URL. Below is a sample base URL. To build custom API requests the parameters discussed above can be combined and tacked onto the site's base URL.

Sample base URL:

Sample custom request URL:

API Sample Stats Responses

<?xml version="1.0"?>
		<agent>Mozilla Firefox</agent>

Serialized PHP
		s:24:"Mozilla Firefox";

	"agent":"Mozilla Firefox",
There are no comments on this page.
Page was generated in 0.0603 seconds