This is a collection of Wikidata REST API endpoint examples in Bruno's .bru file format. You can use these examples with Bruno or another API client to try out Wikibase REST API requests.
More information about the Wikibase REST API can be found in the documentation.
In the endpoint-collection directory you will find folders that contain the individual requests. These folders are sorted by the data that the requests call and include items, labels, descriptions, aliases, properties, sitelinks and statements. endpoint-collection also contains a bruno.json and a collection.bru file. Another folder within this directory named environments contains .bru files for each of the collection's environments. In these files the environment variables are saved. The variables store dynamic values that can be reused across multiple requests. They are used in the endpoints with double curly braces: {{base-url}}/entities/items/{{item-id}}.
- Download Bruno.
- Clone this repository:
git clone https://github.com/wmde/wikidata-rest-api-examples - In Bruno, click "Open collection" and select your local
endpoint-collectiondirectory. - In the top right corner choose an environment to work in. This can be adjusted at any point.
When trying out the REST API, use the Wikidata environment for fetching. You can also use this environment to edit the sandbox item, which is defined in a variable of the same name. When creating and deleting items, use the Beta Wikidata environment.
- Select individual requests and execute the request by clicking the arrow or pressing Ctrl + Enter.
- Navigate to the collection overview and click collection environments.
- Create new environments by selecting the + symbol.
- Edit existing environment variables on the right by adding or editing the Name and Value.
- Click save.