From d86832b6ac3ac21c3208c53ba852a0fde380ec9b Mon Sep 17 00:00:00 2001 From: apaskulin Date: Mon, 15 Jul 2024 13:00:32 -0700 Subject: [PATCH] Remove the /metrics endpoints Now that these endpoints are provided through AQS 2.0 and the REST gateway, we no longer need to include them as part of the RESTBase docs, configuration, or tests. --- config.frontend.test.yaml | 2 - config.fullstack.test.yaml | 2 - projects/v1/wikimedia.wmf.yaml | 4 - test/features/metrics.js | 47 - v1/metrics.yaml | 4026 -------------------------------- 5 files changed, 4081 deletions(-) delete mode 100644 test/features/metrics.js delete mode 100644 v1/metrics.yaml diff --git a/config.frontend.test.yaml b/config.frontend.test.yaml index e755a420d..b6447921f 100644 --- a/config.frontend.test.yaml +++ b/config.frontend.test.yaml @@ -67,8 +67,6 @@ wikimedia_project: &wikimedia_project - path: projects/v1/wikimedia.wmf.yaml options: <<: *default_options - pageviews: - host: https://wikimedia.org/api/rest_v1/metrics /{api:sys}: x-modules: - path: projects/proxy.yaml diff --git a/config.fullstack.test.yaml b/config.fullstack.test.yaml index 1206e69a0..911f5f6a7 100644 --- a/config.fullstack.test.yaml +++ b/config.fullstack.test.yaml @@ -98,8 +98,6 @@ wikimedia_project: &wikimedia_project - path: projects/v1/wikimedia.wmf.yaml options: <<: *default_options - pageviews: - host: https://wikimedia.org/api/rest_v1/metrics - path: projects/proxy.yaml options: *proxy_options /{api:sys}: diff --git a/projects/v1/wikimedia.wmf.yaml b/projects/v1/wikimedia.wmf.yaml index 06558c266..01f8b3c12 100644 --- a/projects/v1/wikimedia.wmf.yaml +++ b/projects/v1/wikimedia.wmf.yaml @@ -68,10 +68,6 @@ paths: - path: v1/mathoid.yaml options: '{{options.mathoid}}' - path: v1/common_schemas.yaml # Doesn't really matter where to mount it. - /metrics: - x-modules: - - path: v1/metrics.yaml - options: '{{options.pageviews}}' /transform: x-modules: - path: v1/transform-global.yaml diff --git a/test/features/metrics.js b/test/features/metrics.js deleted file mode 100644 index 604d3be04..000000000 --- a/test/features/metrics.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const assert = require('../utils/assert.js'); -const Server = require('../utils/server.js'); -const preq = require('preq'); -const parallel = require('mocha.parallel'); - -parallel('Metrics', function() { - this.timeout(20000); - const server = new Server(); - before(() => server.start()); - after(() => server.stop()); - - it('Should get page views per page', () => { - return preq.get({ - uri: `${server.config.baseURL('wikimedia.org')}/metrics/pageviews/per-article/en.wikipedia/all-access/all-agents/Main_Page/daily/2016010100/2016010100` - }) - .then((res) => { - assert.deepEqual(res.status, 200); - assert.deepEqual(res.headers['content-type'], 'application/json; charset=utf-8'); - assert.deepEqual(res.body, { - items: [ - { - project: 'en.wikipedia', - article: 'Main_Page', - access: 'all-access', - agent: 'all-agents', - granularity: 'daily', - timestamp: '2016010100', - views: 16357307 - } - ] - }); - }); - }); - - it('Should get top articles', () => { - return preq.get({ - uri: `${server.config.baseURL('wikimedia.org')}/metrics/pageviews/top/en.wikipedia/all-access/2016/01/01` - }) - .then((res) => { - assert.deepEqual(res.status, 200); - assert.deepEqual(res.headers['content-type'], 'application/json; charset=utf-8'); - // The response body is too big to compare, so just check the response status. - }); - }); -}); diff --git a/v1/metrics.yaml b/v1/metrics.yaml deleted file mode 100644 index 0bd328fb0..000000000 --- a/v1/metrics.yaml +++ /dev/null @@ -1,4026 +0,0 @@ -openapi: 3.0.1 -info: - version: 1.0.0-beta - title: Analytics Metrics API - description: Analytics Metrics API - termsOfService: https://github.com/wikimedia/restbase#restbase - contact: - name: Analytics - email: analytics@lists.wikimedia.org - url: https://www.mediawiki.org/wiki/Analytics - license: - name: Apache licence, v2 - url: https://www.apache.org/licenses/LICENSE-2.0 -paths: - - ######################################## - # Pageviews - ######################################## - /pageviews/per-article/{project}/{access}/{agent}/{article}/{granularity}/{start}/{end}: - get: - tags: - - Pageviews data - summary: Get pageview counts for a page. - description: | - Given a Mediawiki article and a date range, returns a daily timeseries of its pageview - counts. You can also filter by access method and/or agent type. - - - Stability: [stable](https://www.mediawiki.org/wiki/API_versioning#Stable) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - If you want to filter by project, use the domain of any Wikimedia project, - for example 'en.wikipedia.org', 'www.mediawiki.org' or 'commons.wikimedia.org'. - required: true - schema: - type: string - - name: access - in: path - description: | - If you want to filter by access method, use one of desktop, mobile-app - or mobile-web. If you are interested in pageviews regardless of access method, - use all-access. - required: true - schema: - type: string - enum: - - all-access - - desktop - - mobile-app - - mobile-web - - name: agent - in: path - description: | - If you want to filter by agent type, use one of user, automated or spider. If you are - interested in pageviews regardless of agent type, use all-agents. - required: true - schema: - type: string - enum: - - all-agents - - user - - spider - - automated - - name: article - in: path - description: | - 'The title of any article in the specified project. Any spaces should be replaced - with underscores. It also should be URI-encoded, so that non-URI-safe characters like - %, / or ? are accepted. Example: Are_You_the_One%3F'. - required: true - schema: - type: string - - name: granularity - in: path - description: | - The time unit for the response data. As of today, the only supported granularity for - this endpoint is daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD or YYYYMMDDHH - format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD or YYYYMMDDHH - format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/pageview-article' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/pageviews/per-article/{project}/{access}/{agent}/{article}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /pageviews/aggregate/{project}/{access}/{agent}/{granularity}/{start}/{end}: - get: - tags: - - Pageviews data - summary: Get pageview counts for a project. - description: | - Given a date range, returns a timeseries of pageview counts. You can filter by project, - access method and/or agent type. You can choose between daily and hourly granularity - as well. - - - Stability: [stable](https://www.mediawiki.org/wiki/API_versioning#Stable) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - If you want to filter by project, use the domain of any Wikimedia project, - for example 'en.wikipedia.org', 'www.mediawiki.org' or 'commons.wikimedia.org'. - If you are interested in all pageviews regardless of project, use all-projects. - required: true - schema: - type: string - - name: access - in: path - description: | - If you want to filter by access method, use one of desktop, mobile-app or mobile-web. - If you are interested in pageviews regardless of access method, use all-access. - required: true - schema: - type: string - enum: - - all-access - - desktop - - mobile-app - - mobile-web - - name: agent - in: path - description: | - If you want to filter by agent type, use one of user, automated or spider. If you are interested - in pageviews regardless of agent type, use all-agents. - required: true - schema: - type: string - enum: - - all-agents - - user - - spider - - automated - - name: granularity - in: path - description: | - The time unit for the response data. As of today, the supported granularities for this - endpoint are hourly, daily, and monthly. - required: true - schema: - type: string - enum: - - hourly - - daily - - monthly - - name: start - in: path - description: The timestamp of the first hour/day/month to include, in YYYYMMDDHH - format - required: true - schema: - type: string - - name: end - in: path - description: The timestamp of the last hour/day/month to include, in YYYYMMDDHH - format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/pageview-project' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/pageviews/aggregate/{project}/{access}/{agent}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: true - x-amples: - - title: Get aggregate page views - request: - params: - domain: wikimedia.org - project: en.wikipedia - access: all-access - agent: all-agents - granularity: hourly - start: 1970010100 - end: 1970010100 - response: - status: 200 - headers: - content-type: application/json - body: - items: - - project: en.wikipedia - access: all-access - agent: all-agents - granularity: hourly - timestamp: 1970010100 - views: 0 - - /pageviews/top/{project}/{access}/{year}/{month}/{day}: - get: - tags: - - Pageviews data - summary: Get the most viewed articles for a project. - description: | - Lists the 1000 most viewed articles for a given project and timespan (month or day). - You can filter by access method. - - - Stability: [stable](https://www.mediawiki.org/wiki/API_versioning#Stable) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - If you want to filter by project, use the domain of any Wikimedia project, - for example 'en.wikipedia.org', 'www.mediawiki.org' or 'commons.wikimedia.org'. - required: true - schema: - type: string - - name: access - in: path - description: | - If you want to filter by access method, use one of desktop, mobile-app or mobile-web. - If you are interested in pageviews regardless of access method, use all-access. - required: true - schema: - type: string - enum: - - all-access - - desktop - - mobile-app - - mobile-web - - name: year - in: path - description: The year of the date for which to retrieve top articles, in YYYY - format. - required: true - schema: - type: string - - name: month - in: path - description: | - The month of the date for which to retrieve top articles, in MM format. If you want - to get the top articles of a whole month, the day parameter should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top articles, in DD - format. - required: true - schema: - type: string - responses: - 200: - description: The list of top articles in the project - content: - application/json: - schema: - $ref: '#/components/schemas/pageview-tops' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/pageviews/top/{project}/{access}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /pageviews/top-by-country/{project}/{access}/{year}/{month}: - get: - tags: - - Pageviews data - summary: Get pageviews by country and access method. - description: | - Lists the pageviews to this project, split by country of origin for a given month. - Because of privacy reasons, pageviews are given in a bucketed format, and countries - with less than 100 views do not get reported. - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - If you want to filter by project, use the domain of any Wikimedia project, - for example 'en.wikipedia.org', 'www.mediawiki.org' or 'commons.wikimedia.org'. - required: true - schema: - type: string - - name: access - in: path - description: | - If you want to filter by access method, use one of desktop, mobile-app or mobile-web. - If you are interested in pageviews regardless of access method, use all-access. - required: true - schema: - type: string - enum: - - all-access - - desktop - - mobile-app - - mobile-web - - name: year - in: path - description: The year of the date for which to retrieve top countries, in - YYYY format. - required: true - schema: - type: string - - name: month - in: path - description: | - The month of the date for which to retrieve top countries, in MM format. - required: true - schema: - type: string - responses: - 200: - description: The list of top countries by pageviews in the project - content: - application/json: - schema: - $ref: '#/components/schemas/by-country' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/pageviews/top-by-country/{project}/{access}/{year}/{month}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /pageviews/top-per-country/{country}/{access}/{year}/{month}/{day}: - get: - tags: - - Pageviews data - summary: Get the most viewed articles for a country. - description: | - Lists the 1000 most viewed articles for a given country and date, across all projects. - You can filter by access method. - Because of privacy reasons, pageview counts are given in a bounded format and are not reported for certain countries. - Furthermore, articles visited by 1000 unique individuals or fewer on the given date will be excluded from the returned data. - Also, views produced by agents categorized as bots or web crawlers will be excluded from all calculations. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: country - in: path - description: The ISO 3166-1 alpha-2 code of a country for which to retrieve top articles, like 'FR' or 'IN'. - required: true - schema: - type: string - - name: access - in: path - description: | - If you want to filter by access method, use one of desktop, mobile-app or mobile-web. - If you are interested in pageviews regardless of access method, use all-access. - required: true - schema: - type: string - enum: - - all-access - - desktop - - mobile-app - - mobile-web - - name: year - in: path - description: The year for which to retrieve top articles, in YYYY format. - required: true - schema: - type: string - - name: month - in: path - description: The month for which to retrieve top articles, in MM format. - required: true - schema: - type: string - - name: day - in: path - description: The day for which to retrieve top articles, in DD format. - required: true - schema: - type: string - responses: - 200: - description: The list of top articles by pageviews in the country. - content: - application/json: - schema: - $ref: '#/components/schemas/per-country' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/pageviews/top-per-country/{country}/{access}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - ######################################## - # Unique Devices - ######################################## - /unique-devices/{project}/{access-site}/{granularity}/{start}/{end}: - get: - tags: - - Unique devices data - summary: Get unique devices count per project - description: | - Given a project and a date range, returns a timeseries of unique devices counts. - You need to specify a project, and can filter by accessed site (mobile or desktop). - You can choose between daily and monthly granularity as well. - - - Stability: [stable](https://www.mediawiki.org/wiki/API_versioning#Stable) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - If you want to filter by project, use the domain of any Wikimedia project, - for example 'en.wikipedia.org', 'www.mediawiki.org' or 'commons.wikimedia.org'. - For data grouped by project family, use all-[family]-projects - (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: access-site - in: path - description: | - If you want to filter by accessed site, use one of desktop-site or mobile-site. - If you are interested in unique devices regardless of accessed site, use or all-sites. - required: true - schema: - type: string - enum: - - all-sites - - desktop-site - - mobile-site - - name: granularity - in: path - description: | - The time unit for the response data. As of today, the supported granularities - for this endpoint are daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The timestamp of the first day/month to include, in YYYYMMDD - format - required: true - schema: - type: string - - name: end - in: path - description: The timestamp of the last day/month to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/unique-devices' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/unique-devices/{project}/{access-site}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - ######################################## - # Legacy - ######################################## - /legacy/pagecounts/aggregate/{project}/{access-site}/{granularity}/{start}/{end}: - get: - tags: - - Legacy data - description: | - Given a project and a date range, returns a timeseries of pagecounts. - You can filter by access site (mobile or desktop) and you can choose between monthly, - daily and hourly granularity as well. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. - required: true - schema: - type: string - - name: access-site - in: path - description: If you want to filter by access site, use one of desktop-site - or mobile-site. If you are interested in pagecounts regardless of access - site use all-sites. - required: true - schema: - type: string - enum: - - all-sites - - desktop-site - - mobile-site - - name: granularity - in: path - description: | - The time unit for the response data. As of today, the supported granularities for - this endpoint are hourly, daily and monthly. - required: true - schema: - type: string - enum: - - hourly - - daily - - monthly - - name: start - in: path - description: The timestamp of the first hour/day/month to include, in YYYYMMDDHH - format. - required: true - schema: - type: string - - name: end - in: path - description: | - The timestamp of the last hour/day/month to include, in YYYYMMDDHH format. - In hourly and daily granularities this value is inclusive, in the monthly granularity - this value is exclusive. - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/pagecounts-project' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/legacy/pagecounts/aggregate/{project}/{access-site}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - ######################################## - # Edited Pages - ######################################## - /edited-pages/new/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}: - get: - tags: - - Edited pages data - summary: Get new pages counts for a project. - description: | - Given a Mediawiki project and a date range, returns a timeseries of its new pages counts. - You can filter by editor type (all-editor-types, anonymous, group-bot, name-bot, user) - or page-type (all-page-types, content or non-content). You can choose between daily and - monthly granularity as well. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. - For projects like www.mediawiki.org, you can use that full string, or just use - mediawiki or mediawiki.org. For data from all projects, use all-projects. For - data grouped by project family, use all-[family]-projects (for example: - all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging - to the bot group but having bot-like names) or user (registered account not in bot - group nor having bot-like name). If you are interested in edits regardless of - their editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (new pages in content - namespaces) or non-content (new pages in non-content namespaces). If you are - interested in new-articles regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: granularity - in: path - description: | - The time unit for the response data. As of today, supported values are - daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/new-pages' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/edited-pages/new/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /edited-pages/aggregate/{project}/{editor-type}/{page-type}/{activity-level}/{granularity}/{start}/{end}: - get: - tags: - - Edited pages data - summary: Get edited-pages counts for a project. - description: | - Given a Mediawiki project and a date range, returns a timeseries of its edited-pages counts. - You can filter by editor-type (all-editor-types, anonymous, group-bot, name-bot, user), - page-type (all-page-types, content or non-content) or activity-level (1..4-edits, - 5..24-edits, 25..99-edits, 100..-edits). You can choose between daily and monthly - granularity as well. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. - For projects like www.mediawiki.org, you can use that full string, or just use - mediawiki or mediawiki.org. - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edited-pages in content - namespaces) or non-content (edited-pages in non-content namespaces). If you are - interested in edited-pages regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: activity-level - in: path - description: | - If you want to filter by activity-level, use one of 1..4-edits, 5..24-edits, - 25..99-edits or 100..-edits. If you are interested in edited-pages regardless - of their activity level, use all-activity-levels. - required: true - schema: - type: string - enum: - - all-activity-levels - - 1..4-edits - - 5..24-edits - - 25..99-edits - - 100..-edits - - name: granularity - in: path - description: | - The time unit for the response data. As of today, supported values are - daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/edited-pages' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/edited-pages/aggregate/{project}/{editor-type}/{page-type}/{activity-level}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /edited-pages/top-by-edits/{project}/{editor-type}/{page-type}/{year}/{month}/{day}: - get: - tags: - - Edited pages data - summary: Get top 100 edited-pages by edits count. - description: | - Given a Mediawiki project and a date (day or month), returns a timeseries of the top - 100 edited-pages by edits count. You can filter by editor-type (all-editor-types, - anonymous, group-bot, name-bot, user) or page-type (all-page-types, content or - non-content). - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: year - in: path - description: The year of the date for which to retrieve top edited-pages, - in YYYY format. - required: true - schema: - type: string - - name: month - in: path - description: The month of the date for which to retrieve top edited-pages, - in MM format. If you want to get the top edited-pages of a whole month, - the day parameter should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top edited-pages, in - DD format, or all-days for a monthly value. - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/top-edited-pages-by-edits' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/edited-pages/top-by-edits/{project}/{editor-type}/{page-type}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /edited-pages/top-by-net-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}: - get: - tags: - - Edited pages data - summary: Get top 100 edited-pages by net bytes-difference. - description: | - Given a Mediawiki project and a date (day or month), returns a timeseries of the top 100 - edited-pages by net bytes-difference. You can filter by editor-type (all-editor-types, - anonymous, group-bot, name-bot, user) or page-type (all-page-types, content or non-content). - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: year - in: path - description: The year of the date for which to retrieve top edited-pages, - in YYYY format. - required: true - schema: - type: string - - name: month - in: path - description: The month of the date for which to retrieve top edited-pages, - in MM format. If you want to get the top edited-pages of a whole month, - the day parameter should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top edited-pages, in - DD format, or all-days for a monthly value. - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/top-edited-pages-by-net-bytes-diff' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/edited-pages/top-by-net-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /edited-pages/top-by-absolute-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}: - get: - tags: - - Edited pages data - summary: Get top 100 edited-pages by absolute bytes-difference. - description: | - Given a Mediawiki project and a date (day or month), returns a timeseries of the top 100 - edited-pages by absolute bytes-difference. You can filter by editor-type (all-editor-types, - anonymous, group-bot, name-bot, user) or page-type (all-page-types, content or non-content). - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: year - in: path - description: The year of the date for which to retrieve top edited-pages, - in YYYY format. - required: true - schema: - type: string - - name: month - in: path - description: The month of the date for which to retrieve top edited-pages, - in MM format. If you want to get the top edited-pages of a whole month, - the day parameter should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top edited-pages, in - DD format, or all-days for a monthly value. - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/top-edited-pages-by-abs-bytes-diff' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/edited-pages/top-by-absolute-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - - ######################################## - # Editors - ######################################## - /editors/aggregate/{project}/{editor-type}/{page-type}/{activity-level}/{granularity}/{start}/{end}: - get: - tags: - - Editors data - summary: Get editors counts for a project. - description: | - Given a Mediawiki project and a date range, returns a timeseries of its editors counts. - You can filter by editory-type (all-editor-types, anonymous, group-bot, name-bot, user), - page-type (all-page-types, content or non-content) or activity-level (1..4-edits, - 5..24-edits, 25..99-edits or 100..-edits). You can choose between daily and monthly - granularity as well. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. - For projects like www.mediawiki.org, you can use that full string, or just use - mediawiki or mediawiki.org. - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging - to the bot group but having bot-like names) or user (registered account not in bot - group nor having bot-like name). If you are interested in edits regardless - of their editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits made in content - namespaces) or non-content (edits made in non-content namespaces). If you are - interested in editors regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: activity-level - in: path - description: | - If you want to filter by activity-level, use one of 1..4-edits, 5..24-edits, - 25..99-edits or 100..-edits. If you are interested in editors regardless - of their activity-level, use all-activity-levels. - required: true - schema: - type: string - enum: - - all-activity-levels - - 1..4-edits - - 5..24-edits - - 25..99-edits - - 100..-edits - - name: granularity - in: path - description: | - The time unit for the response data. As of today, supported values are - daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/editors' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/editors/aggregate/{project}/{editor-type}/{page-type}/{activity-level}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /editors/top-by-edits/{project}/{editor-type}/{page-type}/{year}/{month}/{day}: - get: - tags: - - Editors data - summary: Get top 100 editors by edits count. - description: | - Given a Mediawiki project and a date (day or month), returns a timeseries of the top - 100 editors by edits count. You can filter by editor-type (all-editor-types, - anonymous, group-bot, name-bot, user) or page-type (all-page-types, content or - non-content). The user_text returned is either the mediawiki user_text if the user is - registered, or null if user is anonymous. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: year - in: path - description: The year of the date for which to retrieve top editors, in YYYY - format. - required: true - schema: - type: string - - name: month - in: path - description: The month of the date for which to retrieve top editors, in MM - format. If you want to get the top editors of a whole month, the day parameter - should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top editors, in DD - format, or all-days for a monthly value. - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/top-editors-by-edits' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/editors/top-by-edits/{project}/{editor-type}/{page-type}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /editors/top-by-net-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}: - get: - tags: - - Editors data - summary: Get top 100 editors by net bytes-difference. - description: | - Given a Mediawiki project and a date (day or month), returns a timeseries of the top 100 - editors by net bytes-difference. You can filter by editor-type (all-editor-types, anonymous, - group-bot, name-bot, user) or page-type (all-page-types, content or non-content). The - user_text returned is either the mediawiki user_text if the user is registered, or - null if user is anonymous. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: year - in: path - description: The year of the date for which to retrieve top editors, in YYYY - format. - required: true - schema: - type: string - - name: month - in: path - description: The month of the date for which to retrieve top editors, in MM - format. If you want to get the top editors of a whole month, the day parameter - should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top editors, in DD - format, or all-days for a monthly value. - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/top-editors-by-net-bytes-diff' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/editors/top-by-net-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /editors/top-by-absolute-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}: - get: - tags: - - Editors data - summary: Get top 100 editors by absolute bytes-difference. - description: | - Given a Mediawiki project and a date (day or month), returns a timeseries of the top 100 - editors by absolute bytes-difference. You can filter by editor-type (all-editor-types, - anonymous, group-bot, name-bot, user) or page-type (all-page-types, content or non-content). - The user_text returned is either the mediawiki user_text if the user is registered, or - null if user is anonymous. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: year - in: path - description: The year of the date for which to retrieve top editors, in YYYY - format. - required: true - schema: - type: string - - name: month - in: path - description: The month of the date for which to retrieve top editors, in MM - format. If you want to get the top editors of a whole month, the day parameter - should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top editors, in DD - format, or all-days for a monthly value. - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/top-editors-by-abs-bytes-diff' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/editors/top-by-absolute-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - - ######################################## - # Edits - ######################################## - /edits/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}: - get: - tags: - - Edits data - summary: Get edits counts for a project. - description: | - Given a Mediawiki project and a date range, returns a timeseries of edits counts. - You can filter by editors-type (all-editor-types, anonymous, bot, registered) and - page-type (all-page-types, content or non-content). You can choose between daily and - monthly granularity as well. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. - For projects like www.mediawiki.org, you can use that full string, or just use - mediawiki or mediawiki.org. For data from all projects, use all-projects. For data - grouped by project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging - to the bot group but having bot-like names) or user (registered account not in bot - group nor having bot-like name). If you are interested in edits regardless - of their editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: granularity - in: path - description: | - The time unit for the response data. As of today, supported values are - daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/edits' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/edits/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /edits/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}: - get: - tags: - - Edits data - summary: Get edit counts for a page in a project. - description: | - Given a Mediawiki project, a page-title prefixed with its canonical namespace (for - instance 'User:Jimbo_Wales') and a date range, returns a timeseries of edit counts. - You can filter by editors-type (all-editor-types, anonymous, group-bot, name-bot, user). - You can choose between daily and monthly granularity as well. - - Note: Due to performance of the data-serving backend, this endpoint limits the queryable - timespan to one year (whether in daily or monthly granularity). - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 5 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. - required: true - schema: - type: string - - name: page-title - in: path - description: | - The page-title to request edits for. It should be prefixed with canonical namespace. - Spaces will be converted to underscores. - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: granularity - in: path - description: | - Time unit for the response data. As of today, supported values are daily and monthly - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/edits-per-page' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 5 - external: 5 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/edits/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - -#################################################### -# Commented because of https://meta.wikimedia.org/wiki/Requests_for_comment/X!%27s_Edit_Counter -# This RfC results in per-editor monthly stats should be opt-in -# https://phabricator.wikimedia.org/T203826 -#################################################### -# -# /edits/per-editor/{project}/{user-text}/{page-type}/{granularity}/{start}/{end}: -# get: -# tags: -# - Edits data -# summary: Get the edits counts for an editor in a project. -# description: | -# Given a Mediawiki project, a user-text and a date range, returns a timeseries of edits -# counts. You can filter by page type (all-page-types, content or non-content). You can -# choose between daily and monthly granularity as well. -# -# - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) -# - Rate limit: 25 req/s -# - License: Data accessible via this endpoint is available under the -# [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). -# produces: -# - application/json -# - application/problem+json -# parameters: -# - name: project -# in: path -# description: | -# The name of any Wikimedia project formatted like {language code}.{project name}, -# for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped -# off. For projects like commons without language codes, use commons.wikimedia. For -# projects like www.mediawiki.org, you can use that full string, or just use mediawiki -# or mediawiki.org. -# type: string -# required: true -# - name: user-text -# in: path -# description: | -# The user you want to get edits for. Can be either a registered user-name, or an -# anonymous user IP. -# type: string -# required: true -# - name: page-type -# in: path -# description: | -# If you want to filter by page-type, use one of content (edits on pages in content -# namespaces) or non-content (edits on pages in non-content namespaces). If you are -# interested in edits regardless of their page-type, use all-page-types. -# type: string -# enum: ['all-page-types', 'content', 'non-content'] -# required: true -# - name: granularity -# in: path -# description: | -# Time unit for the response data. As of today, supported values are daily and monthly -# type: string -# enum: ['daily', 'monthly'] -# required: true -# - name: start -# in: path -# description: The date of the first day to include, in YYYYMMDD format -# type: string -# required: true -# - name: end -# in: path -# description: The date of the last day to include, in YYYYMMDD format -# type: string -# required: true -# responses: -# '200': -# description: The list of values -# schema: -# $ref: '#/definitions/edits-per-editor' -# default: -# description: Error -# schema: -# $ref: '#/definitions/problem' -# x-route-filters: -# - type: default -# name: ratelimit_route -# options: -# limits: -# internal: 25 -# external: 25 -# x-request-handler: -# - get_from_backend: -# request: -# uri: '{{options.host}}/edits/per-editor/{project}/{user-text}/{page-type}/{granularity}/{start}/{end}' -# headers: -# x-client-ip: '{{x-client-ip}}' -# agentOptions: -# keepAlive: true -# x-monitor: false - - - ######################################## - # Registered Users - ######################################## - /registered-users/new/{project}/{granularity}/{start}/{end}: - get: - tags: - - Registered users data - summary: Get newly registered users counts for a project. - description: | - Given a Mediawiki project and a date range, returns a timeseries of its newly registered - users counts. You can choose between daily and monthly granularity. The newly registered - users value is computed with self-created users only, not auto-login created ones. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. - For projects like www.mediawiki.org, you can use that full string, or just use - mediawiki or mediawiki.org. For data from all projects, use all-projects. For data - grouped by project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: granularity - in: path - description: | - The time unit for the response data. As of today, supported values are - daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/new-registered-users' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/registered-users/new/{project}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - - ######################################## - # Net Bytes difference - ######################################## - /bytes-difference/net/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}: - get: - tags: - - Bytes difference data - summary: Get the sum of net text bytes difference between current edit and previous - one. - description: | - Given a Mediawiki project and a date range, returns a timeseries of bytes difference net - sums. You can filter by editors-type (all-editor-types, anonymous, group-bot, name-bot, - user) and page-type (all-page-types, content or non-content). You can choose between - daily and monthly granularity as well. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: granularity - in: path - description: | - Time unit for the response data. As of today, supported values are daily and monthly - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/net-bytes-difference' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/bytes-difference/net/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /bytes-difference/net/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}: - get: - tags: - - Bytes difference data - summary: Get the sum of net text bytes difference per page. - description: | - Given a Mediawiki project, a page-title prefixed with canonical namespace (for - instance 'User:Jimbo_Wales') and a date range, returns a timeseries of bytes - difference net sums. You can filter by editors-type (all-editor-types, anonymous, - group-bot, name-bot, user). You can choose between daily and monthly granularity as well. - - Note: Due to performance of the data-serving backend, this endpoint limits the queryable - timespan to one year (whether in daily or monthly granularity). - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. - required: true - schema: - type: string - - name: page-title - in: path - description: | - The page-title to request net bytes-difference for. Should be prefixed with the - page canonical namespace. - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: granularity - in: path - description: | - Time unit for the response data. As of today, supported values are daily and monthly - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/net-bytes-difference-per-page' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/bytes-difference/net/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - -#################################################### -# Commented because of https://meta.wikimedia.org/wiki/Requests_for_comment/X!%27s_Edit_Counter -# This RfC results in per-editor monthly stats should be opt-in -# https://phabricator.wikimedia.org/T203826 -#################################################### -# /bytes-difference/net/per-editor/{project}/{user-text}/{page-type}/{granularity}/{start}/{end}: -# get: -# tags: -# - Bytes difference data -# summary: Get the sum of net text bytes difference per editor. -# description: | -# Given a Mediawiki project, an user-text and a date range, returns a timeseries of bytes -# difference net sums. You can filter by page-type (all-page-types, content, non-content). -# You can choose between daily and monthly granularity as well. -# -# - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) -# - Rate limit: 25 req/s -# - License: Data accessible via this endpoint is available under the -# [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). -# produces: -# - application/json -# - application/problem+json -# parameters: -# - name: project -# in: path -# description: | -# The name of any Wikimedia project formatted like {language code}.{project name}, -# for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped -# off. For projects like commons without language codes, use commons.wikimedia. For -# projects like www.mediawiki.org, you can use that full string, or just use mediawiki -# or mediawiki.org. -# type: string -# required: true -# - name: user-text -# in: path -# description: | -# The user-text to request net bytes-difference for. Can be either a registered -# user-name or an anonymous user IP. -# type: string -# required: true -# - name: page-type -# in: path -# description: | -# If you want to filter by page-type, use one of content (edits on pages in content -# namespaces) or non-content (edits on pages in non-content namespaces). If you are -# interested in edits regardless of their page-type, use all-page-types. -# type: string -# enum: ['all-page-types', 'content', 'non-content'] -# required: true -# - name: granularity -# in: path -# description: | -# Time unit for the response data. As of today, supported values are daily and monthly -# type: string -# enum: ['daily', 'monthly'] -# required: true -# - name: start -# in: path -# description: The date of the first day to include, in YYYYMMDD format -# type: string -# required: true -# - name: end -# in: path -# description: The date of the last day to include, in YYYYMMDD format -# type: string -# required: true -# responses: -# '200': -# description: The list of values -# schema: -# $ref: '#/definitions/net-bytes-difference-per-editor' -# default: -# description: Error -# schema: -# $ref: '#/definitions/problem' -# x-route-filters: -# - type: default -# name: ratelimit_route -# options: -# limits: -# internal: 25 -# external: 25 -# x-request-handler: -# - get_from_backend: -# request: -# uri: '{{options.host}}/bytes-difference/net/per-editor/{project}/{user-text}/{page-type}/{granularity}/{start}/{end}' -# headers: -# x-client-ip: '{{x-client-ip}}' -# agentOptions: -# keepAlive: true -# x-monitor: false - - - ######################################## - # Absolute Bytes difference - ######################################## - /bytes-difference/absolute/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}: - get: - tags: - - Bytes difference data - summary: | - Get the sum of absolute value of text bytes difference between current edit and - previous one. - description: | - Given a Mediawiki project and a date range, returns a timeseries of absolute bytes - difference sums. You can filter by editors-type (all-editor-types, anonymous, group-bot, - name-bot, user) and page-type (all-page-types, content, non-content). You can choose - between daily and monthly granularity as well. - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. For data from all projects, use all-projects. For data grouped by - project family, use all-[family]-projects (for example: all-wikipedia-projects). - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: page-type - in: path - description: | - If you want to filter by page-type, use one of content (edits on pages in content - namespaces) or non-content (edits on pages in non-content namespaces). If you are - interested in edits regardless of their page-type, use all-page-types. - required: true - schema: - type: string - enum: - - all-page-types - - content - - non-content - - name: granularity - in: path - description: | - Time unit for the response data. As of today, supported values are daily and monthly - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/absolute-bytes-difference' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/bytes-difference/absolute/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /bytes-difference/absolute/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}: - get: - tags: - - Bytes difference data - summary: Get the sum of absolute text bytes difference per page. - description: | - Given a Mediawiki project, a page-title prefixed with canonical namespace (for - instance 'User:Jimbo_Wales') and a date range, returns a timeseries of bytes - difference absolute sums. You can filter by editors-type (all-editor-types, anonymous, - group-bot, name-bot, user). You can choose between daily and monthly granularity as well. - - Note: Due to performance of the data-serving backend, this endpoint limits the queryable - timespan to one year (whether in daily or monthly granularity). - - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 25 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: project - in: path - description: | - The name of any Wikimedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. For projects like commons without language codes, use commons.wikimedia. For - projects like www.mediawiki.org, you can use that full string, or just use mediawiki - or mediawiki.org. - required: true - schema: - type: string - - name: page-title - in: path - description: | - The page-title to request absolute bytes-difference for. Should be prefixed with the - page canonical namespace. - required: true - schema: - type: string - - name: editor-type - in: path - description: | - If you want to filter by editor-type, use one of anonymous, group-bot (registered - accounts belonging to the bot group), name-bot (registered accounts not belonging to - the bot group but having bot-like names) or user (registered account not in bot group - nor having bot-like name). If you are interested in edits regardless of their - editor-type, use all-editor-types. - required: true - schema: - type: string - enum: - - all-editor-types - - anonymous - - group-bot - - name-bot - - user - - name: granularity - in: path - description: | - Time unit for the response data. As of today, supported values are daily and monthly - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/absolute-bytes-difference-per-page' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 25 - external: 25 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/bytes-difference/absolute/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - -#################################################### -# Commented because of https://meta.wikimedia.org/wiki/Requests_for_comment/X!%27s_Edit_Counter -# This RfC results in per-editor monthly stats should be opt-in -# https://phabricator.wikimedia.org/T203826 -#################################################### -# /bytes-difference/absolute/#tor/{project}/{user-text}/{page-type}/{granularity}/{start}/{end}: -# get: -# tags: -# - Bytes difference data -# summary: Get the sum of absolute text bytes difference per editor. -# description: | -# Given a Mediawiki project, an user_text and a date range, returns a timeseries of bytes -# difference absolute sums. You can filter by page-type (all-page-types, content, -# non-content). You can choose between daily and monthly granularity as well. -# -# - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) -# - Rate limit: 25 req/s -# - License: Data accessible via this endpoint is available under the -# [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). -# produces: -# - application/json -# - application/problem+json -# parameters: -# - name: project -# in: path -# description: | -# The name of any Wikimedia project formatted like {language code}.{project name}, -# for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped -# off. For projects like commons without language codes, use commons.wikimedia. For -# projects like www.mediawiki.org, you can use that full string, or just use mediawiki -# or mediawiki.org. -# type: string -# required: true -# - name: user-text -# in: path -# description: | -# The user-text to request absolute bytes-difference for. Can be either a registered -# user-name or an anonymous user IP. -# type: string -# required: true -# - name: page-type -# in: path -# description: | -# If you want to filter by page-type, use one of content (edits on pages in content -# namespaces) or non-content (edits on pages in non-content namespaces). If you are -# interested in edits regardless of their page-type, use all-page-types. -# type: string -# enum: ['all-page-types', 'content', 'non-content'] -# required: true -# - name: granularity -# in: path -# description: | -# Time unit for the response data. As of today, supported values are daily and monthly -# type: string -# enum: ['daily', 'monthly'] -# required: true -# - name: start -# in: path -# description: The date of the first day to include, in YYYYMMDD format -# type: string -# required: true -# - name: end -# in: path -# description: The date of the last day to include, in YYYYMMDD format -# type: string -# required: true -# responses: -# '200': -# description: The list of values -# schema: -# $ref: '#/definitions/absolute-bytes-difference-per-editor' -# default: -# description: Error -# schema: -# $ref: '#/definitions/problem' -# x-route-filters: -# - type: default -# name: ratelimit_route -# options: -# limits: -# internal: 25 -# external: 25 -# x-request-handler: -# - get_from_backend: -# request: -# uri: '{{options.host}}/bytes-difference/absolute/per-editor/{project}/{user-text}/{page-type}/{granularity}/{start}/{end}' -# headers: -# x-client-ip: '{{x-client-ip}}' -# agentOptions: -# keepAlive: true -# x-monitor: false - /mediarequests/aggregate/{referer}/{media_type}/{agent}/{granularity}/{start}/{end}: - get: - tags: - - Mediarequests data - summary: Get aggregated mediarequest counts per referer. - description: | - Given a date range, returns a timeseries of mediarequest counts. You can filter by referer, media types and/or agent type. You can choose between daily and monthly granularity. - counts. The data can be filtered by agent type. - - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: referer - in: path - description: | - The place that the request was made from. It can be any Wikimedia project (e.g. de.wikipedia), - "all-referers", "internal", "external", "search-engine", "unknown" or "none". - required: true - schema: - type: string - - name: media_type - in: path - description: | - The media type that each file belongs to. It can be image, audio, video, document, or other. Use 'all-media-types if you want all.' - required: true - schema: - type: string - enum: - - all-media-types - - image - - video - - audio - - document - - other - - name: agent - in: path - description: | - If you want to filter by agent type, use one of user or spider. If you are interested - in mediarequests regardless of agent type, use all-agents. - required: true - schema: - type: string - enum: - - all-agents - - user - - spider - - name: granularity - in: path - description: | - The time unit for the response data. As of today, the supported granularities for this - endpoint are daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The timestamp of the first hour/day/month to include, in YYYYMMDD - format - required: true - schema: - type: string - - name: end - in: path - description: The timestamp of the last hour/day/month to include, in YYYYMMDD - format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/mediarequest-referer' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/mediarequests/aggregate/{referer}/{media_type}/{agent}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: true - x-amples: - - title: Get aggregate mediarequests - request: - params: - domain: wikimedia.org - referer: en.wikipedia - media_type: all-media-types - agent: all-agents - granularity: daily - start: 1970010100 - end: 1970010100 - response: - status: 200 - headers: - content-type: application/json - body: - items: - - referer: en.wikipedia - media_type: all-media-types - agent: all-agents - granularity: daily - timestamp: 1970010100 - requests: 0 - - /mediarequests/per-file/{referer}/{agent}/{file_path}/{granularity}/{start}/{end}: - get: - tags: - - Mediarequests data - summary: Get aggregated mediarequest counts for a media file. - description: | - Given a file stored in upload.wikimedia.org (the file storage for all media in any wiki) and a date range, - returns a daily timeseries of its request counts. The data can be filtered by agent type. - - - Stability: [stable](https://www.mediawiki.org/wiki/API_versioning#Stable) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: referer - in: path - description: | - The place that the request was made from. It can be any Wikimedia project (e.g. de.wikipedia), "all-referers", - "internal", "external", "search-engine", "unknown" or "none". - required: true - schema: - type: string - - name: agent - in: path - description: | - If you want to filter by agent type, use one of user or spider. If you are interested - in media requests regardless of agent type, use all-agents. - required: true - schema: - type: string - enum: - - all-agents - - user - - spider - - name: file_path - in: path - description: | - The upload.wikimedia.org (the file storage for all media in any wiki) path to the file. It also should - be URI-encoded, so that non-URI-safe characters like %, / or ? are accepted. - Example: %2Fwiktionary%2Fte%2F4%2F40%2Fpeacocks.JPG - required: true - schema: - type: string - - name: granularity - in: path - description: | - The time unit for the response data. As of today, the only supported granularity for - this endpoint is daily and monthly. - required: true - schema: - type: string - enum: - - daily - - monthly - - name: start - in: path - description: The date of the first day to include, in YYYYMMDD or YYYYMMDDHH - format - required: true - schema: - type: string - - name: end - in: path - description: The date of the last day to include, in YYYYMMDD or YYYYMMDDHH - format - required: true - schema: - type: string - responses: - 200: - description: The list of values - content: - application/json: - schema: - $ref: '#/components/schemas/mediarequest-file' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/mediarequests/per-file/{referer}/{agent}/{file_path}/{granularity}/{start}/{end}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /mediarequests/top/{referer}/{media_type}/{year}/{month}/{day}: - get: - tags: - - Mediarequests data - summary: Get the most requested files for a referer. - description: | - Lists the 1000 most requested files for a given referer and timespan (month or day). You can filter by access method. - - Stability: [stable](https://www.mediawiki.org/wiki/API_versioning#Stable) - - Rate limit: 100 req/s - - License: Data accessible via this endpoint is available under the - [CC0 1.0 license](https://creativecommons.org/publicdomain/zero/1.0/). - parameters: - - name: referer - in: path - description: | - The place that the request was made from. Non Wikimedia projects appear aggreggated under the classification "external". - It can be any Wikimedia project (e.g. de.wikipedia), "all-referers", "internal", "external", "search-engine", "unknown" or "none". - required: true - schema: - type: string - - name: media_type - in: path - description: | - The media type that each file belongs to. It can be image, audio, video, document, or other. Use 'all-media-types if you want all.' - required: true - schema: - type: string - enum: - - all-media-types - - image - - video - - audio - - document - - other - - name: year - in: path - description: The year of the date for which to retrieve top files, in YYYY - format. - required: true - schema: - type: string - - name: month - in: path - description: | - The month of the date for which to retrieve top files, in MM format. If you want - to get the top files of a whole month, the day parameter should be all-days. - required: true - schema: - type: string - - name: day - in: path - description: The day of the date for which to retrieve top files, in DD - format. - required: true - schema: - type: string - responses: - 200: - description: The list of top files in the project - content: - application/json: - schema: - $ref: '#/components/schemas/mediarequest-tops' - default: - description: Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/mediarequests/top/{referer}/{media_type}/{year}/{month}/{day}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - /editors/by-country/{project}/{activity-level}/{year}/{month}: - get: - tags: - - Editors data - summary: Get editor counts by country. - description: | - Given a Wikipedia project, an activity level, and a month, returns the upper bounds of - the editor counts, split by country of origin. Because of privacy reasons, editor counts - are given in a bounded format and are not reported for certain countries or for inactive - Wikipedias. Read more about privacy considerations - [here](https://wikitech.wikimedia.org/wiki/Analytics/Data_Lake/Edits/Geoeditors/Public#Privacy). - Stability: [experimental](https://www.mediawiki.org/wiki/API_versioning#Experimental) - parameters: - - name: project - in: path - description: | - The name of any Wikipedia project formatted like {language code}.{project name}, - for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped - off. Non-Wikipedia projects are not available for this endpoint. - schema: - type: string - required: true - - name: activity-level - in: path - description: | - Use either '5..99-edits' or '100..-edits' for activity level filtering. - Counts for 0..4-edits are not available due to privacy reasons. - schema: - type: string - enum: ['5..99-edits', '100..-edits'] - required: true - - name: year - in: path - description: The year of the date for which to retrieve editor counts, in YYYY format. - schema: - type: string - required: true - - name: month - in: path - description: The month of the date for which to retrieve editor counts, in MM format. - schema: - type: string - required: true - responses: - '200': - description: The list of values - content: - 'application/json': - schema: - $ref: '#/definitions/editors-by-country' - default: - description: Error - content: - 'application/json': - schema: - $ref: '#/definitions/problem' - x-route-filters: - - type: default - name: ratelimit_route - options: - limits: - internal: 100 - external: 100 - x-request-handler: - - get_from_backend: - request: - uri: '{{options.host}}/editors/by-country/{project}/{activity-level}/{year}/{month}' - headers: - x-client-ip: '{{x-client-ip}}' - agentOptions: - keepAlive: true - x-monitor: false - - -######################################## -# Components -######################################## -components: - schemas: - listing: - description: The result format for listings - required: - - items - type: object - properties: - items: - type: array - items: - type: string - - pageview-article: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - access: - type: string - article: - type: string - agent: - type: string - granularity: - type: string - timestamp: - type: string - views: - type: integer - format: int64 - - pageview-project: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - access: - type: string - agent: - type: string - granularity: - type: string - timestamp: - # the hourly timestamp will be stored as YYYYMMDDHH - type: string - views: - type: integer - format: int64 - - pageview-tops: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - access: - type: string - year: - type: string - month: - type: string - day: - type: string - articles: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - article: - type: string - views: - type: integer - format: int64 - - by-country: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - access: - type: string - year: - type: string - month: - type: string - countries: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - country: - type: string - views: - type: integer - format: int64 - - per-country: - type: object - properties: - items: - type: array - items: - type: object - properties: - country: - type: string - access: - type : string - year: - type: string - month: - type: string - day: - type: string - articles: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - article: - type: string - project: - type: string - views_ceil: - type: integer - format: int64 - - unique-devices: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - access-site: - type: string - granularity: - type: string - timestamp: - # the daily timestamp will be stored as YYYYMMDD - type: string - devices: - type: integer - format: int64 - offset: - type: integer - format: int64 - underestimate: - type: integer - format: int64 - - pagecounts-project: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - access-site: - type: string - granularity: - type: string - timestamp: - type: string - count: - type: integer - format: int64 - - ## Edited Pages - new-pages: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - new_pages: - type: integer - format: int32 - - edited-pages: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - activity-level: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - edited_pages: - type: integer - format: int32 - - top-edited-pages-by-edits: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - top: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - page_title: - type: string - edits: - type: integer - format: int64 - - top-edited-pages-by-net-bytes-diff: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - top: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - page_title: - type: string - net_bytes_diff: - type: integer - format: int64 - - top-edited-pages-by-abs-bytes-diff: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - top: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - page_title: - type: string - abs_bytes_diff: - type: integer - format: int64 - - ## Editors - editors: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - activity-level: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - editors: - type: integer - format: int32 - - top-editors-by-edits: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - top: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - user_text: - type: string - edits: - type: integer - format: int64 - - top-editors-by-net-bytes-diff: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - top: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - user_text: - type: string - net_bytes_diff: - type: integer - format: int64 - - top-editors-by-abs-bytes-diff: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - top: - type: array - items: - type: object - properties: - rank: - type: integer - format: int32 - user_text: - type: string - abs_bytes_diff: - type: integer - format: int64 - - ## Edits - edits: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - edits: - type: integer - format: int64 - - edits-per-page: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - page-title: - type: string - editor-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - edits: - type: integer - format: int64 - - edits-per-editor: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - user-text: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - edits: - type: integer - format: int64 - - ## New Registered Users - new-registered-users: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - new_registered_users: - type: integer - format: int32 - - ## Net Bytes Difference - net-bytes-difference: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - net_bytes_diff: - type: integer - format: int64 - - net-bytes-difference-per-page: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - page-title: - type: string - editor-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - net_bytes_diff: - type: integer - format: int64 - - net-bytes-difference-per-editor: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - user-text: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - net_bytes_diff: - type: integer - format: int64 - - ## Net Bytes Difference - absolute-bytes-difference: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - editor-type: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - abs_bytes_diff: - type: integer - format: int64 - - absolute-bytes-difference-per-page: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - page-title: - type: string - editor-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - abs_bytes_diff: - type: integer - format: int64 - - absolute-bytes-difference-per-editor: - type: object - properties: - items: - type: array - items: - type: object - properties: - project: - type: string - user-text: - type: string - page-type: - type: string - granularity: - type: string - results: - type: array - items: - type: object - properties: - timestamp: - type: string - abs_bytes_diff: - type: integer - format: int64 - -# Mediarequests - mediarequest-referer: - type: object - properties: - items: - type: array - items: - type: object - properties: - referer: - type: string - media_type: - type: string - agent: - type: string - granularity: - type: string - timestamp: - # the hourly timestamp will be stored as YYYYMMDDHH - type: string - requests: - type: integer - format: int64 - - mediarequest-file: - type: object - properties: - items: - type: array - items: - type: object - properties: - referer: - type: string - file_path: - type: string - agent: - type: string - granularity: - type: string - timestamp: - type: string - requests: - type: integer - format: int64 - - mediarequest-tops: - properties: - items: - type: array - items: - properties: - referer: - type: string - media-type: - type : string - year: - type: string - month: - type: string - day: - type: string - files: - type: array - items: - properties: - rank: - type: integer - format: int32 - file_path: - type: string - requests: - type: integer - format: int64 - - # Geoeditors (editors by country) - editors-by-country: - properties: - items: - type: array - items: - properties: - project: - type : string - activity-level: - type: string - year: - type: string - month: - type: string - results: - type: array - items: - properties: - country: - type: string - editors-ceil: - type: integer - format: int64