Wikidata Query Service
by wikidata.org
Books and research
Added on October 31st, 2026
Checked and working on November 16th, 2026
Visit wikidata.org →
What it does
The Wikidata Query Service answers SPARQL queries over Wikidata, the structured database behind Wikipedia with more than 100 million items: for example all cities with more than a million inhabitants, or all paintings by a given artist with their museums. Results are JSON, XML or CSV. Free, no key needed; data is CC0. Send a User-Agent and keep queries efficient.
At a glance
- API key
- Not needed · More APIs with no key
- Pricing
- Free, no key needed; data is CC0.
- From the browser
- Yes (CORS)
- Formats
- JSON, XML
- Interface
- REST, HTTP-GET
- Provider
- wikidata.org
- Last checked
- Working on November 16th, 2026
More information: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service
Is this your service? Show that it is listed
Put this badge on your website or in your README; it links to this page. About the badge
Example request
curl
curl 'https://query.wikidata.org/sparql?query=SELECT%20%3Fpop%20WHERE%20%7B%20wd%3AQ84%20wdt%3AP1082%20%3Fpop%20%7D&format=json'
JavaScript
const response = await fetch("https://query.wikidata.org/sparql?query=SELECT%20%3Fpop%20WHERE%20%7B%20wd%3AQ84%20wdt%3AP1082%20%3Fpop%20%7D&format=json");
const data = await response.json();
console.log(data);
Python
import requests
response = requests.get(
"https://query.wikidata.org/sparql?query=SELECT%20%3Fpop%20WHERE%20%7B%20wd%3AQ84%20wdt%3AP1082%20%3Fpop%20%7D&format=json",
timeout=30,
)
print(response.json())
The JavaScript works in a web page as well as in Node.js 18 or newer.