# Wikidata — Structured Knowledge & Entity Search (`omao/wikidata`) Actor

Search 100M+ Wikidata entities into clean JSON: label, description, aliases, statements (properties and values), Wikipedia link and Wikidata URL. Powered by the public MediaWiki/Wikidata API. No API key.

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

## Pricing

$1.00 / 1,000 entities

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 — Structured Knowledge & Entity Search to JSON

**Search millions of Wikidata entities — as clean JSON.** Pass names of people, places, organizations or concepts and get back a tidy row per entity: label, description, aliases, statements (properties and values), Wikipedia link and Wikidata URL. Powered by the public MediaWiki / Wikidata API — no API key.

The easy way to pull structured facts into knowledge graphs, apps and AI pipelines.

### Who uses this

- 🤖 **AI / LLM & knowledge-graph builders** — ground models in structured facts.
- 🔎 **Researchers & data teams** — build entity datasets across domains.
- 🌐 **Content & search tools** — enrich pages with facts and links.
- 🧩 **Data enrichment** — resolve names to canonical IDs (QIDs).
- 🧑‍💻 **Developers** — a clean Wikidata endpoint by name.

### What you get — one clean row per entity

| Field | Description |
|---|---|
| `id` | Wikidata QID |
| `label` | Entity label |
| `description` | Short description |
| `aliases` + `aliasCount` | Alternative names |
| `statements` | Properties and their values |
| `propertyCount` | Number of properties |
| `wikipediaUrl` + `wikipediaTitle` | Linked Wikipedia article |
| `wikidataUrl` | Wikidata entity page |
| `sitelinkCount` | Linked wiki sites |
| `query`, `scrapedAt` | Provenance |

### Example

**Input**

```json
{ "queries": ["Douglas Adams", "Mount Everest"], "language": "en", "maxResultsPerQuery": 10 }
```

**Output (one item)**

```json
{
  "id": "Q42",
  "label": "Douglas Adams",
  "description": "English writer and humorist (1952–2001)",
  "aliases": ["Douglas Noël Adams", "DNA"], "aliasCount": 2,
  "propertyCount": 120,
  "wikipediaUrl": "https://en.wikipedia.org/wiki/Douglas_Adams",
  "wikidataUrl": "https://www.wikidata.org/wiki/Q42"
}
```

### Why this actor

- ✅ **Structured facts** — properties and values, not just text.
- 🌐 **Any language** — labels, descriptions and Wikipedia links localized.
- 🔗 **Canonical IDs** — resolve names to Wikidata QIDs.
- 📚 **Wikipedia links** — jump from entity to article.
- ⚡ **Fast & affordable** — pay only per entity returned. No API key.

### Input options

- `queries` *(required)* — entity names to look up.
- `language` — language code for labels/descriptions (default `en`).
- `maxResultsPerQuery` — cap entities per query.

### FAQ

**What are statements?** Property→value facts (e.g. "instance of → human"), returned as a structured list.

**Do I get the Wikidata QID?** Yes — `id` is the canonical QID (e.g. `Q42`).

**Which languages?** Any Wikidata language — set `language`.

**How fresh is the data?** Live from the MediaWiki/Wikidata API on every run.

**Can I export to CSV/Excel/Google Sheets?** Yes — the dataset exports to JSON, CSV, Excel and HTML, or pull it via the API.

**What does it cost?** Pay-per-entity — you're only charged for entities actually returned.

***

*Tip: pair this with the Wikipedia actor — resolve a name to a QID here, then pull the article summary there.*

# Actor input Schema

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

Entities to look up (people, places, organizations, concepts). One search per query.

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

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

## `maxResultsPerQuery` (type: `integer`):

Cap the number of entities returned per query.

## `healthCheckMode` (type: `boolean`):

Internal monitoring: run a canary search and FAIL if broken (no billing).

## Actor input object example

```json
{
  "queries": [
    "Marie Curie",
    "Tesla Inc",
    "Mount Everest"
  ],
  "language": "en",
  "maxResultsPerQuery": 10,
  "healthCheckMode": false
}
```

# Actor output Schema

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

All matched entities (label, description, aliases, statements, Wikipedia link).

# 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": [
        "Douglas Adams"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("omao/wikidata").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": ["Douglas Adams"] }

# Run the Actor and wait for it to finish
run = client.actor("omao/wikidata").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": [
    "Douglas Adams"
  ]
}' |
apify call omao/wikidata --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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