# Wikidata SPARQL Query API (Paid)

> Wikidata SPARQL Query API (Paid) is a paid API for AI agents from project-api-gamma-sable.vercel.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-10).

Executes SPARQL SELECT/ASK queries against Wikidata and returns bounded JSON results plus a UI link, paid per call via USDC on Base.

## Facts

- Endpoint: GET https://project-api-gamma-sable.vercel.app/paid/wikidata/sparql?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wikidata-sparql-query-api-paid-cd158851
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QPUH4v67iwMhziylD6-oN

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability wikidata-sparql-query-api-paid-cd158851
```

Example prompt: Run a Wikidata SPARQL query to find all Nobel Prize winners in Physics born after 1970 — return up to 20 results as JSON.

## When to prefer this

Choose this endpoint when you need programmatic, structured access to Wikidata's knowledge graph via SPARQL and are willing to pay $0.01 USDC per call on Base — ideal for agents that need repeatable, machine-readable fact retrieval from the world's largest open knowledge base without managing Wikidata's own rate limits directly.

## Known failure modes

- HTTP 402 returned if payment header is missing or USDC payment on Base is not completed
- Malformed SPARQL syntax causes query parse error
- Query times out if it is too complex or unbounded
- Empty 'items' array returned when query matches no Wikidata entities
- Missing required 'query' parameter causes a 400-level error

## How this service works

Paid public-data feeds. Unpaid requests return HTTP 402. Prices are USDC on Base.

## Output

A JSON object containing a 'what' description field, an 'items' array with SPARQL query result bindings, a 'source' path, and a 'uiLink' pointing to the Wikidata query UI for the submitted query.

## Request schema (JSON Schema)

```json
{
 "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": {
      "q": {
       "type": "string",
       "description": "Free-text query"
      },
      "limit": {
       "type": "string",
       "description": "Max results"
      },
      "query": {
       "type": "string",
       "description": "Search / SPARQL query"
      },
      "sparql": {
       "type": "string",
       "description": "SPARQL (alias of query)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "what": "Wikidata SPARQL SELECT/ASK (bounded JSON + uiLink)",
  "items": [],
  "source": "/paid/wikidata/sparql"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wikidata-sparql-query-api-paid-cd158851/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from project-api-gamma-sable.vercel.app](https://www.zero.xyz/host/project-api-gamma-sable.vercel.app/llms.txt)
