{"api":{"id":"api_fe79c988f33e17dbf9af9089","slug":"wikidata-query","name":"Wikidata Query API","description":"Run a SPARQL query against Wikidata and get each result row back as a flat record, one key per selected variable, with labels and links ready to use. Build custom lists such as every university in a country.","kind":"ready_made","visibility":"public","domain":"query.wikidata.org","source_url":"https://query.wikidata.org/sparql","category":"public_data","record_type":"generic","active_version":"1.0","units_per_1k":500,"health":"unknown","auto_repair":false,"last_checked_at":null,"last_run_at":null,"fields_count":4,"created_at":"2026-12-06T03:57:27.730Z","updated_at":"2026-12-06T03:57:27.730Z","runnable":true,"egress":null,"repairs":[],"repairs_total":0,"how":"Runs on a reader we built and maintain by hand for this site.","fields":[{"name":"row","type":"integer","description":"Position of the row in the result, starting at 1.","required":false,"coverage":1,"example":1},{"name":"values","type":"object","description":"The row's columns: one key per selected variable, plus <variable>_id for entities.","required":false,"coverage":1,"example":{"item":"http://www.wikidata.org/entity/Q631296","item_id":"Q631296","inception":"1946-01-01","itemlabel":"Maritime College of Forest Technology"}},{"name":"columns","type":"array","description":"Names of the variables in values, in the order the query selects them.","required":false,"coverage":1,"example":["item","inception"]},{"name":"entity_ids","type":"array","description":"Wikidata ids (such as Q123) of the entities found in the row.","required":false,"coverage":1,"example":["Q631296"]}],"inputs":[{"name":"query","type":"string","description":"SPARQL SELECT query text.","example":"SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q3918; wdt:P17 wd:Q16. SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\". } } LIMIT 10","required":true}],"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":true,"properties":{"columns":{"description":"Names of the variables in values, in the order the query selects them.","type":"array"},"entity_ids":{"description":"Wikidata ids (such as Q123) of the entities found in the row.","type":"array"},"row":{"description":"Position of the row in the result, starting at 1.","type":"integer"},"values":{"description":"The row's columns: one key per selected variable, plus <variable>_id for entities.","type":"object"}},"required":[],"title":"Wikidata Query API","type":"object"},"samples":[{"row":1,"values":{"item":"http://www.wikidata.org/entity/Q631296","item_id":"Q631296","inception":"1946-01-01","itemlabel":"Maritime College of Forest Technology"},"columns":["item","inception","itemlabel"],"entity_ids":["Q631296"]},{"row":2,"values":{"item":"http://www.wikidata.org/entity/Q337382","item_id":"Q337382","inception":"1838-01-01","itemlabel":"Acadia University"},"columns":["item","inception","itemlabel"],"entity_ids":["Q337382"]},{"row":3,"values":{"item":"http://www.wikidata.org/entity/Q472167","item_id":"Q472167","inception":"1967-01-01","itemlabel":"University of Winnipeg"},"columns":["item","inception","itemlabel"],"entity_ids":["Q472167"]}],"validation":{"checked_at":"2026-12-06T03:57:27.599Z","field_coverage":{"columns":1,"entity_ids":1,"row":1,"values":1},"fresh_read":false,"identity_unique":true,"issues":["Imported from a hand-built source. Field names and types come from its published schema; no live read was made for this check."],"level":"preview","pages_checked":0,"passed":true,"records_checked":3},"links":{"run":"https://pullrow.dev/v1/apis/api_fe79c988f33e17dbf9af9089/run","openapi":"https://pullrow.dev/v1/apis/api_fe79c988f33e17dbf9af9089/openapi.json","contract":"https://pullrow.dev/v1/apis/api_fe79c988f33e17dbf9af9089/contract.json","page":"https://pullrow.dev/catalog/wikidata-query"},"runs_30d":0,"success_rate_30d":null,"price_per_1k_usd":0.5,"featured":false,"reliability":{"window_days":30,"runs":0,"completed":0,"succeeded":0,"failed":0,"success_rate":null,"last_run_at":null},"demo":{"available":false,"max_records":0,"reason":"Every run of this API costs us money, so it has no free live demo. The sample records on its page show what it returns.","code":"demo_not_available"},"meta":{"limitations":["You write the SPARQL query; each selected variable becomes a key in the record (lower case), so a bad query returns an input message instead of rows. Include SERVICE wikibase:label to get readable names.","Wikidata stops any query that runs longer than 60 seconds, and very heavy queries may be refused: narrow them with filters and a LIMIT.","If the query has no LIMIT, one is added from max_items; results come in the source's own order unless the query sorts them.","Variables a row leaves unbound are null. Entity values are returned as full links in the variable and their id in <variable>_id.","Wikidata data is released CC0. The service asks for modest use and an identifying client; runs send one request at a time."]},"plain":{"summary":null,"source":"rules","fields":[{"name":"row","label":"Row","description":"Position of the row in the result, starting at 1.","group":"Basics","shown":true,"written":false},{"name":"values","label":"Values","description":"The row's columns: one key per selected variable, plus <variable>_id for entities.","group":"Basics","shown":true,"written":false},{"name":"columns","label":"Columns","description":"Names of the variables in values, in the order the query selects them.","group":"Basics","shown":true,"written":false},{"name":"entity_ids","label":"Entity IDs","description":"Wikidata ids (such as Q123) of the entities found in the row.","group":"Technical","shown":false,"written":false}],"inputs":[{"name":"query","label":"Query","help":"SPARQL SELECT query text.","example":"SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q3918; wdt:P17 wd:Q16. SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\". } } LIMIT 10","written":false}]}},"incidents":[]}