Starting fresh: the Wikibase REST API
Dan Shick
Build data-driven applications more easily using modern standards
The MediaWiki Action API has been around for almost two decades. Countless developers have used it to create all sorts of helpful applications that take advantage of the data inside MediaWiki-powered projects, such as Wikidata Skim and Monumental.
Wikidata has 10 years under its big belt; Wikibase, the free knowledge graph software that powers Wikidata, has been a product in its own right for almost half that time. But despite Wikidata’s footprint and Wikibase’s powerful functionality, the various API calls for both products have been shoehorned for almost all that time into the venerable Action API.
That state of affairs has recently changed—for the better. Starting in 2022, Wikimedia Deutschland began work on a Wikibase-specific REST API. Why? We saw a growing need to expose Wikibase’s functionality through a modern, RESTful, OpenAPI-compliant interface that’s fully dedicated to Wikibase. As of this writing, we’ve made a promising start and implemented a lot of basic calls already, as you can see in our OpenAPI documentation. If you’re running your own Wikibase, you can easily enable the new REST API for your Wikibase instance.
One big question looms in the minds of many developers: why should we use the new API? For starters, using the Wikibase REST API means cleaner, flatter, more easily parseable output. Developers who are just beginning to acquaint themselves with our API will have a much easier time getting started, whereas developers who’ve become all too familiar with the idiosyncrasies of the Action API will find the Wikibase REST API experience a dramatic improvement for each call we implement. Check out this simple table or this more in-depth comparison to see how things are changing.
Importantly, the new REST API will also eventually be versioned—so as we grow and improve its scope, we’ll eliminate the risk of functionality changing out from under existing projects. With API versioning you can rely on a call working the same way it always has for that version; we’ll only add or change functionality in later versions.
It feels good doing API work in a context that’s more current as well as being specifically dedicated to Wikibase functionality. We’re making great progress in recreating the core Wikibase calls currently implemented in the Action API, in large part thanks to our dedicated developer team. To get a greater insight into what we’ve already done, what we’re working on and what’s still to come, take a walk through our work board.
As the project moves forward, we hope that our work will inspire the large and talented Wikidata and Wikibase communities to create more, more powerful apps built on top of the new API. We’ve already seen community members stepping up to create libraries for the Wikibase API in Python and Ruby, and we know there’s more where that came from.
We call on all developers, both the well established mainstays and those new to the community, to take a look at what we’ve done so far. We’ve done a lot already, and we want your feedback on what’s coming next. Specifically, we’d like to hear about the pieces you’re missing in the REST API that would allow you to build the applications you want to build. You can make your voice heard and help us prioritize the next steps by leaving a comment on the Talk page.
No comments yet
Leave a comment