Authentication
Access to your web stats through the API is controlled with an API key which must be sent with every request. To retrieve your API key, sign in to your W3Counter account. Choose "My Account" at the top of the page, then "API" in the menu. This key will automatically be updated whenever you change your account password for security purposes.Each request must also include a website ID, which identifies the site you want statistics for. This is the ID from the tracking code you added to your websites, and is also shown in the URL whenever you're viewing your web stats.
Making API Calls
A call to the W3Counter Web Stats API is as simple as accessing the following URL in your application:http://www.w3counter.com/stats/v4api
Append to that API the name of the function you wish to access and the parameters for that function as listed in the specification below. For example, to request the locations of the last 20 visitors to website #123, you would retrieve the following URL:
http://www.w3counter.com/stats/v4api?key=[apikey]&func=getVisitorsLocations&website_id=123&limit=20&offset=0
Any time a date is required, it should be provided in YYYY-MM-DD format.
API Reference
getSummaryByDay (website_id, start_date, end_date, limit, offset)
Returns visit and page view counts for a website grouped by date.
website_id: ID of the website
start_date: Start of the date range
end_date: End of the date range
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSummaryTotals (website_id)
Returns total number of visits, return visits and page views recorded for a website.
website_id: ID of the website
getSummaryByWeek (website_id, start_date, end_date, limit, offset)
Returns visit and page view counts for a website grouped by week.
website_id: ID of the website
start_date: Start of the date range
end_date: End of the date range
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSummaryByMonth (website_id, start_date, end_date, limit, offset)
Returns visit and page view counts for a website grouped by month.
website_id: ID of the website
start_date: Start of the date range
end_date: End of the date range
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getUniqueVisits (website_id)
Returns the number of unique visits to the website in the visitor log.
website_id: ID of the website
getPageViews (website_id)
Returns the number of page views of the website in the visitor log.
website_id: ID of the website
getDashboardData (website_id, url)
website_id:
url:
getVisitorsLocationsCount (website_id)
Returns the number of unique countries of visitors to a website.
website_id: ID of the website
getVisitorsLocations (website_id, limit, offset)
Returns the locations of visitors to a website grouped by country.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getRecentLocations (website_id, limit)
Returns the locations of the most recent visitors to a website.
website_id: ID of the website
limit: Maximum number of records to return
getVisitorsLanguagesCount (website_id)
Returns the number of unique languages of visitors to a website.
website_id: ID of the website
getUniqueVisitsWithLanguages (website_id)
website_id:
getVisitorsLanguages (website_id, limit, offset)
Returns the visits to a website grouped by language.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getVisitDepth (website_id)
Returns the depths of visits to a website (number of pages viewed per session).
website_id: ID of the website
getVisitLength (website_id)
Returns the time in seconds of visits to a website grouped by interval.
website_id:
getClickList (website_id, url, limit, offset)
Returns a list of URLs clicked from a specific URL ordered by number of clicks.
website_id: ID of the website
url: Origin page to retrieve a click list for
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getReferrersTopCount (website_id, url)
Returns the number of distinct referrers to a website.
website_id: ID of the website
url:
getReferrersTop (website_id, url, limit, offset)
Returns the referrers to a website ordered by number of referred visits.
website_id: ID of the website
url:
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getReferrersDomainsCount (website_id, url)
Returns the number of distinct domains referring visits to a website.
website_id: ID of the website
url:
getReferrersDomains (website_id, url, limit, offset)
Returns the domains referring visits to a website ordered by the number of visits.
website_id: ID of the website
url:
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSelfReferredCount (website_id, url)
website_id:
url:
getReferrersDrilldown (website_id, domain, url)
Returns the individual pages within a domain referring visits to a website.
website_id: ID of the website
domain: Domain of referring visits to retrieve complete URL list for
url:
getReferrersNew (website_id, url, limit, offset)
Returns referring URLs that haven't referred visits before the current date.
website_id: ID of the website
url:
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getReferrersRecent (website_id, url, limit, offset)
Returns the most recent referring URLs to a website.
website_id: ID of the website
url:
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSearchesTopCount (website_id)
Returns the number of unique search phrases referring visits to a website.
website_id: ID of the website
getSearchesTop (website_id, limit, offset)
Returns the search phrases referring visits to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSearchesWithSETopCount (website_id)
Returns the number of search engine and search phrase combinations referring visits to a website.
website_id: ID of the website
getSearchesWithSETop (website_id, limit, offset)
Returns the unique search engine and search phrase combinations referring visits to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSearchesNew (website_id, limit, offset)
Returns search phrases that haven't referred visits before the current date.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSearchesRecent (website_id, limit, offset)
Returns the most recent search phrases to refer visits to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getSearchEnginesCount (website_id)
Returns the number of unique search engines referring visits to a website.
website_id: ID of the website
getSearchEngines (website_id, limit, offset)
Returns the search engines referring visits to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getBrowsersTopCount (website_id)
Returns the number of unique browsers used by visitors to a website.
website_id: ID of the website
getBrowsersTop (website_id, limit, offset)
Returns the browsers used by visitors to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getBrowsersFamilyCount (website_id)
Returns the number of distinct browser families used by visitors to a website.
website_id: ID of the website
getBrowsersFamily (website_id, limit, offset)
Returns the browser families used by visitors to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getBrowserDrilldown (website_id, family)
Returns the specific versions within a browser family used by visitors to a website.
website_id: ID of the website
family: Browser family (i.e. IE, Firefox, Opera)
getPlatformsCount (website_id)
Returns the number of unique operating systems used by visitors to a website.
website_id: ID of the website
getPlatforms (website_id, limit, offset)
Returns the operating systems used by visitors to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getDisplayResolutionsCount (website_id)
Returns the number of unique screen resolutions used by visitors to a website.
website_id: ID of the website
getDisplayResolutions (website_id, limit, offset)
Returns the display resolutions used by visitors to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getDisplayDepthsCount (website_id)
Returns the number of unique screen color depths used by visitors to a website.
website_id: ID of the website
getDisplayDepths (website_id, limit, offset)
Returns the screen color depths used by visitors to a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getJavaScriptCounts (website_id)
Returns the number of visitors with javascript enabled or disabled for a website.
website_id: ID of the website
getVisitorsOnline (website_id, limit, offset)
Returns the visitors currently active on a website.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getVisitorsRecent (website_id, limit, offset)
Returns the visitors active on the website on this date.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getVisitorDrilldown (website_id, visitor_id, url)
Returns the visit log entries for a specific visitor id.
website_id: ID of the website
visitor_id: ID of a visitor taken from the results of a call to getVisitorsOnline or getVisitorsRecent
url:
getVisitorByLabel (website_id, label, url)
Returns the visit log entries for a specific visitor label.
website_id: ID of the website
label: User-assigned visitor label
url:
getPageCount (website_id)
Returns the number of distinct webpages for a website.
website_id: ID of the website
getPagesPopular (website_id, limit, offset)
Returns the pages of a website in order of number of views.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getPagesEntryCount (website_id)
Returns the number of distinct entry pages to a website.
website_id: ID of the website
getPagesEntry (website_id, limit, offset)
Returns the pages of a website which served as entry points to the site.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getPagesExit (website_id, limit, offset)
Returns the pages of a website which were the last viewed page in visit sessions.
website_id: ID of the website
limit: Maximum number of records to return
offset: Number of records to skip before the first returned
getVisitsByHour (website_id, date)
Returns the number of unique visits grouped by hour for a specific date. Only recent dates may be available.
website_id: ID of the website
date: Date
getPageViewsByHour (website_id, date)
Returns the number of page views grouped by hour for a specific date. Only recent dates may be available.
website_id: ID of the website
date: Date

