# Wikipedia Entity Intelligence — Facts & Trends (AI) (`noniner/wikipedia-entity-intelligence`) Actor

Look up any company, person, product or topic across Wikipedia and Wikidata: a clean summary, structured facts (founded, industry, HQ, key people) and 60-day pageview trend — with an AI brief. For entity enrichment, research and knowledge graphs.

- **URL**: https://apify.com/noniner/wikipedia-entity-intelligence.md
- **Developed by:** [Fredrik Hansson](https://apify.com/noniner) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 entity analyzeds

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/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 Entity Intelligence — Facts & Trends (AI)

**Hand it a name, get back an entity.** Give this Actor a list of companies, people, products or topics and it resolves each one to its Wikipedia article, pulls a clean summary, extracts **structured facts from Wikidata** (founded, industry, headquarters, key people, employees, website, country), measures a **60-day pageview trend**, and uses OpenAI to write a short, grounded **brief** — the category, the key facts, and what the attention curve is saying.

You bring the names. It hands back a knowledge record for each.

***

### The flow

```
            ┌──────────────► Wikipedia summary (extract · description · Q-id)
  "Stripe" ─┤
  "Elon Musk"─────────────► Wikidata facts (founded · industry · HQ · CEO · …)
  "Kubernetes"             
            └──────────────► Wikimedia pageviews (60-day total + trend)
                                         │
                                         ▼
                                   AI brief (OpenAI)
                               category · keyFacts · attentionSignal
```

1. **Resolve** — each name is searched against Wikipedia to find the best-matching article title (no-match is handled gracefully).
2. **Summarize** — the REST summary endpoint gives a trimmed extract, a one-line description, the page type, the canonical URL and the Wikidata Q-id.
3. **Fact-extract** — when there's a Q-id, Wikidata claims are parsed for the common properties and any referenced entities are resolved to human labels in one batched call.
4. **Trend** — the last 60 days of daily pageviews are summed and split into first-30 vs last-30 to classify the trend as rising / falling / stable.
5. **Brief** — OpenAI (`gpt-4o-mini`, fast and low-cost) writes a 2–3 sentence brief, a category, key facts and an attention signal — **grounded only in the fetched data. No invented facts.**

***

### What you get per entity

For every entity the Actor returns:

1. **`resolvedTitle`** and **`pageUrl`** — the exact Wikipedia article it matched, plus the canonical desktop link.
2. **`wikidataId`**, **`description`** and **`extract`** — the Q-id, the short description line and the trimmed summary paragraph.
3. **Structured facts from Wikidata** — `founded`, `industry`, `headquarters`, `foundedBy`, `ceo`, `employees`, `website`, `country`, `instanceOf`. Anything not stated stays `null`.
4. **`pageviews60d`** and **`pageviewTrend`** — total Wikipedia pageviews over the last 60 days and whether attention is rising, falling or stable.
5. **AI layer** — `category` (person / company / product / technology / place / other), `keyFacts` (short strings built only from the data), `attentionSignal` (one sentence on the trend), and `aiBrief` (2–3 sentences).

If a name has no Wikipedia match, you still get a record with `error` set so nothing silently disappears.

***

### Three ways people use it

- **Entity enrichment** — turn a raw list of company or product names into structured **entity data**: founding year, industry, HQ and key people pulled straight from **Wikidata**, ready to merge into your CRM or data warehouse. A free, transparent alternative for firmographic-style enrichment.
- **Knowledge-graph building** — resolve names to stable **Wikidata** Q-ids and the canonical **Wikipedia API** record, then wire the `instanceOf` / `industry` / `country` relations into your **knowledge graph** without hand-mapping entities.
- **Research & brand monitoring** — track the 60-day **pageviews** trend for the people, products and companies you care about, with an AI-written brief that tells you at a glance what each one is and whether public attention is climbing.

Keywords this Actor is built around: **Wikipedia API**, **Wikidata**, **entity data**, **pageviews**, **knowledge graph**.

***

### Input

| Field | Type | Notes |
|---|---|---|
| `entities` | array | **Required.** Names to look up — companies, people, products, topics. One per line. |
| `lang` | string | Wikipedia language edition code. Default `en`. |
| `includePageviews` | boolean | Fetch the 60-day pageview trend. Default `true`. |
| `maxResults` | integer | Cap how many entities to process. Default `200`. |
| `maxConcurrency` | integer | Entities processed in parallel. Default `4`. |
| `model` | string | Override the OpenAI model. Default `gpt-4o-mini`. |

#### Minimal input example

```json
{
  "entities": ["Stripe", "Elon Musk", "Kubernetes"]
}
```

***

### Output example

```json
{
  "input": "Stripe",
  "resolvedTitle": "Stripe, Inc.",
  "wikidataId": "Q2944583",
  "description": "American financial services company",
  "extract": "Stripe, Inc. is an Irish-American multinational financial services and software as a service company ...",
  "category": "company",
  "founded": "2010",
  "industry": "financial technology",
  "headquarters": "South San Francisco",
  "foundedBy": "Patrick Collison",
  "ceo": "Patrick Collison",
  "employees": "8000",
  "website": "https://stripe.com",
  "country": "United States of America",
  "instanceOf": "business",
  "pageUrl": "https://en.wikipedia.org/wiki/Stripe,_Inc.",
  "pageviews60d": 184230,
  "pageviewTrend": "rising",
  "keyFacts": [
    "Founded in 2010 by Patrick and John Collison",
    "Operates in financial technology / payments",
    "Headquartered in South San Francisco"
  ],
  "attentionSignal": "Pageviews rose over the last 60 days, suggesting increased public interest.",
  "aiBrief": "Stripe is an American fintech company founded in 2010 that provides payment-processing software and APIs for online businesses. It is one of the most valuable private technology companies, serving merchants worldwide."
}
```

***

### Pay-per-event pricing

This Actor uses **pay-per-event** billing with a single event:

| Event | Charged when |
|---|---|
| `entity-analyzed` | Once per entity resolved across Wikipedia and Wikidata with facts, pageview trend and an AI brief. **$0.10** |

The Actor logs its OpenAI token usage and the estimated AI cost at the end of every run, so the event price always stays safely above the model cost.

***

### Data source

All data comes from the public, free **Wikipedia**, **Wikidata** and **Wikimedia** REST/Action APIs — no API key for the data itself. As the Wikimedia APIs require, every request is sent with a descriptive **User-Agent** identifying this Actor, so usage stays within their policy. Facts reflect whatever the community has published; missing claims come back as `null` rather than being guessed.

***

### Setup

The AI brief calls the OpenAI API. Set the environment variable / secret **`OPENAI_API_KEY`** on the Actor. The Wikipedia, Wikidata and pageview data require no key.

***

### Use it from an AI agent (Apify MCP server)

This Actor is available through the [Apify MCP server](https://mcp.apify.com), so AI agents (Claude, ChatGPT, or anything that speaks MCP) can call it as a tool — hand it a list of entity names and read back structured facts, pageview trends and briefs — with no custom integration code.

***

### Run it locally

```bash
npm install
## put your input in storage/key_value_stores/default/INPUT.json
export OPENAI_API_KEY=sk-...
apify run -p
```

***

### Related actors

- [AI Company Enrichment](https://apify.com/noniner/ai-company-enrichment) — Turn a list of domains into structured company profiles: firmographics, contacts, socials and ICP fit.
- [Google News Scraper](https://apify.com/noniner/google-news-scraper) — Pull fresh news headlines and articles for any query, company or topic.
- [B2B Account Brief](https://apify.com/noniner/b2b-account-brief) — Build a ready-to-read account brief for any company for sales and research.
- [Research Paper Intelligence](https://apify.com/noniner/research-paper-intelligence) — Search and summarize academic papers with structured metadata and AI briefs.

***

**Part of the [No Niner](https://noniner.io) toolkit** — no-code web scraping, enrichment & AI data tools, all pay-per-use. Browse the full set at **[noniner.io](https://noniner.io)**.

# Actor input Schema

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

Names to look up — companies, people, products or topics. One per line.

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

Wikipedia language edition code (e.g. en, de, sv).

## `includePageviews` (type: `boolean`):

Fetch the last 60 days of Wikipedia pageviews and compute a trend.

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

Max entities to analyze. One pay-per-event charge per entity resolved.

## `maxConcurrency` (type: `integer`):

How many entities to process in parallel.

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

Override the model (default gpt-4o-mini).

## Actor input object example

```json
{
  "entities": [
    "Stripe",
    "Kubernetes"
  ],
  "lang": "en",
  "includePageviews": true,
  "maxResults": 200,
  "maxConcurrency": 4
}
```

# Actor output Schema

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

All enriched entity records in the default dataset.

# 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 = {
    "entities": [
        "Stripe",
        "Kubernetes"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("noniner/wikipedia-entity-intelligence").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 = { "entities": [
        "Stripe",
        "Kubernetes",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("noniner/wikipedia-entity-intelligence").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 '{
  "entities": [
    "Stripe",
    "Kubernetes"
  ]
}' |
apify call noniner/wikipedia-entity-intelligence --silent --output-dataset

```

## MCP server setup

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

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/6s5GiJ073IkoouzqJ/builds/m5O3w7SVRYWtIMR1f/openapi.json
