{"uid":"cap_TFs523V5fbfrQ-WJLenq1","slug":"sitecheck-wikidata-sparql-query-af4cb3dc","name":"SiteCheck Wikidata SPARQL Query","description":"Runs a read-only SPARQL query on Wikidata and returns the rows as plain values (ASK returns true or false). Only SELECT and ASK are allowed; updates are refused. A LIMIT of 100 or less is added when missing. 8-second limit. Data is CC0.","url":"https://api.sitecheck-api.workers.dev/api/wikidata?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["query"],"properties":{"query":{"type":"string","description":"A SPARQL SELECT or ASK query, up to 4,000 characters"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"rows":[{"city":"http://www.wikidata.org/entity/Q750","cityLabel":"Bolivia"},{"city":"http://www.wikidata.org/entity/Q754","cityLabel":"Trinidad and Tobago"},{"city":"http://www.wikidata.org/entity/Q757","cityLabel":"Saint Vincent and the Grenadines"}],"query":"SELECT ?city ?cityLabel WHERE { ?city wdt:P31 wd:Q6256 . SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\". } } LIMIT 3","source":"https://query.wikidata.org/sparql","columns":["city","cityLabel"],"rowCount":3,"checkedAt":"2026-10-14T07:01:31.494Z","attribution":"Wikidata (CC0)"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Hq99gG0_Yzp2GnJIr_FG8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes a SPARQL SELECT or ASK query against the Wikidata knowledge base and returns structured tabular results","exampleAgentPrompt":"Run this SPARQL query against Wikidata and give me the results: SELECT ?country ?countryLabel WHERE { ?country wdt:P31 wd:Q6256 . SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\". } } LIMIT 10","exampleUseCases":[{"title":"Find all capitals of EU member states","prompt":"Query Wikidata to get the capital cities of all European Union member states — write a SPARQL SELECT query for me and return the results with English labels."},{"title":"Look up Nobel Prize winners by year","prompt":"Use Wikidata to find everyone who won the Nobel Prize in Physics after 2010 — I need their names and the year they won."},{"title":"Retrieve film directors by nationality","prompt":"Query Wikidata for all film directors who are citizens of Japan and return their names and date of birth."}],"resultDescription":"Returns a JSON object with an array of result rows (each row is a key-value map of column names to values or URIs), the original SPARQL query, the source URL, column names, total row count, the timestamp of the check, and a CC0 attribution to Wikidata.","failureModes":["Invalid SPARQL syntax returns an error response","Query exceeds 4,000 character limit and is rejected","Timeout if the SPARQL query is too complex or returns too many rows","Unknown Wikidata property or entity QID returns empty result set","Network connectivity issues to the Wikidata SPARQL endpoint"],"whenToPreferThis":"Choose this endpoint when you need structured, linked open data from Wikidata using SPARQL — especially for queries involving entity relationships, class memberships, or property-based filtering across the Wikidata knowledge graph. It is ideal for encyclopedic lookups (countries, people, organizations, scientific concepts) where the data is well-represented in Wikidata and you need tabular results with entity URIs and English labels.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-22T06:40:06.083Z","isFirstParty":false,"canonicalSlug":"sitecheck-wikidata-sparql-query-af4cb3dc"}