# 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
- **Features:** Limited permissions
- **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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Wikidata Scraper & Entity Resolver — Q-ID, Facts & Cross-Database IDs

[![Apify Actor](https://img.shields.io/badge/Apify%20Actor-Ready-blue?logo=apify)](https://apify.com/haketa/wikidata-resolver)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://apify.com/haketa/wikidata-resolver)
[![Data Format](https://img.shields.io/badge/Data-JSON%20%7C%20CSV%20%7C%20Excel-orange)](https://apify.com/haketa/wikidata-resolver)
[![AI Grounding](https://img.shields.io/badge/LLM-MCP%20%7C%20RAG%20Ready-purple)](#)
[![Pagination](https://img.shields.io/badge/Scale-1%2C000%2B%20Entities-success)](#)

**A high-speed [Wikidata](https://www.wikidata.org) entity resolver and knowledge-graph extractor built for AI agents, LLMs, and enterprise RAG pipelines.** Disambiguate and resolve any **person, company, geographical place, or conceptual topic** to a canonical **Wikidata entity** — extracting permanent **Q-IDs, labels, descriptions, typed classes, key facts, and cross-database identifiers** (VIAF, ISNI, ORCID, IMDb, LinkedIn, Twitter/X, and GND).

Whether resolving messy strings for master data management, grounding agentic workflows via Model Context Protocol (MCP), or batch-enriching 1,000+ entities, everything outputs cleanly into **JSON, CSV, Excel, or programmatic API**.

***

### ⚡ At a glance

| Feature | Specification |
|---|---|
| **Knowledge Base** | Official Wikidata API (`www.wikidata.org/w/api.php`) |
| **Data Scope** | Q-ID, canonical label, description, type, aliases, official website, Wikipedia link, facts, cross-IDs |
| **Authentication** | **Keyless** (no API key, account, or billing credentials required) |
| **Entity Types** | People, corporations, startups, cities, countries, landmarks, creative works, scientific concepts |
| **Fact Label Resolution** | Automatically resolves internal Q-ID claims into human-readable strings (e.g. `P106: Q81096` → `engineer`) |
| **External Authority IDs** | VIAF, ISNI, ORCID, IMDb, Twitter/X, Facebook, Instagram, YouTube, LinkedIn, MusicBrainz, GND |
| **Multilingual Support** | 20 languages supported (English, German, French, Spanish, Japanese, Chinese, Turkish, etc.) |
| **Batch Capacity** | Fully unlocked for **1,000+ entities** per run with bounded-concurrency pooling |
| **Execution Modes** | Classic asynchronous batch jobs or warm low-latency HTTP Standby API |
| **Export Formats** | Dataset JSON, flat CSV, spreadsheet Excel, XML, HTML, Webhook integrations |

***

### 🔎 Why resolve entities against Wikidata?

[Wikidata](https://www.wikidata.org) represents the single most comprehensive open knowledge graph on earth, containing **over 110 million interconnected entities**. Unlike unstructured web pages, Wikidata provides persistent, language-agnostic identifiers (Q-IDs) paired with rich semantic statements.

However, querying raw Wikidata endpoints programmatically presents major friction for developers:

1. **Cryptic property codes**: Raw statements are encoded as abstract alphanumeric keys (e.g., `P31` for instance-of, `P106` for occupation, `P159` for headquarters).
2. **Unresolved claim targets**: Claim values often reference other Q-IDs rather than human-readable text, requiring recursive batch lookups.
3. **Throttled burst requests**: Firing hundreds of concurrent search queries against `wbsearchentities` triggers aggressive HTTP 429 rate limits and dropped connections.
4. **LLM hallucinations**: Without an external grounding anchor, generative models frequently hallucinate biographical details, executive titles, or corporate ownership.

This **Wikidata entity resolver** eliminates every layer of complexity. It handles search disambiguation, batch claim fetching (up to 50 entities per network call), and recursive label resolution behind the scenes, delivering flat, analytics-ready records ready for your data pipelines or agent context windows.

***

### ⚖️ Feature comparison: Why choose this Actor?

| Capability | Raw Wikidata API | Manual Wikipedia Search | This Apify Actor |
|---|---|---|---|
| **Identifier Disambiguation** | Returns raw Q-IDs | Manual copy-paste | **Automatic string → Q-ID matching** |
| **Fact Humanization** | Cryptic `P31`, `P106` codes | Reading freeform text | **Readable labels (e.g. "software company")** |
| **Cross-Database IDs** | Scattered across claims | Incomplete | **Unified JSON (VIAF, ISNI, ORCID, IMDb)** |
| **Batch Scalability** | Prone to 429 rate limits | Extremely slow | **1,000+ entities via bounded pooling** |
| **AI Agent Readiness** | Heavy preprocessing needed | Unusable | **Native MCP tool & RAG-ready fields** |
| **Export Formats** | Nested raw JSON only | None | **One-click CSV, Excel, JSON, API** |

***

### ✨ Core capabilities

- 🎯 **Fuzzy name disambiguation**: Matches messy input strings (e.g., `"Apple"`, `"Elon"`, `"Paris"`) to their highest-relevance canonical Wikidata Q-IDs.
- 🏷️ **Human-readable fact synthesis**: Automatically translates raw property-value tuples into plain language (e.g., `inception: "1976-04-01"`, `founders: ["Steve Jobs", "Steve Wozniak"]`).
- 🔗 **Comprehensive authority linking**: Gathers cross-database identifiers including VIAF, ISNI, ORCID, IMDb, GND, and verified corporate social profiles.
- 🌐 **True multilingual extraction**: Request labels, descriptions, and facts in any of 20 major languages with seamless English fallbacks.
- 📦 **1,000+ entity batching**: Optimized request batching handles hundreds or thousands of seed names with zero rate-limit drops.
- 🤖 **Agentic & MCP tool calling**: Plug this actor directly into Claude Desktop, Cursor, LangChain, or CrewAI via Apify's Model Context Protocol (MCP) bridge.
- ⚡ **Zero-proxy efficiency**: Connects directly to Wikidata's public infrastructure with zero proxy costs and sub-second average response times.

***

### 🏛️ Supported facts & authority mappings

The resolver parses both semantic knowledge facts and external authority identifiers, transforming Wikidata's cryptic `P`-codes into intuitive JSON keys:

#### 🧠 Semantic knowledge facts (`facts` object)

| Property Code | Output Key | Description | Example Value |
|---|---|---|---|
| `P31` | `instanceOf` | Entity class / type | `"technology company"`, `"human"` |
| `P106` | `occupation` | Professional role | `["physicist", "chemist"]` |
| `P569` | `birthDate` | Date of birth (YYYY-MM-DD) | `"1867-11-07"` |
| `P570` | `deathDate` | Date of death (YYYY-MM-DD) | `"1934-07-04"` |
| `P27` | `citizenship` | Country of legal citizenship | `["Poland", "France"]` |
| `P19` | `birthPlace` | Place of birth | `"Warsaw"` |
| `P17` | `country` | Sovereign nation | `"United States"` |
| `P159` | `headquarters` | Global corporate headquarters city | `"Cupertino"` |
| `P112` | `founder` | Original founders or creators | `["Steve Jobs", "Steve Wozniak"]` |
| `P452` | `industry` | Primary economic sector | `"consumer electronics"` |
| `P1454` | `legalForm` | Corporate entity classification | `"corporation"` |
| `P571` | `inception` | Founding or establishment date | `"1976-04-01"` |
| `P36` | `capital` | Capital city (for nations/states) | `"Washington, D.C."` |
| `P1082` | `population` | Headcount population metric | `"8336817"` |
| `P50` | `author` | Author or literary writer | `"William Shakespeare"` |
| `P57` | `director` | Film or theatrical director | `"Christopher Nolan"` |
| `P175` | `performer` | Musical artist or band | `"The Beatles"` |
| `P176` | `manufacturer` | Manufacturing entity | `"Boeing"` |

#### 🔗 Cross-database authority identifiers (`externalIds` object)

| Property Code | Output Key | Authority Registry | Use Case |
|---|---|---|---|
| `P214` | `viaf` | Virtual International Authority File | Library cataloging & global authority control |
| `P213` | `isni` | International Standard Name Identifier | Universal creator & organization reconciliation |
| `P496` | `orcid` | Open Researcher and Contributor ID | Academic research paper attribution |
| `P345` | `imdb` | Internet Movie Database | Film, television, and entertainment credits |
| `P2002` | `twitter` | Twitter / X Handle | Official social identity verification |
| `P2013` | `facebook` | Facebook Page ID | Corporate branding & social footprint |
| `P2003` | `instagram` | Instagram Handle | Influencer and corporate verification |
| `P2397` | `youtube` | YouTube Channel ID | Official video broadcast attribution |
| `P4264` | `linkedinCompany` | LinkedIn Corporate Handle | B2B lead generation & business intelligence |
| `P6634` | `linkedin` | LinkedIn Personal Profile | Executive and founder profiling |
| `P227` | `gnd` | Integrated Authority File (Germany) | European cultural & historical archiving |
| `P244` | `loc` | Library of Congress Control Number | US national library cataloging |
| `P434` | `musicbrainz` | MusicBrainz Artist ID | Music industry rights and metadata |
| `P1902` | `spotify` | Spotify Artist URI | Streaming catalog integration |
| `P2427` | `grid` | Global Research Identifier Database | Institutional research benchmarking |

***

### 🏗️ Architecture & resolution flow

```mermaid
sequenceDiagram
    autonumber
    actor User as User / AI Agent
    participant Actor as Wikidata Entity Resolver
    participant Search as wbsearchentities
    participant Entities as wbgetentities
    participant Labels as wbgetentities (Fact Labels)

    User->>Actor: Seed names or Q-IDs
    Actor->>Search: Bounded concurrent lookup (8 parallel workers)
    Search-->>Actor: Matched Q-IDs (e.g. Q312, Q7186)
    Actor->>Entities: Batched fetch (chunks of 50 Q-IDs)
    Entities-->>Actor: Raw claims, labels, sitelinks, external IDs
    Actor->>Labels: Resolve referenced fact Q-IDs in one batch
    Labels-->>Actor: Readable strings (e.g. "physicist", "Cupertino")
    Actor->>User: Structured, normalized JSON dataset
```

***

### 🎯 Use cases & industry applications

#### 1. AI agent grounding & hallucination prevention

- **Entity linking in prompts**: Before answering complex user questions, have your AI agent resolve mentioned names to verify factual founding dates, parents, or headquarters.
- **RAG chunk enrichment**: Prepend canonical Wikidata metadata (e.g., entity type, industry, aliases) to vector search embeddings to drastically improve retrieval accuracy.

#### 2. Master Data Management (MDM) & entity reconciliation

- **Customer & vendor deduplication**: Standardize company names in your CRM (e.g. "Google LLC", "Google Inc", "Alphabet") to a single canonical entity (`Q95`).
- **Cross-system identifier mapping**: Automatically enrich internal customer profiles with LEI, VIAF, ISNI, and Wikidata identifiers.

#### 3. Academic research & digital humanities

- **Author & researcher profiling**: Reconcile scholar names against ORCID, VIAF, and Library of Congress identifiers.
- **Biographical knowledge graphs**: Extract birthplaces, citizenships, and historical eras for large cohorts of historical figures.

#### 4. Due diligence, KYC & OSINT

- **Corporate footprint verification**: Verify official corporate websites, executive leadership, legal form, and registered headquarters.
- **Social media attribution**: Collect verified brand social handles (Twitter, LinkedIn, YouTube) linked directly in Wikidata.

***

### 📥 Input parameters

The actor is designed to execute immediately with zero required configuration, falling back to a curated multi-domain seed dataset of 100+ entities when run empty.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `queries` | `array` | `["Elon Musk", ...]` | List of entity names, people, brands, places, or concepts to resolve (one per line). |
| `language` | `select` | `"en"` | Language code for labels, descriptions, and facts (`en`, `de`, `fr`, `es`, `it`, `tr`, `ja`, `zh`, etc.). |
| `includeFacts` | `boolean` | `true` | When true, pulls and resolves readable key facts (type, occupation, dates, country, founders, etc.). |
| `maxResults` | `integer` | `0` | Maximum entities to return (`0` = unlimited, processes entire input list). |
| `qids` | `array` | `[]` | Optional list of specific Wikidata Q-IDs (e.g. `Q317521`, `Q95`) to bypass search and fetch directly. |
| `proxyConfiguration` | `object` | `OFF` | Proxy configuration. Disabled by default because Wikidata is open and keyless. |

#### Sample JSON configuration

```json
{
  "queries": [
    "OpenAI",
    "Jensen Huang",
    "Kyoto",
    "CRISPR gene editing",
    "Anthropic"
  ],
  "language": "en",
  "includeFacts": true,
  "maxResults": 100
}
```

***

### 📊 Output data fields

Every record pushed to the Apify dataset represents an authoritative resolved entity. Output fields use clean, normalized strings for effortless database ingestion.

| Field | Coverage | Type | Description |
|---|---|---|---|
| `query` | 🟢 High (100%) | String | Original search query or Q-ID submitted in input. |
| `qid` | 🟢 High (100%) | String | Canonical permanent Wikidata Q-ID (e.g., `"Q317521"`). |
| `label` | 🟢 High (98%) | String | Official primary name in the requested language. |
| `description` | 🟢 High (98%) | String | Concise explanatory summary statement. |
| `type` | 🟢 High (96%) | String | Humanized entity classification (e.g., `"human"`, `"business"`). |
| `aliases` | 🟡 Conditional (70%) | String | Comma-separated alternative names and acronyms. |
| `officialWebsite` | 🟡 Conditional (60%) | String | Verified primary external website URL. |
| `wikipediaUrl` | 🟢 High (92%) | String | Direct canonical link to the corresponding Wikipedia article. |
| `wikidataUrl` | 🟢 High (100%) | String | Canonical link to the Wikidata knowledge graph entry. |
| `facts` | 🟢 High (95%) | String | Serialized JSON object containing resolved fact properties. |
| `externalIds` | 🟢 High (90%) | String | Serialized JSON object of cross-database authority IDs. |
| `scrapedAt` | 🟢 High (100%) | String | ISO 8601 UTC execution timestamp. |

***

### 📋 Example JSON outputs

#### 1. Corporate technology entity

```json
{
  "query": "Apple Inc",
  "qid": "Q312",
  "label": "Apple",
  "description": "American multinational technology company",
  "type": "technology company",
  "aliases": "Apple Inc., Apple Computer, Apple Computer, Inc., AAPL",
  "officialWebsite": "https://www.apple.com/",
  "wikipediaUrl": "https://en.wikipedia.org/wiki/Apple_Inc.",
  "wikidataUrl": "https://www.wikidata.org/wiki/Q312",
  "facts": "{\"instanceOf\":\"technology company\",\"country\":\"United States\",\"headquarters\":\"Cupertino\",\"founder\":[\"Steve Jobs\",\"Steve Wozniak\",\"Ronald Wayne\"],\"industry\":\"consumer electronics\",\"legalForm\":\"corporation\",\"inception\":\"1976-04-01\"}",
  "externalIds": "{\"viaf\":\"154701235\",\"isni\":\"0000000122982463\",\"twitter\":\"Apple\",\"youtube\":\"Apple\",\"linkedinCompany\":\"apple\",\"freebase\":\"/m/0k8z\"}",
  "scrapedAt": "2026-11-10T14:35:10.124Z"
}
```

#### 2. Historical & scientific figure

```json
{
  "query": "Marie Curie",
  "qid": "Q7186",
  "label": "Marie Curie",
  "description": "Polish-French physicist and chemist (1867–1934)",
  "type": "human",
  "aliases": "Maria Skłodowska-Curie, Madame Curie",
  "officialWebsite": null,
  "wikipediaUrl": "https://en.wikipedia.org/wiki/Marie_Curie",
  "wikidataUrl": "https://www.wikidata.org/wiki/Q7186",
  "facts": "{\"instanceOf\":\"human\",\"occupation\":[\"physicist\",\"chemist\",\"professor\"],\"birthDate\":\"1867-11-07\",\"deathDate\":\"1934-07-04\",\"citizenship\":[\"Poland\",\"France\"],\"birthPlace\":\"Warsaw\"}",
  "externalIds": "{\"viaf\":\"102353774\",\"isni\":\"0000000121459207\",\"gnd\":\"118523023\",\"imdb\":\"nm1517454\",\"loc\":\"n79042211\"}",
  "scrapedAt": "2026-11-10T14:35:11.890Z"
}
```

***

### 🤖 AI Agent & MCP integration guide

Every Apify Actor can be invoked as a tool by LLM agents via the Model Context Protocol (MCP).

#### Claude Desktop MCP configuration (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/mcp-server",
        "--actors",
        "haketa/wikidata-resolver"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

#### Python LangChain tool example

```python
from langchain_community.tools.apify import ApifyActorsTool
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run_input = {
    "queries": ["DeepSeek", "Mistral AI", "Ilya Sutskever"],
    "language": "en",
    "includeFacts": True
}

run = client.actor("haketa/wikidata-resolver").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"[{item['qid']}] {item['label']}: {item['description']}")
```

#### Node.js integration

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

const client = new ApifyClient({
    token: 'YOUR_APIFY_TOKEN',
});

const run = await client.actor('haketa/wikidata-resolver').call({
    queries: ['Quantum computing', 'CRISPR', 'James Webb Space Telescope'],
    includeFacts: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Resolved ${items.length} entities:`, items.map(i => i.label));
```

***

### 🚀 How to use this actor

1. **Enter entity names**: Enter one or more names, brands, or places into the **Names to resolve** input field.
2. **Choose language**: Select your desired target language (`en` is recommended for maximum claim coverage).
3. **Configure fact extraction**: Keep **Include key facts** enabled to translate internal Q-ID codes into readable strings.
4. **Execute**: Click **Start**. The actor processes requests in bounded concurrent batches, logging live entity resolution progress.
5. **Export results**: Download your clean, structured entity records in JSON, CSV, or Excel formats.

***

### 💡 Best practices & optimization tips

- **Exact Q-ID targeting**: When resolving unambiguous entities, paste the exact Q-ID (e.g. `Q95`) into the **Q-IDs** input to skip fuzzy search and fetch canonical records instantly.
- **Handling JSON string fields**: Fields such as `facts` and `externalIds` are stored as JSON strings to maintain tabular CSV/Excel compatibility. Parse them using `JSON.parse()` in JS or `json.loads()` in Python.
- **Language fallback mechanism**: When an entity statement lacks a translation in your requested language, the actor automatically falls back to English to prevent empty data fields.
- **Zero proxy overhead**: Do not enable proxies unless operating in a restricted enterprise network. Wikidata endpoints operate cleanly over direct HTTP.

***

### ❓ Frequently Asked Questions (FAQ)

##### Do I need a Wikidata or Wikimedia account?

No. The resolver accesses the public Wikidata MediaWiki API without requiring authentication, login tokens, or subscription plans.

##### How many names can I resolve in a single run?

There is no hard limit. The actor utilizes bounded concurrency pools that throttle searches and batch entity requests up to 50 at a time, easily processing batches of 1,000+ entities without triggering rate limits.

##### Are fact properties returned as codes or readable words?

All supported facts (occupation, country, headquarters, founder, industry, etc.) are automatically resolved to human-readable labels rather than raw property codes.

##### What happens if a searched name has no match?

If Wikidata returns no matching entity for a query, the actor logs a friendly warning and continues processing the remaining names in your queue without failing.

***

### 🔗 Related AI agent & data enrichment tools

- [SEC EDGAR Scraper](https://apify.com/haketa/sec-edgar-scraper) — Extract US public company filings and financials.
- [Google Trends Scraper](https://apify.com/haketa/google-trends-scraper) — Search interest over time and breakout query intelligence.
- [G2 Reviews Scraper](https://apify.com/haketa/g2-reviews-scraper) — Extract B2B software reviews and competitor pain points.
- [Article Content Extractor](https://apify.com/haketa/article-content-extractor) — Clean text and metadata extraction from any article URL.

***

### 📋 Changelog

#### Version 1.2 (2026-11)

- **Unlocked 1,000+ batch entity resolution**: Expanded worker queues to seamlessly process 1,000+ names with bounded request fan-out.
- **Expanded 100+ entity fallback knowledge base**: Enriched zero-input demo mode with 100 diverse global entities spanning tech, history, geography, and science.
- **Accelerated prefill execution**: Streamlined batch entity fetching to resolve standard batches in seconds.
- **Enhanced fact label resolution**: Improved multi-lingual label fallback mechanics for foreign-language claims.
- **Schema & MCP optimization**: Verified full Apify CLI 2026 schema standards for zero-friction MCP agent tool calling.

#### Version 1.1 (2026-07)

- Added cross-database identifier extraction (VIAF, ISNI, ORCID, IMDb, GND).
- Implemented HTTP Standby mode for instant low-latency REST queries.
- Added support for direct Q-ID array input.

#### Version 1.0 (2026-07)

- Initial release featuring wbsearchentities search, wbgetentities batching, and claim parsing.

# Changelog

This Actor's version history is a separate document: https://apify.com/haketa/wikidata-resolver/changelog.md

# 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(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/wikidata-resolver"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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