Analytics/AQS/Wikistats 2

From Wikitech
< Analytics‎ | AQS(Redirected from Analytics/AQS/Wikistats)
Jump to: navigation, search

This page documents how to access Wikistats 2 data through the Analytics Query Service API. Available metrics revolve around edits, edited-pages, editors and newly-registered-users.

The Analytics Team has taken a lot of ideas from Erik Zachte work, and we are immensely grateful for all the work Erik has put into gathering, consolidating and maintaining stats over wikimedia project for many years. For more on the differences between the two datasets, see the Analytics/AQS/Wikistats 2/Data Quality page (disclaimer: they are small!).

Quick Start

Technical Documentation: https://wikimedia.org/api/rest_v1/?doc (includes interactive examples).

Edits

Warning Caution: This metric measures edition activity, therefore it includes edits on redirects.

Get the monthly number of edits for en.wikipedia.org between January and October 2017, made by registered users on articles (pages in content namespace):

GET https://wikimedia.org/api/rest_v1/metrics/edits/aggregate/en.wikipedia/user/content/monthly/20170101/20171001

Get the daily bytes-difference (sum of the number of bytes added or removed by edits) for wikidata.org for September 2017, made by all editor-types on all page-types:

GET https://wikimedia.org/api/rest_v1/metrics/bytes-difference/net/aggregate/wikidata/all-editor-types/all-page-types/daily/20170901/20171001

Get the monthly absolute bytes-difference (sum of the absolute value of bytes changed by edits) for fr.wikisource.org for year 2016, made by bots (users belonging to bot group) on articles (pages in content namespace):

GET https://wikimedia.org/api/rest_v1/metrics/bytes-difference/absolute/aggregate/fr.wikisource.org/group-bot/content/monthly/20160101/20170101

Edited Pages

Warning Caution: This metric measures content, therefore it doesn't includes redirect pages.

Get the daily number of new edited-pages (also named pages created) for es.wikipedia.org between the 10th and the 30th of January 2015, made by all editor-types on non-content pages:

GET https://wikimedia.org/api/rest_v1/metrics/edited-pages/new/es.wikipedia/all-editor-types/non-content/daily/20150110/20150130

Get the monthly number of edited-pages for ja.wikipedia.org for 2017, made by registered users on articles (pages belonging to content namespaces), for pages all page-activity-levels (any number of edits per page):

GET https://wikimedia.org/api/rest_v1/metrics/edited-pages/aggregate/ja.wikipedia/anonymous/all-page-types/all-activity-levels/monthly/20150101/20160101

Get the monthly number of edited-pages for commons.wikimedia.org for 2015, made by anonymous users on all page-types, for pages having been edited 1 to 4 times:

GET https://wikimedia.org/api/rest_v1/metrics/edited-pages/aggregate/commons.wikimedia/anonymous/all-page-types/1..4-edits/monthly/20150101/20160101

Get the monthly top-100 most edited pages ru.wikipedia.org in January and February 2017, made by all editor-types on articles (pages belonging to content namespaces):

GET https://wikimedia.org/api/rest_v1/metrics/edited-pages/top-by-edits/ru.wikipedia/all-editor-types/content/monthly/20170101/20170301

Get the monthly top-100 pages that have been added most bytes for zh.wikipedia.org in September 2017, changed by registered editors, all page-types:

GET https://wikimedia.org/api/rest_v1/metrics/edited-pages/top-by-net-bytes-difference/zu.wikipedia/user/all-page-types/monthly/20170901/20171001

Get the monthly top-100 pages having been mostly changed in bytes forit.wikipedia.org in August 2017, changed by anonymous editors, all page-types:

GET https://wikimedia.org/api/rest_v1/metrics/edited-pages/top-by-absolute-bytes-difference/it.wikipedia/anonymous/all-page-types/monthly/20170801/20170901

Editors

Warning Caution: This metric measures editors' activity, therefore it includes edits on redirects.

Get the monthly number of editors for pl.wiktionary.org for January to August 2017, being any editor-type, and having edited any article-type between 5 and 24 times:

GET https://wikimedia.org/api/rest_v1/metrics/editors/aggregate/pl.wiktionary/all-editor-types/all-page-types/5..24-edits/monthly/20170101/20170901

Get the daily number of editors for hi.wikipedia.org for September 2017, being registered users, on articles (pages belonging to content namespaces), any activity-level:

GET https://wikimedia.org/api/rest_v1/metrics/editors/aggregate/hi.wikipedia/user/content/all-activity-levels/daily/20170901/20171001

Get the monthly top-100 editors by edits number for en.wiktionary.org in January 2017, being bots (belonging to the bot group) having edited any page-types:

GET https://wikimedia.org/api/rest_v1/metrics/editors/top-by-edits/en.wiktionary/group-bot/all-page-types/monthly/20170101/20170201

Get the monthly top-100 editors having added most bytes for de.wikivoyage.org in May 2016, being registered editors, all page-types:

GET https://wikimedia.org/api/rest_v1/metrics/editors/top-by-net-bytes-difference/de.wikivoyage/user/all-page-types/monthly/20160501/20160601

Get the monthly top-100 editors having changed most bytes forwikidata.org in September 2017, being all-editor-types, all page-types:

GET https://wikimedia.org/api/rest_v1/metrics/editors/top-by-absolute-bytes-difference/wikidata/all-editor-types/all-page-types/monthly/20170901/20171001

Newly Registered Users

Get the daily number of newly registered users for de.wikipedia.org for January 2017:

GET https://wikimedia.org/api/rest_v1/metrics/registered-users/new/de.wikipedia/daily/20170101/20170201

More Reading

Data Quality

Analytics/AQS/Wikistats 2/Data Quality

Underlying Dataset

Analytics/Data_Lake/Edits/Mediawiki_history (not public yet, includes the most detailed version of history we have been able to rebuild so far)

Data Processing Overview

Analytics/Systems/Data_Lake/Edits/Pipeline

The Analytics Query Service API (AQS)

Analytics/AQS