GET /sparql
wikidata.org:wikidata-sparql-api
Summary: Execute SPARQL query
Operation ID: sparqlQuery
Auth: unknown
Operation ID: sparqlQuery
Auth: unknown
Description
Execute a SPARQL query against the Wikidata knowledge base. Returns results in various formats including JSON, XML, CSV, and TSV.
Parameters (2)
format
(string, query, optional, default: json)
Response format for the query results
Constraints: {'enum': ['json', 'xml', 'csv', 'tsv', 'srj', 'srx']}
query
(string, query, required)
The SPARQL query string to execute. Must be URL-encoded. Supports SELECT, ASK, DESCRIBE, and CONSTRUCT queries.
Examples (2)
| Title | Type | URL | Action |
|---|---|---|---|
| Execute SPARQL query | openapi-spec |
https://query.wikidata.org/sparql?query=SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5 } LIMIT 10 |
|
| Execute SPARQL query | probe-gate |
https://query.wikidata.org/sparql?query=SELECT+%3Fitem+%3FitemLabel+WHERE+%7B+%3Fitem+wdt%3AP31+wd%3AQ5+%7D+LIMIT+10&format=json |
Probe History
Status Codes
| Time | Status | Latency | Size |
|---|---|---|---|
| 2026-03-23 10:47:24.367503 | 200 | 541ms | |
| 2026-03-23 10:45:35.101352 | 200 | 541ms | |
| 2026-03-20T02:08:52.995622 | 200 | 292ms |