Wikimedia Wikidata Query Service
Wikimedia Wikidata Query Service
Wikimedia's Wikidata Query Service provides SPARQL access to Wikidata's structured entities, properties and relationships. The public endpoint returns XML, JSON, CSV or TSV, while the interface also exports geospatial results as GeoJSON, GPX or KML; no key is needed.
Coverage
The main public endpoint covers Wikidata's main graph, while scholarly-publication data is served from a separate query endpoint. Updates are asynchronous and up to six hours of lag is considered normal; queries time out after 60 seconds.
Verdict
A broad entity-linking signal for organizations, places, events, identifiers and relationships across public knowledge domains. Stable entity identifiers make it useful for joining otherwise separate datasets, but property completeness and modelling vary by topic and language. The query service is asynchronously updated, differs from RDF dumps and can lag behind edits. Complex queries can time out or be throttled, so use narrow result sets and cache lawful outputs where appropriate.
Get the free weekly email
Free weekly email of newly verified free data. Unsubscribe by emailing us.
By entering your email and clicking Subscribe, you agree to receive the Signal Lab weekly email from Quantum Data Technologies Ltd., 3200-650 West Georgia Street, Vancouver, BC V6B 4P7, Canada (signal-lab@qdt.ai). You can unsubscribe at any time: reply "unsubscribe" to any email or write to signal-lab@qdt.ai. See our Privacy Policy.
Use in your agent
Query Wikidata SPARQL into pandas and Parquet. Checked against the provider's documentation on Nov 2, 2026.
Access
- No account or key. Send a descriptive User-Agent and use the public SPARQL endpoint.
- JSON is selected with format=json or the application/sparql-results+json Accept header.
Request
curl --get 'https://query.wikidata.org/sparql' -H 'User-Agent: SignalLabCheck/1.0 (https://signal-lab-jet.vercel.app)' --data-urlencode 'query=SELECT ?item ?itemLabel WHERE { VALUES ?item { wd:Q16 wd:Q30 wd:Q145 } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }' --data 'format=json'Format
SPARQL Results JSON with head.vars and results.bindings. Each binding describes a value's type, value and optional language or datatype.
Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
"""Three Wikidata entities from WDQS -> pandas -> Parquet."""
import requests
import pandas as pd
URL = "https://query.wikidata.org/sparql"
QUERY = """
SELECT ?item ?itemLabel WHERE {
VALUES ?item { wd:Q16 wd:Q30 wd:Q145 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
"""
headers = {"User-Agent": "SignalLabCheck/1.0 (https://signal-lab-jet.vercel.app)"}
r = requests.get(URL, params={"query": QUERY, "format": "json"}, headers=headers, timeout=60)
r.raise_for_status()
bindings = r.json()["results"]["bindings"]
df = pd.DataFrame([{k: v.get("value") for k, v in row.items()} for row in bindings])
df.to_parquet("wikidata_query_sample.parquet", index=False)
print(len(df), "entities; labels:", ", ".join(sorted(df["itemLabel"])))Run by us on 2026-11-02 (python 3.13.5 | pandas 3.1.0 | pyarrow 26.0.0 | requests 2.34.2). Result: 3 entities; labels: Canada, United Kingdom, United States
Limits
- Query timeout: 60 seconds.
- Processing allowance: 60 seconds per 60 seconds for one user-agent-and-IP client.
- Error allowance: 30 erroneous queries per minute; clients exceeding limits are throttled.
Quirks
- Flatten each SPARQL binding's nested value object before constructing a table.
- The query-service dataset does not exactly match the RDF dump, and asynchronous updates introduce lag.
- The main and scholarly graphs are split across separate public endpoints; choose the graph that matches the topic.
Terms and attribution
- Wikidata structured data in the main data namespaces is dedicated under CC0 1.0.
- Text outside the structured-data namespaces is available under CC BY-SA and may have additional terms.
- Follow Wikimedia's User-Agent, robot and API etiquette policies when automating requests.
Sources
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service: “Run, test, download the data as XML, JSON, CSV, or TSV.”
- https://www.mediawiki.org/wiki/Wikidata_Query_Service/Implementation: “Query timeout of 60 seconds”
- https://www.mediawiki.org/wiki/Wikidata_Query_Service/Implementation: “One client (user agent + IP) is allowed 60 seconds of processing time each 60 seconds”
- https://www.wikidata.org/wiki/Wikidata:Copyright: “Creative Commons CC0 License”
Information and education only. Not financial, investment, legal or tax advice. Listings can be inaccurate, incomplete or out of date and are provided "as is". Free tiers, limits and licenses belong to each provider and can change, so check the provider's own terms before you rely on them. Terms & Disclaimer