SPARQL Query Runner avatar

SPARQL Query Runner

Pricing

from $0.35 / 1,000 bindings

Go to Apify Store
SPARQL Query Runner

SPARQL Query Runner

Point at ANY public SPARQL endpoint (Wikidata, DBpedia, UniProt, government & museum Linked-Open-Data) and run a query over the W3C SPARQL 1.1 Protocol. SELECT flattens to dynamic columns per binding, ASK to a boolean, CONSTRUCT/DESCRIBE to triples. One actor, any knowledge graph. Pay per binding.

Pricing

from $0.35 / 1,000 bindings

Rating

0.0

(0)

Developer

Datamule

Datamule

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

0

Monthly active users

22 days ago

Last modified

Share

Point at ANY public SPARQL endpoint, send a query, get a dataset. One actor speaks to every knowledge graph in the Linked-Open-Data world over the W3C SPARQL 1.1 Protocol — no per-site scraper, no host enumeration.

SPARQL is the query language of the semantic web. Wikidata, DBpedia, UniProt / EBI (life sciences), Bio2RDF, the EU / EEA and national-library / museum Linked-Open-Data endpoints, and thousands of government open-data triplestores all serve the identical protocol. Give this actor an endpoint URL and a SPARQL query and it turns the result straight into rows.

Quick start: top 3 countries by population from Wikidata (3 rows, about $0.0015)

Typical job: run a SPARQL SELECT query against a public knowledge graph and get the result as a table you can export to CSV, Excel or JSON.

  1. Paste this into the Input tab (JSON view):
{
"endpoint": "https://query.wikidata.org/sparql",
"query": "SELECT ?country ?countryLabel ?population WHERE { ?country wdt:P31 wd:Q3624078 . ?country wdt:P1082 ?population . SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\" } } ORDER BY DESC(?population) LIMIT 3",
"maxRecords": 3
}
  1. Select Start.
  2. Open the dataset. Each SELECT variable is its own column.

Real output from a local run of this exact input on 2026-09-25 (_raw and empty ASK/triple columns omitted):

countrycountryLabelpopulation
http://www.wikidata.org/entity/Q148People's Republic of China1404890000
http://www.wikidata.org/entity/Q668India1326093247
http://www.wikidata.org/entity/Q30United States340110988

Values come live from Wikidata, so they change when the source is edited. To change the job, edit the query (its variables become your columns) and keep maxRecords or a LIMIT so the bill stays bounded. The Input tab opens prefilled with this same query and cap. For a quick endpoint health check instead, use the ASK { ?s ?p ?o } example below; it returns one true/false row per endpoint, not data.

What it does

Sends your query to the endpoint with Accept: application/sparql-results+json and flattens the response. The output shape follows the query form:

Query formOutput
SELECTOne row per result binding. Each SELECT variable becomes a top-level column equal to its .value — the columns are literally your query's variables. A variable left unbound in a binding (e.g. an OPTIONAL that didn't match) is null. The full typed binding (uri / literal / bnode, datatype, xml:lang) is preserved losslessly in _raw.
ASKA single row: { "_queryType": "ask", "boolean": true/false }.
CONSTRUCT / DESCRIBEBest-effort: the query is sent with Accept: application/n-triples and one row is emitted per triple (subject / predicate / object). If the endpoint won't return N-Triples, the source is skipped with a warning (never fabricated).

Every row carries _endpoint, _queryType, _rowIndex and _raw.

Input

FieldDescription
endpointA SPARQL endpoint URL, e.g. https://query.wikidata.org/sparql. Required unless endpoints is given.
endpointsOptional: run the same query across several endpoints (mirrors / cross-KG). Each row is tagged with its _endpoint.
queryRequired for custom requests. The ready-to-run example and form prefill use the Wikidata top-3 SELECT above; SELECT / ASK are primary and CONSTRUCT / DESCRIBE best-effort.
methodGET (default) or POST (for queries too long for a URL).
maxRecordsOptional global cap on rows across all endpoints (one billable event per row).
userAgentOptional override. A descriptive User-Agent is sent by default — required in practice for Wikidata, which blocks blank / generic UAs.
defaultGraphUri / namedGraphUriOptional SPARQL-protocol dataset graph parameters.
timeoutSecsOptional read timeout (default 90s; endpoints enforce their own server-side caps).
bearer / extraHeadersOptional, for auth-gated deployments. Never required, never logged.

Examples

All-purpose portable query (works on almost any endpoint):

{ "endpoint": "https://dbpedia.org/sparql", "endpoints": ["https://sparql.uniprot.org/sparql"], "query": "ASK { ?s ?p ?o }", "maxRecords": 2 }

Wikidata — countries and their population (dynamic columns country, countryLabel, population):

{
"endpoint": "https://query.wikidata.org/sparql",
"query": "SELECT ?country ?countryLabel ?population WHERE { ?country wdt:P31 wd:Q3624078 . OPTIONAL { ?country wdt:P1082 ?population } SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\" } } LIMIT 50"
}

Resilience

An endpoint that returns a 4xx/5xx, times out, or answers with a non-SPARQL body (an HTML error / anti-bot page, a SPARQL syntax-error response) is skipped with a warning and the batch continues. A run where every endpoint is skipped fails so nothing broken ships. A reachable endpoint that returns 0 bindings yields 0 rows and a clean success.

Pricing

Pay-per-event: one binding charge per emitted row.

Your max run charge is respected: each row is billed as it is written, the Actor checks the remaining budget before every endpoint request, and it stops before any row you have not paid for (a budget below one row makes no request).

RunRowsCost at the FREE tier ($0.0005 per row)
Quick start above3$0.0015
ASK health check (2 endpoints)2$0.001
Wikidata countries example (LIMIT 50)up to 50up to $0.025
1,000 rows1,000$0.50

Paid Apify plans get a lower per-row price (down to $0.00025). If you leave maxRecords empty and the query has no LIMIT, you pay for every row the endpoint returns.