# Wikipedia & Wikidata API - Entity Facts, Summary & Pageviews (`centorprat/wikipedia-wikidata-api`) Actor

Wikipedia & Wikidata API: give any company, person, place or thing and get one structured record: summary, Wikidata ID, key facts (country, founded, HQ, CEO, website, industry...), image and 30-day pageviews. Use it for LLM grounding and entity enrichment. Keyless, bulk.

- **URL**: https://apify.com/centorprat/wikipedia-wikidata-api.md
- **Developed by:** [Centor Prat](https://apify.com/centorprat) (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 $2.55 / 1,000 entity resolveds

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

## 🧩 Wikipedia & Wikidata API: Entity Facts, Summary & Pageviews

**One call, Wikipedia + Wikidata, one brief.** Give an entity name (company, person, place, thing)
and get a single structured brief — **summary, resolved facts** (type, country, inception, website,
HQ, industry, CEO, founder, population, revenue…), coordinates, and a **30-day popularity** signal —
instead of scraping Wikipedia and crawling Wikidata yourself.

Headless · **keyless** · structured JSON out · built for AI agents (grounding & enrichment).

### ⚡ Why it's different

Other actors dump *raw* Wikipedia text. This one **resolves and fuses**: it maps the page to its
Wikidata entity, pulls the structured claims, resolves their labels, and adds popularity — so you get
`ceo: Sam Altman`, `country: United States`, `inception: 2015-12-11`, not a wall of prose.

### 📋 What you get (per entity)

| Field | Meaning |
|---|---|
| `title`, `wikidataId` | Resolved canonical name + Wikidata QID |
| `description`, `extract` | Short description + lead summary |
| `facts` | Structured: `instanceOf`, `country`, `inception`, `officialWebsite`, `headquarters`, `industry`, `ceo`, `founder`, `capital`, `population`, `employees`, `revenueUsd`, `motto` |
| `coordinates` | lat/lon (for places/HQs) |
| `url`, `thumbnail` | Wikipedia page + image |
| `monthlyPageviews` | Views in the last 30 days (popularity) |
| `isDisambiguation`, `resolved` | Flags for ambiguous/unfound names |

### 📥 Input

| Field | Type | Meaning |
|---|---|---|
| `entity` | string | A single name, e.g. `OpenAI` |
| `entities` | array | Many names: `["OpenAI","Spain","Bitcoin"]` (billed per entity) |
| `language` | string | Wikipedia language edition (default `en`) |
| `webhookUrl` | string | POST the briefs here (Zapier/Make/n8n/custom) |

**Example input**

```json
{ "entities": ["OpenAI", "Spain", "Bitcoin"], "language": "en" }
```

### 📤 Output (one row per entity)

```json
{
  "query": "OpenAI", "resolved": true, "title": "OpenAI", "wikidataId": "Q21708200",
  "description": "American artificial intelligence company",
  "extract": "OpenAI is an American artificial intelligence ...",
  "url": "https://en.wikipedia.org/wiki/OpenAI", "thumbnail": "https://.../OpenAI_Logo.svg.png",
  "coordinates": { "lat": 37.76, "lon": -122.41 },
  "facts": {
    "instanceOf": { "qid": "Q6881511", "label": "enterprise" },
    "country": { "qid": "Q30", "label": "United States" },
    "inception": { "value": "2015-12-11" },
    "officialWebsite": { "value": "https://openai.com/" },
    "ceo": { "qid": "Q7407093", "label": "Sam Altman" },
    "industry": { "qid": "Q11660", "label": "artificial intelligence" },
    "employees": { "value": 4500 }
  },
  "hasFacts": true, "monthlyPageviews": 354585,
  "sources": ["wikipedia.org", "wikidata.org", "wikimedia.org (pageviews)"],
  "capturedAt": "2026-..."
}
```

### 💰 Pricing (pay-per-event menu)

- **`entity-resolved`** — base, per entity returned.
- **`facts-enriched`** — premium, per entity that yields structured Wikidata facts (the high-value outcome).

### 💡 Use cases

- **Agent grounding / disambiguation:** resolve "Apple" → the company, with QID + facts, in one call.
- **Enrichment:** turn a list of company/person names into structured records.
- **RAG / knowledge:** fetch a vetted summary + facts + source URL to ground an answer.
- **Research dashboards:** popularity (pageviews) + key facts across many entities.

### 🤖 For AI agents (MCP)

Keyless, one call → a resolved, fused, structured brief with the Wikidata QID for further hops.
Example MCP server config:

```json
{
  "mcpServers": {
    "entity-brief": {
      "url": "https://mcp.apify.com/?tools=actors,docs,centorprat/wikipedia-wikidata-api"
    }
  }
}
```

**Claude Code:** `claude mcp add --transport http apify "https://mcp.apify.com/?tools=actors,docs,centorprat/wikipedia-wikidata-api" --header "Authorization: Bearer <YOUR_APIFY_TOKEN>"`

No extra setup: this Actor is callable from Claude, Cursor, ChatGPT or any MCP client through the Apify MCP server, and agents can find it on their own with the server's `search-actors` tool.

### 🚀 Ready-made tasks (one click)

Pre-configured runs for the most common jobs. Open one, change the input, run:

- [Company Facts from Wikipedia & Wikidata](https://apify.com/centorprat/wikipedia-wikidata-api/examples/company-facts-from-wikipedia): Structured company facts from Wikipedia and Wikidata: CEO, HQ, founding date, industry, website and pageviews for any list of companies.
- [Wikipedia Summary for Any Topic](https://apify.com/centorprat/wikipedia-wikidata-api/examples/wikipedia-summary-any-topic): Clean Wikipedia summaries for any list of topics with Wikidata ID, description, image and key facts. Any language. LLM-ready JSON.
- [Wikipedia Pageviews: How Popular Is It?](https://apify.com/centorprat/wikipedia-wikidata-api/examples/wikipedia-pageviews-popularity): Compare popularity of people, brands and topics with 30-day Wikipedia pageviews, plus summary and Wikidata facts. Bulk, keyless.

### ❓ FAQ

- **Do I need an API key?** No — Wikipedia and Wikidata are keyless with generous limits.
- **What counts as an entity?** Anything with a Wikipedia page: companies, people, places, products, concepts.
- **Ambiguous names?** If the page is a disambiguation, `isDisambiguation` is true — refine the name.
- **Not found?** `resolved` is false and the row carries just your query (so nothing is lost).
- **Which facts?** A curated set of high-value Wikidata properties; item values are label-resolved.
- **Other languages?** Yes — set `language` (e.g. `es`, `de`); facts/labels resolve in that language.
- **How fresh is popularity?** `monthlyPageviews` sums the last ~30 days of Wikipedia views.
- **Is data stored?** No — fetched, composed, returned.
- **Commercial use?** Wikipedia & Wikidata are free content (CC BY-SA / CC0); attribute as appropriate.

### 📜 Data & attribution

Summaries from **Wikipedia** (CC BY-SA), structured facts from **Wikidata** (CC0), popularity from
the **Wikimedia** pageviews API. Public data, composed and returned; nothing stored.

### 🔗 Related actors

Part of one suite of keyless, agent-ready composers by the same developer:

- [Shopify Store Leads + App Audit (Reviews, Email, Pixels)](https://apify.com/centorprat/shopify-store-leads-app-audit): Shopify stores by niche, verified and audited for missing apps (reviews, email/SMS, upsell, loyalty, chat, subscriptions), pixels and theme: scored leads with emails.
- [Google Maps Leads + Website Audit for Agencies](https://apify.com/centorprat/google-maps-leads-website-audit): local businesses from Google Maps audited for website, Google profile, reviews, booking and tracking gaps: scored, explained leads with phone and emails.
- [FEMA Flood Zone & Property Risk API - Zillow/Redfin Enricher](https://apify.com/centorprat/fema-flood-zone-property-risk): FEMA flood zone + 18-hazard FEMA risk index + neighborhood demographics per US address, or for a whole Zillow/Redfin dataset.
- [Domain Lookup API - DNS, MX, SPF, Tech & Contact Emails](https://apify.com/centorprat/domain-lookup-dns-mx-email): DNS + live homepage → IPs, MX/SPF, tech, socials and public contacts per domain.
- [Country Economic Data API - World Bank GDP, FX & Holidays](https://apify.com/centorprat/world-bank-country-economic-data): World Bank + FX + public holidays → one market brief per country.
- [Weather, Air Quality & Earthquake Risk API by Location](https://apify.com/centorprat/weather-air-quality-earthquake-api): live weather + air quality + earthquakes → one clear/caution/hazard verdict per point, worldwide.
- [Aircraft Tracker API (ADS-B) - Approach & Military Alerts](https://apify.com/centorprat/aircraft-tracker-adsb): aircraft approaching a point with CPA/ETA + military/unidentified flags and alerts.
- [NARA Catalog Extractor](https://apify.com/centorprat/nara-catalog-extractor): US National Archives catalog search → digital-object download URLs + metadata.

# Actor input Schema

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

A single entity name (company, person, place, thing). Example: OpenAI

## `entities` (type: `array`):

An array of names, e.g. \["OpenAI","Spain","Bitcoin"]. Billed per entity.

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

Wikipedia language edition (ISO code). Default en.

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

If set, the briefs are POSTed here as JSON (Zapier/Make/n8n/custom).

## Actor input object example

```json
{
  "entity": "OpenAI",
  "language": "en"
}
```

# Actor output Schema

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

One fused brief per entity: resolved title + Wikidata ID, description, extract, URL, thumbnail, coordinates, structured facts (type/country/inception/website/HQ/industry/CEO/founder/population/revenue…), and 30-day pageviews.

# 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 = {
    "entity": "OpenAI",
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("centorprat/wikipedia-wikidata-api").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 = {
    "entity": "OpenAI",
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("centorprat/wikipedia-wikidata-api").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 '{
  "entity": "OpenAI",
  "language": "en"
}' |
apify call centorprat/wikipedia-wikidata-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,centorprat/wikipedia-wikidata-api"
        }
    }
}
```

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/0dktxJPD54rAKfoks/builds/np4L6AT9YDDg2GWPF/openapi.json
