# 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/workflows/wikidata
- Handle: `@wikidata`
- Category: [Data](https://fous.com/workflows/category/data)
- Source website: https://wikidata.org
- Last verified: Sep 29, 2026
- Fous is not affiliated with Wikidata.

## Methods

### Get facts

Operation `get_facts`, version 1. 1 credit per call.

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 | `"tour Eiffel"` |  |
| `facts` | array |  |  |
| `facts[].value` | string | `"monument historique inscrit"` |  |
| `facts[].fact_name` | string | `"statut patrimonial"` |  |
| `item_id` | string | `"Q243"` |  |
| `image_url` | string or null | `"https://commons.wikimedia.org/wiki/Special:FilePath/Tour_Eiffel_Wikimedia_Commons.jpg"` |  |
| `wikidata_url` | string | `"https://www.wikidata.org/wiki/Q243"` |  |
| `short_description` | string or null | `"tour de fer puddlé de 330 mètres à Paris, France"` |  |
| `english_wikipedia_url` | string or null | `"https://en.wikipedia.org/wiki/Eiffel_Tower"` |  |

**Example input**

```json
{
  "name": "Tour Eiffel",
  "language": "fr"
}
```

**Example output**

```json
{
  "name": "tour Eiffel",
  "facts": [
    {
      "value": "monument historique inscrit",
      "fact_name": "statut patrimonial"
    },
    {
      "value": "Historic Civil Engineering Landmark",
      "fact_name": "statut patrimonial"
    },
    {
      "value": "Émile Nouguier",
      "fact_name": "ingénieur de structure"
    }
  ],
  "item_id": "Q243",
  "image_url": "https://commons.wikimedia.org/wiki/Special:FilePath/Tour_Eiffel_Wikimedia_Commons.jpg",
  "wikidata_url": "https://www.wikidata.org/wiki/Q243",
  "short_description": "tour de fer puddlé de 330 mètres à Paris, France",
  "english_wikipedia_url": "https://en.wikipedia.org/wiki/Eiffel_Tower"
}
```

### List items by criteria

Operation `list_items_by_criteria`, version 1. 1 credit per call.

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@wikidata","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

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

### Is Fous affiliated with Wikidata?

No. Fous is not affiliated with Wikidata. This workflow reads the public wikidata.org website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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

- [Wikipedia API](https://fous.com/workflows/wikipedia.md): Wikipedia returns article summaries, images, facts, relevant search matches, readable text and daily historical events, plus human-view counts from July 2015 onward.
- [Britannica API](https://fous.com/workflows/britannica.md): Britannica returns public encyclopedia articles with introductions, quick facts, headings, update dates and images, plus search results with titles, descriptions, links and images when shown.
- [Wiktionary API](https://fous.com/workflows/wiktionary.md): A free, multilingual dictionary with word meanings and language information.
- [Wikimedia Commons API](https://fous.com/workflows/wikimedia-commons.md): Discover freely licensed photos and other images from Wikimedia Commons.
- [Wikiquote API](https://fous.com/workflows/wikiquote.md): Quotations with context and attribution from Wikiquote.
- [Fandom API](https://fous.com/workflows/fandom.md): Fan wikis for entertainment, games and popular culture.
- [US Census Bureau API](https://fous.com/workflows/us-census-bureau.md): US Census Bureau returns statistics from varying Census years, population estimates through July 1, and address geographies using Census vintages that may differ from representation.
- [World Bank API](https://fous.com/workflows/world-bank.md): World Bank provides country statistics and latest values within selected years, plus country rankings for a chosen year or the latest broadly covered year.
- [All Data workflows](https://fous.com/workflows/category/data)
