In T405041: Global Editor Metrics - HTTP API endpoints, we will be adding 3 new API endpoints to AQS. T342018: compile list of known issues for triage post AQS 2.0 launch has a big list of very annoying inconsistencies between the various AQS API endpoints. Fixing these existing endpoints is desired, but quite a lot of breaking API change work, and is not currently prioritized.
For the new Global Editor Metric endpoints, we decided (T405041#11290627) to avoid these inconsistencies by mostly 'doing the right thing'. To smooth a future migration path for old endpoints, we'd like to host the new endpoints at a new major API version than the old ones. This will make it clearer that the new endpoints follow different (and better) conventions than the old ones, and provide a migration path for the old ones to the new major API version.
The old Analytics API (AQS) endpoints are all hosted at e.g. https://wikimedia.org/api/rest_v1/metrics. The current (Go) version of AQS is casually referred to as AQS 2.0, to differentiate it the original RESTBase AQS 1 implementation.
To avoid confusion between rest_v1, AQS 1, AQS 2.0, we'd like to skip API version 2 and go straight to API version 3.
It is not clear how to implement Analytics API version 3 routing. While we could stick with the existing path format and go with rest_v3/metrics, no one likes the RESTBase inherited 'rest_vX' format. It seems it would be better if we could manage endpoint versioning in the API Service code itself, just like is done for MW REST API for extensions.
Options:
- A. rest_vX: https://wikimedia.org/api/rest_v3/metrics/...
- B. Versioning in AQS path handlers: https://wikimedia.org/api/rest_v1/metrics/v3/
- C. Versioning in AQS path handlers + get rid of RESTBase vestiges: https://wikimedia.org/api/metrics/v3/...
- ...?
Status
2025-11
- v3 versioning in AQS routing code added. E.g. https://wikimedia.org/api/rest_v1/metrics/edits/v3/per_editor/12345/all_page_types/monthly/20230101/20240101
- Desire to do something better in the future ¯\_(ツ)_/¯