Wikimedia Developer Support

Wikidata API: Filtering property search by data type

api
wikidata

#1

I’m looking for a solution to search/autocomplete Wikidata properties limited to those of the type external-id.

I can achieve this with SPARQL easily but is there a tool or other API that does the same with better performance?

SELECT ?item ?label
WHERE 
{
  ?item wikibase:propertyType wikibase:ExternalId .
  ?item rdfs:label ?label .
  FILTER(lang(?label) = "en")
  FILTER(STRSTARTS(LCASE(?label), 'na'))
}

The closest one can get to the desired result using the core Wikibase API? (does not filter on data type)
https://www.wikidata.org/w/api.php?action=wbsearchentities&format=json&search=na&language=en&type=property