# Wikidata API

> Wikidata returns item facts and lists of items by criteria, available as a workflow and API.

Wikidata’s Get facts returns item facts from a required name, item ID, or link; hint and language are optional. Wikidata’s List items by criteria returns items of a named kind; location, award, sort, and result limit are optional.

- Page: https://fous.com/tools/wikidata
- Handle: `@wikidata`
- Category: [Data](https://fous.com/tools/category/data)
- Source website: https://wikidata.org
- Last verified: Sep 29, 2026

## Methods

### Get facts

Operation `get_facts`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get a Wikidata item’s name, description, image, links, and readable facts by name. A hint helps distinguish items with similar names. Historical values may appear alongside current values when Wikidata does not mark a preferred value; partial dates retain their known precision.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `hint` | string | no | `"chemist"` | Word in the description to distinguish similar items, for example company. |
| `name` | string | yes | `"Marie Curie"` | Name, Wikidata item ID, or Wikidata item link, for example Microsoft. |
| `language` | string | no | `"fr"` | Language code for names and facts, for example en or fr. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "hint": {
      "type": "string",
      "default": "",
      "description": "Word in the description to distinguish similar items, for example company.",
      "examples": [
        "chemist",
        "company"
      ]
    },
    "name": {
      "type": "string",
      "description": "Name, Wikidata item ID, or Wikidata item link, for example Microsoft.",
      "examples": [
        "Marie Curie",
        "Microsoft",
        "Tour Eiffel"
      ]
    },
    "language": {
      "type": "string",
      "default": "en",
      "description": "Language code for names and facts, for example en or fr.",
      "examples": [
        "fr"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "hint": "chemist",
      "name": "Marie Curie"
    },
    {
      "hint": "company",
      "name": "Microsoft"
    },
    {
      "name": "Tour Eiffel",
      "language": "fr"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `name` | string | `"Marie Curie"` |  |
| `facts` | array |  |  |
| `facts[].value` | string | `"human"` |  |
| `facts[].fact_name` | string | `"instance of"` |  |
| `item_id` | string | `"Q7186"` |  |
| `image_url` | string or null | `"https://commons.wikimedia.org/wiki/Special:FilePath/Marie_Curie_%281900%29_%28cropped%29.jpg"` |  |
| `wikidata_url` | string | `"https://www.wikidata.org/wiki/Q7186"` |  |
| `short_description` | string or null | `"Polish-born French physicist and chemist (1867–1934)"` |  |
| `english_wikipedia_url` | string or null | `"https://en.wikipedia.org/wiki/Marie_Curie"` |  |

**Example input**

```json
{
  "hint": "chemist",
  "name": "Marie Curie"
}
```

**Example output**

```json
{
  "name": "Marie Curie",
  "facts": [
    {
      "value": "human",
      "fact_name": "instance of"
    },
    {
      "value": "female",
      "fact_name": "sex or gender"
    },
    {
      "value": "Irène Joliot-Curie",
      "fact_name": "child"
    }
  ],
  "item_id": "Q7186",
  "image_url": "https://commons.wikimedia.org/wiki/Special:FilePath/Marie_Curie_%281900%29_%28cropped%29.jpg",
  "wikidata_url": "https://www.wikidata.org/wiki/Q7186",
  "short_description": "Polish-born French physicist and chemist (1867–1934)",
  "english_wikipedia_url": "https://en.wikipedia.org/wiki/Marie_Curie"
}
```

### List items by criteria

Operation `list_items_by_criteria`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

List Wikidata items of a named kind, optionally in a country or directly assigned to a region or city, or with an award. Sort by Wikipedia language editions, date, or name; partial dates are left blank.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `kind` | string | yes | `"person"` | Kind of item, for example university or person. |
| `sort` | string | no | `"oldest"` | Result order; most_notable ranks by number of Wikipedia language editions, for example newest. |
| `award` | string | no | `"Nobel Prize in Physics"` | Optional award received, for example Nobel Prize in Physics. |
| `located_in` | string | no | `"Canada"` | Optional country, region, or city, for example Canada. |
| `max_results` | integer | no | `5` | Maximum number of items, for example 50 (up to 500). |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "kind"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Kind of item, for example university or person.",
      "examples": [
        "person",
        "university",
        "museum"
      ]
    },
    "sort": {
      "enum": [
        "most_notable",
        "newest",
        "oldest",
        "alphabetical"
      ],
      "type": "string",
      "default": "most_notable",
      "description": "Result order; most_notable ranks by number of Wikipedia language editions, for example newest.",
      "examples": [
        "oldest"
      ]
    },
    "award": {
      "type": "string",
      "default": "",
      "description": "Optional award received, for example Nobel Prize in Physics.",
      "examples": [
        "Nobel Prize in Physics"
      ]
    },
    "located_in": {
      "type": "string",
      "default": "",
      "description": "Optional country, region, or city, for example Canada.",
      "examples": [
        "Canada",
        "Germany"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 50,
      "maximum": 500,
      "minimum": 1,
      "description": "Maximum number of items, for example 50 (up to 500).",
      "x-fous-developer": true,
      "examples": [
        5,
        4
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "kind": "person",
      "award": "Nobel Prize in Physics",
      "max_results": 5
    },
    {
      "kind": "university",
      "located_in": "Canada",
      "max_results": 5
    },
    {
      "kind": "museum",
      "sort": "oldest",
      "located_in": "Germany",
      "max_results": 4
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `items` | array |  |  |
| `items[].name` | string | `"Albert Einstein"` |  |
| `items[].country` | string or null | `"Germany"` |  |
| `items[].item_id` | string | `"Q937"` |  |
| `items[].start_date` | string or null | `"1879-03-14"` |  |
| `items[].wikidata_link` | string | `"https://www.wikidata.org/wiki/Q937"` |  |
| `items[].short_description` | string or null | `"German-born theoretical physicist (1879–1955)"` |  |
| `items[].english_wikipedia_link` | string or null | `"https://en.wikipedia.org/wiki/Albert_Einstein"` |  |

**Example input**

```json
{
  "kind": "person",
  "award": "Nobel Prize in Physics",
  "max_results": 5
}
```

**Example output**

```json
{
  "items": [
    {
      "name": "Albert Einstein",
      "country": "Germany",
      "item_id": "Q937",
      "start_date": "1879-03-14",
      "wikidata_link": "https://www.wikidata.org/wiki/Q937",
      "short_description": "German-born theoretical physicist (1879–1955)",
      "english_wikipedia_link": "https://en.wikipedia.org/wiki/Albert_Einstein"
    },
    {
      "name": "Marie Curie",
      "country": "France",
      "item_id": "Q7186",
      "start_date": "1867-11-07",
      "wikidata_link": "https://www.wikidata.org/wiki/Q7186",
      "short_description": "Polish-born French physicist and chemist (1867–1934)",
      "english_wikipedia_link": "https://en.wikipedia.org/wiki/Marie_Curie"
    },
    {
      "name": "Niels Bohr",
      "country": "Kingdom of Denmark",
      "item_id": "Q7085",
      "start_date": "1885-10-07",
      "wikidata_link": "https://www.wikidata.org/wiki/Q7085",
      "short_description": "Danish physicist (1885–1962)",
      "english_wikipedia_link": "https://en.wikipedia.org/wiki/Niels_Bohr"
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@wikidata",
  "visibility": "public",
  "operation": "get_facts",
  "version": 1,
  "input": {
    "hint": "chemist",
    "name": "Marie Curie"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@wikidata\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_facts\",\n  \"version\": 1,\n  \"input\": {\n    \"hint\": \"chemist\",\n    \"name\": \"Marie Curie\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@wikidata",
  "visibility": "public",
  "operation": "get_facts",
  "version": 1,
  "input": {
    "hint": "chemist",
    "name": "Marie Curie"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/wikidata`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_facts`: Get facts. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `list_items_by_criteria`: List items by criteria. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-wikidata https://api.fous.com/mcp/tools/wikidata --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Research facts about a company or person.
- Find universities located in a country or city.
- List people who received a specified award.
- Sort items by date, name, or Wikipedia language editions.

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Wikidata tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Wikidata account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from wikidata.org when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### What facts does Wikidata provide about an item?

Get facts returns an item’s name, description, image, links, and readable facts. Supply a name, item ID, or link.

### Which items match a kind and location?

List items by criteria returns items of a named kind, optionally filtered by country, region, or city.

### Can I find items that received an award?

Yes. List items by criteria accepts an optional award, such as the Nobel Prize in Physics.

## Related

- [All Data tools](https://fous.com/tools/category/data)
