Get all Wikidata items that are an instance of a given item
Wikidata has an item called smartphone model . I want to get all instances of it. QUESTION: How to get the identifiers of the instances programmatically, using the live server? Preferably not including false positives that show up in WhatLinksHere but are in the "Wikidata:" namespace rather than the main namespace. Your question specifies the "Mediawiki API" but this is not possible. Wikidata has a SPARQL query service at https://query.wikidata.org The query that you want is: PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> SELECT DISTINCT ?item