# 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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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`):

Type any people, companies, places or concepts and each one is matched to the best Wikidata entity — its Q-ID, label, description, type, key facts and cross-database IDs. Leave empty to get a ready-made sample of well-known entities.

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

Language used for labels, descriptions and facts. English is the most complete.

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

Add readable key facts — type, occupation, birth date, country, industry, founders, official website and more.

## `maxResults` (type: `integer`):

Maximum number of entities to return. Set 0 for no limit.

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

Optional: paste specific Wikidata Q-IDs to resolve directly, e.g. Q317521, Q95. Most users can ignore this and just use the names box above.

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

Apify Proxy settings. This resolver works without a proxy, so it is off by default.

## Actor input object example

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

# Actor output Schema

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

The full dataset of resolved entities (label, description, type, facts, external IDs).

# 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",
        "Apple Inc",
        "Berlin"
    ],
    "language": "en",
    "maxResults": 100,
    "qids": []
};

// 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",
        "Apple Inc",
        "Berlin",
    ],
    "language": "en",
    "maxResults": 100,
    "qids": [],
}

# 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",
    "Apple Inc",
    "Berlin"
  ],
  "language": "en",
  "maxResults": 100,
  "qids": []
}' |
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

Download the OpenAPI definition: https://api.apify.com/v2/actors/PJucAklVnwp3g4MaI/builds/rwrlDCW130v6rWrWm/openapi.json
