# Wikidata Entity Resolver for AI Agents (`haketa/wikidata-resolver`) Actor

Resolve any person, company, place or concept to a Wikidata entity for AI agents & LLMs. Get the Q-ID, label, description, type, key facts and cross-database identifiers (VIAF, ISNI, ORCID, IMDb, and more). MCP-callable grounding & entity-linking tool.

- **URL**: https://apify.com/haketa/wikidata-resolver.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Wikidata Entity Resolver — for AI Agents

An **entity-resolution and grounding tool built for AI agents, LLMs and RAG pipelines.** Resolve any **person, company, place or concept** to a structured **Wikidata entity** — its **Q-ID, label, description, type, key facts and cross-database identifiers** (VIAF, ISNI, ORCID, IMDb, socials, GND, and more). Exactly the "who/what is X?" lookup an agent needs to disambiguate and enrich entities.

Clean, small, structured output — one record per entity, ready for an LLM context or an agent tool response. Callable by **Claude, ChatGPT, LangChain, CrewAI, LlamaIndex and any MCP client** (every Apify actor is MCP-callable via `mcp.apify.com`).

> **🧠 The canonical grounding store.** "Which Elon Musk? What is Apple's founder, industry, VIAF id? What type of thing is Berlin?" — the actor returns a single, sourced, machine-readable entity.

---

### 🤖 Why this is an AI-agent tool

Entity resolution is one of the most frequent needs of an agent: turn a fuzzy name into a stable ID plus facts, and link it across databases.

- ✅ **Name → stable Q-ID** — disambiguation an LLM can't do reliably alone
- ✅ **Readable facts** — type, occupation, dates, country, founders, industry (labels, not raw IDs)
- ✅ **Cross-database IDs** — VIAF, ISNI, ORCID, IMDb, Twitter/X, LinkedIn, GND, MusicBrainz, … for entity-linking
- ✅ **MCP-ready** — call it from any agent framework or MCP client

---

### 📋 What this actor does

Give it names (or Q-IDs) and it returns, for each:

- ✅ **Q-ID, label and description**
- ✅ **Type** — what it is (human, enterprise, city, …)
- ✅ **Aliases** — also-known-as
- ✅ **Key facts** — occupation, birth/death, citizenship, HQ, founders, industry, country, population, inception, …
- ✅ **Cross-database identifiers** — VIAF, ISNI, ORCID, IMDb, socials, GND, …
- ✅ **Official website + Wikipedia + Wikidata URLs**

---

### 🚀 Quick start

1. Enter one or more **Names** (e.g. `Elon Musk`, `Apple Inc`, `Berlin`).
2. (Optional) Add specific **Q-IDs** and a **language**.
3. Click **Start** and read the structured entities from **Storage → Dataset**.

---

### ⚙️ Input

| Field | Type | Description |
| --- | --- | --- |
| **Names to resolve** | array | Names to resolve, e.g. `["Elon Musk", "Apple Inc", "Berlin"]`. |
| **Q-IDs** | array | Resolve specific Wikidata Q-IDs directly, e.g. `["Q317521"]`. |
| **Language** | string | Label/description language (en, de, fr, es, tr, …). |
| **Include key facts** | boolean | Resolve facts to readable labels (type, occupation, founders, …). |
| **Proxy** | object | Optional — Wikidata is keyless with no anti-bot. |

#### Example 1 — Resolve several names

```json
{ "queries": ["Elon Musk", "Apple Inc", "Berlin"] }
````

#### Example 2 — Direct Q-IDs, German labels

```json
{ "qids": ["Q317521", "Q312"], "language": "de" }
```

***

### 📦 Output

```json
{
  "query": "Elon Musk",
  "qid": "Q317521",
  "label": "Elon Musk",
  "description": "American businessman (born 1971)",
  "type": "human",
  "aliases": "Elon Reeve Musk",
  "officialWebsite": null,
  "wikipediaUrl": "https://en.wikipedia.org/wiki/Elon_Musk",
  "wikidataUrl": "https://www.wikidata.org/wiki/Q317521",
  "facts": "{\"instanceOf\":\"human\",\"occupation\":[\"programmer\",\"engineer\"],\"birthDate\":\"1971-06-28\",\"citizenship\":[\"South Africa\",\"Canada\"]}",
  "externalIds": "{\"viaf\":\"306339060\",\"orcid\":\"0000-0001-8013-3548\",\"imdb\":\"nm1907769\",\"twitter\":\"elonmusk\",\"gnd\":\"1062481119\"}",
  "scrapedAt": "2026-07-04T00:00:00.000Z"
}
```

#### Output fields

| Field | Description |
| --- | --- |
| `query` | The name/id that was resolved. |
| `qid` | Wikidata entity Q-ID. |
| `label` / `description` | Entity label and short description. |
| `type` | What it is (instance of). |
| `aliases` | Also-known-as. |
| `officialWebsite` | Official website. |
| `wikipediaUrl` / `wikidataUrl` | Source links. |
| `facts` | Key facts (type, occupation, dates, country, founders, industry, …) as JSON. |
| `externalIds` | Cross-database identifiers (VIAF, ISNI, ORCID, IMDb, socials, …) as JSON. |

***

### 🔗 Cross-database identifiers

VIAF · ISNI · ORCID · IMDb · Twitter/X · Facebook · Instagram · YouTube · LinkedIn · TikTok · GND · Library of Congress · MusicBrainz · Spotify · Discogs · Quora · GRID · Ringgold — whichever are present on the entity.

***

### 🔌 AI & integrations

- **MCP:** every Apify actor is callable from `mcp.apify.com` — add this as a tool in Claude Desktop, VS Code or any MCP client.
- **Frameworks:** LangChain (`ApifyActorsTool`), LlamaIndex, CrewAI, Vercel AI SDK, n8n.
- **API:** run and fetch results with the Apify API or JS / Python clients.

***

### ❓ FAQ

**Do I need an API key?**
No — Wikidata is keyless.

**How is the best entity chosen?**
The top Wikidata search match for the name. For exact control, pass Q-IDs directly.

**Are facts human-readable?**
Yes — referenced entities (occupation, country, founder, …) are resolved to labels, not raw Q-IDs.

**Can an AI agent call this directly?**
Yes — it's designed as a tool-call source and is MCP-callable via Apify.

***

### ⚖️ Legal & responsible use

This actor uses the public Wikidata API. Wikidata content is available under CC0. Respect the API's rate limits and use a descriptive user agent (handled by the actor).

***

### 🛟 Support

Need an extra field or property? Open a ticket from the actor's **Issues** tab.

Happy resolving! 🧠

# Actor input Schema

## `queries` (type: `array`):

Names to resolve to Wikidata entities, e.g. \["Elon Musk", "Apple Inc", "Berlin"]. Each is matched to the best entity. This is the main AI-agent lookup: name → structured entity.

## `qids` (type: `array`):

Resolve specific Wikidata Q-IDs directly, e.g. \["Q317521", "Q95"]. Use instead of, or in addition to, names.

## `language` (type: `string`):

Language code for labels and descriptions (e.g. en, de, fr, es, tr).

## `includeFacts` (type: `boolean`):

Resolve key facts (type, occupation, birth date, country, industry, founders, official website, ...) to readable labels. Adds one extra lookup per batch.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. Wikidata is keyless with no anti-bot, so a proxy is OFF by default.

## Actor input object example

```json
{
  "queries": [
    "Elon Musk"
  ],
  "qids": [],
  "language": "en",
  "includeFacts": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `query` (type: `string`):

The name/id that was resolved

## `qid` (type: `string`):

Wikidata entity Q-ID

## `label` (type: `string`):

Entity label

## `description` (type: `string`):

Short description

## `type` (type: `string`):

What it is (instance of)

## `aliases` (type: `string`):

Also known as

## `officialWebsite` (type: `string`):

Official website

## `wikipediaUrl` (type: `string`):

Wikipedia article URL

## `wikidataUrl` (type: `string`):

Wikidata entity URL

## `facts` (type: `string`):

Key facts (type, occupation, dates, country, ...) as JSON

## `externalIds` (type: `string`):

Cross-database identifiers (VIAF, ISNI, ORCID, IMDb, ...) as JSON

## `scrapedAt` (type: `string`):

Extraction timestamp

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "Elon Musk"
    ],
    "qids": [],
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/wikidata-resolver").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "queries": ["Elon Musk"],
    "qids": [],
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/wikidata-resolver").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "Elon Musk"
  ],
  "qids": [],
  "language": "en"
}' |
apify call haketa/wikidata-resolver --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=haketa/wikidata-resolver",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Wikidata Entity Resolver for AI Agents",
        "description": "Resolve any person, company, place or concept to a Wikidata entity for AI agents & LLMs. Get the Q-ID, label, description, type, key facts and cross-database identifiers (VIAF, ISNI, ORCID, IMDb, and more). MCP-callable grounding & entity-linking tool.",
        "version": "0.1",
        "x-build-id": "RvxYMGAmtGIhVSycu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/haketa~wikidata-resolver/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-haketa-wikidata-resolver",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/haketa~wikidata-resolver/runs": {
            "post": {
                "operationId": "runs-sync-haketa-wikidata-resolver",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/haketa~wikidata-resolver/run-sync": {
            "post": {
                "operationId": "run-sync-haketa-wikidata-resolver",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "queries": {
                        "title": "Names to resolve",
                        "type": "array",
                        "description": "Names to resolve to Wikidata entities, e.g. [\"Elon Musk\", \"Apple Inc\", \"Berlin\"]. Each is matched to the best entity. This is the main AI-agent lookup: name → structured entity.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "qids": {
                        "title": "Wikidata Q-IDs (optional)",
                        "type": "array",
                        "description": "Resolve specific Wikidata Q-IDs directly, e.g. [\"Q317521\", \"Q95\"]. Use instead of, or in addition to, names.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "language": {
                        "title": "Language",
                        "type": "string",
                        "description": "Language code for labels and descriptions (e.g. en, de, fr, es, tr).",
                        "default": "en"
                    },
                    "includeFacts": {
                        "title": "Include key facts",
                        "type": "boolean",
                        "description": "Resolve key facts (type, occupation, birth date, country, industry, founders, official website, ...) to readable labels. Adds one extra lookup per batch.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. Wikidata is keyless with no anti-bot, so a proxy is OFF by default.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
