Page MenuHomePhabricator

Read labels, descriptions, and aliases of an item using Wikibase REST API
Closed, ResolvedPublic

Description

PLACEHOLDER

GET /entities/items/{item_id}/labels
GET /entities/items/{item_id}/labels/{language_code}
GET /entities/items/{item_id}/descriptions
GET /entities/items/{item_id}/descriptions/{language_code}
GET /entities/items/{item_id}/aliases
GET /entities/items/{item_id}/aliases/{language_code}

Include:

  • conditional request using HTTP headers
  • mediawiki user authentication/authorization
  • error handling

Event Timeline

Uhm. Small clarification. I noticed that the official documentation in master describes the GET /entities/items/{item_id}/aliases.

https://doc.wikimedia.org/Wikibase/master/js/rest-api/

Is this supposed to be operative? Maybe it's a work in progress.

I ask this since it seems to be not registered in both testing and production:

https://test.wikidata.org/w/rest.php/wikibase/v0/entities/items/Q41487/aliases

https://wikidata.org/w/rest.php/wikibase/v0/entities/items/Q41487/aliases

(I was just curious about this, after a message in the Wikibase community Telegram FOSS group by @Harej)

It's indeed marked as work in progress

image.png (166×672 px, 15 KB)

@valerio.bozzolan note that currently https://doc.wikimedia.org/Wikibase/master/js/rest-api/ shows the docs for the "development" version on top of the main git branch whereas the code that runs on test and "real" Wikidata might be multiple days behind given how the code from git is being delivered to WMF servers.
Beta Wikidata generally runs the same version of the code as the docs cover, including the work-in-progress APIs.