Page MenuHomePhabricator

API docs research and discovery
Closed, ResolvedPublic

Description

As part of WE5.2 "By the end of Q4, 70% of Wikimedia web API endpoints will be supported by common infrastructure", research options to present documentation for APIs using this common infrastructure. This task description is a work in progress.

Assigned: @TBurmeister and @KBach
Timeframe: Q1 fiscal year 2025-2026

Goals

Create recommendations, including options and tradeoffs, for presenting documentation for Wikimedia APIs using common infrastructure developed as part of WE5.2.

Outcomes

As part of work on this task, we have created the following artifacts:

These artifacts will evolve over the coming months to accommodate requirements resulting from other API work.

We have also:

  • conducted research into features and technical architectures of popular API documentation sites, which informed some of our work on the artifacts listed earlier
  • supported the work on the standard API sandbox (T400174), including the process of deciding where the documentation and the sandbox should be hosted (T400183)

Work on API documentation continues in T405569: API docs work - Q2 and Q3 2025/26 and its subtasks.

Original scope

  • APIs in scope for WE5.2 (restricted access)
  • Recommendations for the new API documentation experience
  • Style guide for reference documentation/OpenAPI definition descriptions
  • API changelog
  • API documentation standards and patterns
  • Other API documentation content: tutorials, code samples, concept overviews (instructions on how to create + examples)
  • ...

Note: Not all of this work will complete in Q1; some work might be started in this task and later moved to a separate task or hypothesis.

Project plan

  • Research features and technical architecture of documentation websites for popular APIs
  • Participate in the process of selecting the location for the new documentation (T400183)
    • Clarify the available options and selection criteria
    • Identify benefits and trade-offs
    • Gather feedback
    • Make a recommendation
    • Decision made
  • Research best practices for API reference documentation and OpenAPI description
    • Investigate the limitations of the OpenAPI description (OAD) format itself
    • Catalog current API reference documentation patterns
      • MediaWiki REST API
      • Wikimedia REST (RESTBase) API
      • Liftwing
      • Wikibase REST API
      • Link Recommendation API
      • Wikimedia Analytics API
      • Wikimedia Enterprise API
    • Identify OAD content best practices
    • Write the OAD style guide
    • Share the style guide for review
    • Improve the style guide based on feedback
  • Identify and document standard API documentation patterns
  • API changelog
  • Documentation content strategy (content migrations, future content work, deprecations, etc.)

Resources

Event Timeline

KBach changed the task status from Open to In Progress.Jul 16 2025, 7:50 AM
KBach claimed this task.
KBach triaged this task as High priority.

Completed so far:

  • Initial research into API documentation features and technical architectures - results shared with the Technical Documentation Team
  • Identification of core deliverables, their requirements, priorities, and dependencies

The spreadsheet linked in the task description for APIs in scope has a list of many APIs with lots of information about them; I don't see a clear list there of what is in/out of scope for this work -- it seems comprehensive. Am I missing something? Is there a list somewhere of which APIs are in scope? @HCoplin-WMF for input / visibility.

Ah, I have found this list in a notes doc. Is this accurate for which APIs are in scope?

  • MediaWiki Action API
  • MediaWiki REST API
  • RESTBase API/their successors on the REST Gateway
  • Liftwing API
  • Analytics APIs (AQS)
  • Wikidata REST API

@TBurmeister -- yup! That's a good list. For future reference, I'm tracking what APIs are considered in scope for common infrastrcuture on the "API Counts" tab, in Column G. If it's ticked off there, it's considered in scope. The only thing to note there is that the Wikidata APIs are currently being considered a bit of a "stretch" goal. :)

I see that Liftwing is not checked on the API Counts tab in the spreadsheet. So it is not in scope? Thus based on your previous comment, the list of what's in scope for now would be:

  • MediaWiki Action API - in scope for overall IA but not for new sandbox experience
  • MediaWiki REST API
  • Wikimedia REST (RESTBase) API
  • Analytics APIs (AQS)

Assumption: even if we are only designing an IA and improved experience for these 4 APIs right now, the IA we design must be extensible enough that it can accomodate future migration of existing endpoints from other APIs and/or new APIs. As we pursue more standardization (and perhaps modularization) of the infrastructure, more endpoints or API would be integrated into the increasingly unified navigation structure.

When calculating the baseline, we decided to consider Wikidata and the APIs that are currently routed through the API Portal to be "stretch" goals. It will be slightly more complicated to reroute them to common infrastructure, given everything the API Portal is currently responsible for.

For the sake of the documentation and information architecture, I would like to consider them as a stretch goal, as well. They will be a little bit trickier on that front -- unlike the other APIs in the list, these API largely outside of the scope of a given project or across projects. I think that's an important nuance in terms of how we frame interactions and what API options are available.

Said another way, I do think that Wikidata and Liftwing will break the patterns to a degree, so we should at least consider what they might look like. We also have more time to figure that out though -- optimistically we would be looking at ~Q3 or Q4 to even consider rerouting Liftwing.

We are still selecting the location for the new documentation, currently in the process of filling out the decision matrix (restricted access) and discussing different benefits and trade-offs.

We've made a recommendation for the location of the new API sandbox and documentation.

I am now focusing on OpenAPI description (OAD) constraints and best practices. This will help us formulate the OAD and reference documentation style guide, but can also directly support the API sandbox work.

I'm cataloging current API reference documentation patterns for analysis (already done with MediaWiki REST API, moving on to RESTbase). I'm planning to start formulating style guide entries based on these patterns in the middle of next week.

I have now finished constructing the API patterns catalog and am analyzing it as a basis for the OAD style guide. Wikimedia Analytics API and Wikimedia Enterprise API are not part of the catalog and will be used to evaluate the style guide recommendations.

Work on the OAD style guide was delayed and is still continuing. Currently planning to have the first draft ready for review by end of next week (12 September).

I've started moving content around and creating the scaffolding for where we will provide all the API documentation standards / patterns at https://www.mediawiki.org/wiki/Documentation/API_documentation. While there are currently many red links, much of this content does already exist elsewhere and just needs to be migrated into this more organized central location. In the coming week I will be doing that, along with creating new content as needed to adapt our existing doc templates to express more API-specific content guidance for API maintainers/doc publishers.

First draft of the OAD style guide has been shared for review. I'll be improving the document based on feedback over the coming weeks. Now focusing on the API changelog and documentation content strategy.

Recommendations for API doc collection structure and contents are now drafted and shared for review, see T403864. Once the content patterns are approved by stakeholders, the next step is to finalize T401711 by completing a gap analysis that captures the work required to bring each of those API doc collections more into alignment with our recommendation for more standardized structure and content.

I have also shared a draft of an API documentation strategy to define future work. Specification of required content migrations can't be done until we have some alignment on future goals and timelines around the existing API portal.

A proposal for the standard API changelog structure and format is now in review. Currently focusing on the API documentation content strategy and the plans for Q2.

First drafts of the OAD style guide and the API changelog style guide are now published on mediawiki.org. Work on these documents will continue in T405571: Improve OAD style guide based on feedback and emerging requirements and T405573: Improve API changelog style guide based on feedback and emerging requirements respectively.

We're still finalizing documentation content strategy, focusing primarily on work planned for Q2 and collected in T405569.

KBach updated the task description. (Show Details)
KBach updated the task description. (Show Details)

All work planned for this task is now complete and summarized in task description, in the Outcomes section. API documentation work continues in T405569.