# Wikidata Knowledge Graph API

> Search Wikidata entities, fetch facts for companies, brands, people and places, run SPARQL

- Vendor: `wikidataknowledgegraphapi` · version 1.0 · category Data Enrichment · tags wikidata api, knowledge graph api, entity search api, sparql api, company facts api, brand data api, open data api, entity linking api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/wikidataknowledgegraphapi
- This document: https://apiclay.com/docs/wikidataknowledgegraphapi.md
- OpenAPI 3.1: https://apiclay.com/api/wikidataknowledgegraphapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `wikidataknowledgegraphapi`
- Updated: 2026-11-18

## About

## Wikidata Knowledge Graph API

Wikidata's 110M+ entities as structured facts: search companies, brands, people, places and products by name, fetch their labels, descriptions and statements (founded, headquarters, website, parent company, identifiers...), or run SPARQL queries over the whole graph.

Data comes from **wikidata.org** (https://www.wikidata.org). Every route below calls the source's own public endpoint directly and returns the upstream response unchanged.

Typical flow: `/search` -&gt; `/entities`

### Routes

#### GET `/search` - Search entities by name
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| search | query | string | yes | Text, e.g. `Chipotle`. |
| language | query | string | yes | Language code, e.g. `en`. |
| limit | query | number | no | Up to 50 (default 7). |
| type | query | string | no | `item` (default), `property` or `lexeme`. |
| continue | query | number | no | Offset for the next page. |

Returns: `search[]` with `id` (e.g. `Q465751`), `label`, `description`, `concepturi`.

#### GET `/entities` - Entity facts
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| ids | query | string | yes | One or more ids joined by `|`, e.g. `Q465751|Q312`. |
| props | query | string | no | e.g. `labels|descriptions|claims|sitelinks`. |
| languages | query | string | no | e.g. `en`. |

Returns: `entities.` with `labels`, `descriptions`, `claims.[]` (e.g. `P856` website, `P159` headquarters, `P571` inception).

#### GET `/sparql` - SPARQL query
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| query | query | string | yes | SPARQL, e.g. `SELECT ?item WHERE {?item wdt:P31 wd:Q1631129} LIMIT 10`. |

Returns: `head.vars`, `results.bindings[]`.

### License

Wikidata's structured data is CC0 (public domain dedication).

### Caveats

- SPARQL queries time out after 60 seconds upstream; add a LIMIT.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by wikidata.org.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /search — Search entities
- Gateway: `GET https://api.apiclay.com/v1/api/wikidataknowledgegraphapi/search`
- Public query params: `search` (string, required), `language` (string, required), `limit` (string), `type` (string), `continue` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /entities — Get entities
- Gateway: `GET https://api.apiclay.com/v1/api/wikidataknowledgegraphapi/entities`
- Public query params: `ids` (string, required), `props` (string), `languages` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /sparql — SPARQL query
- Gateway: `GET https://api.apiclay.com/v1/api/wikidataknowledgegraphapi/sparql`
- Public query params: `query` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/wikidataknowledgegraphapi/search?search=<search>&language=<language>" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
