# Wikidata API
> The Wikidata structured knowledge graph as an API — the free, collaborative, multilingual knowledgebase that underpins Wikipedia and thousands of apps, powered by the official Wikidata action API. Search the knowledge graph by text to find entities and their Q-ids; read an entity for its label, description, aliases, a summary of its statements (each property with sample values), sitelink count and Wikipedia link; fetch the full claims for a property of an entity (values, ranks, qualifiers); resolve up to 50 Q/P ids to human-readable labels and descriptions in a single call; and look up any property's label, description and datatype. Covers tens of millions of items — people, places, organisations, works, species, events and concepts — in any language. Ideal for knowledge-graph and fact-lookup tools, entity linking and disambiguation, data enrichment, semantic search and research apps. Data is CC0.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/wikidata-api/..."
```

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 35,000 calls/Mo, 8 req/s
- **Pro** ($20/Mo) — 150,000 calls/Mo, 20 req/s
- **Mega** ($54/Mo) — 600,000 calls/Mo, 50 req/s

## Endpoints

### Entities

#### `GET /v1/entity` — An entity with a statement summary

**Parameters:**
- `id` (query, required, string) — Q-id, e.g. Q42 Example: `Q42`
- `language` (query, optional, string) — Language code (default en) Example: `en`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikidata-api/v1/entity?id=Q42&language=en"
```

**Response:**
```json
{
    "data": {
        "entity": {
            "id": "Q42",
            "type": "item",
            "label": "Douglas Adams",
            "aliases": [],
            "wikipedia": "https://en.wikipedia.org/wiki/Douglas_Adams",
            "statements": [
                {
                    "count": 1,
                    "values": [
                        {
                            "type": "entity",
                            "value": "Q5"
                        }
                    ],
                    "property": "P31"
                },
                {
                    "count": 1,
                    "values": [
                        {
                            "type": "entity",
                            "value": "Q6581097"
                        }
                    ],
                    "property": "P21"
                },
                {
                    "count": 8,
                    "values": [
                        {
                            "type": "entity",
                            "value": "Q214917"
                        },
                        {
                            "type": "entity",
                            "value": "Q28389"
                        },
                        {
                            "type": "entity",
                            "value": "Q6625963"
                        },
                        {
                            "type": "entity",
                            "value": "Q48537
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search the knowledge graph

**Parameters:**
- `query` (query, required, string) — Search text, e.g. Douglas Adams Example: `Douglas Adams`
- `type` (query, optional, string) — item|property|lexeme Example: `item`
- `language` (query, optional, string) — Language code (default en) Example: `en`
- `limit` (query, optional, string) — Max results (1-50)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikidata-api/v1/search?query=Douglas+Adams&type=item&language=en"
```

**Response:**
```json
{
    "data": {
        "count": 10,
        "query": "Douglas Adams",
        "results": [
            {
                "id": "Q42",
                "url": "http://www.wikidata.org/entity/Q42",
                "label": "Douglas Adams",
                "aliases": [],
                "description": "British science fiction writer and humorist (1952–2001)"
            },
            {
                "id": "Q28421831",
                "url": "http://www.wikidata.org/entity/Q28421831",
                "label": "Douglas Adams",
                "aliases": [],
                "description": "American environmental engineer"
            },
            {
                "id": "Q117249850",
                "url": "http://www.wikidata.org/entity/Q117249850",
                "label": "Douglas Adams",
                "aliases": [],
                "description": "Global Co-Head of Equity Capital Markets, Citi"
            },
            {
                "id": "Q61853920",
                "url": "http://www.wikidata.org/entity/Q61853920",
                "label": "Douglas H Adams",
                "aliases": [
                    "Douglas Adams"
                ],
                "description": "researcher ORCID ID = 0000-0002-3539-6629"
            },
            {
                "id": "Q75630160",
                "url": "http://www.wikidata.org/entity/Q75630160",
                "label": "Douglas Jerrold Adams",
                "aliases": [
                    "Douglas Adams"
     
…(truncated, see openapi.json for full schema)
```

### Statements

#### `GET /v1/claims` — Claims for a property of an entity

**Parameters:**
- `id` (query, required, string) — Q-id, e.g. Q42 Example: `Q42`
- `property` (query, optional, string) — P-id, e.g. P69 (omit for all) Example: `P69`
- `limit` (query, optional, string) — Max properties

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikidata-api/v1/claims?id=Q42&property=P69"
```

**Response:**
```json
{
    "data": {
        "claims": [
            {
                "count": 2,
                "property": "P69",
                "statements": [
                    {
                        "rank": "normal",
                        "value": {
                            "type": "entity",
                            "value": "Q4961791"
                        },
                        "qualifiers": [
                            "P582",
                            "P580"
                        ]
                    },
                    {
                        "rank": "normal",
                        "value": {
                            "type": "entity",
                            "value": "Q691283"
                        },
                        "qualifiers": [
                            "P812",
                            "P512",
                            "P580",
                            "P582"
                        ]
                    }
                ]
            }
        ],
        "entity": "Q42",
        "property": "P69",
        "property_count": 1,
        "total_statements": 2
    },
    "meta": {
        "timestamp": "2026-06-01T08:14:05.438Z",
        "request_id": "8ef198c4-9dff-4ec8-819a-7ad6d84783e3"
    },
    "status": "ok",
    "message": "Claims retrieved",
    "success": true
}
```

#### `GET /v1/labels` — Resolve Q/P ids to labels (batch)

**Parameters:**
- `ids` (query, required, string) — Comma-separated ids, e.g. Q42,Q64,P31 Example: `Q42,Q64,P31`
- `language` (query, optional, string) — Language code (default en) Example: `en`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikidata-api/v1/labels?ids=Q42%2CQ64%2CP31&language=en"
```

**Response:**
```json
{
    "data": {
        "count": 3,
        "labels": {
            "P31": {
                "label": "instance of",
                "description": "type to which this subject corresponds/belongs. Different from P279 (subclass of); for example: K2 is an instance of mountain; volcano is a subclass of mountain"
            },
            "Q42": {
                "label": "Douglas Adams",
                "description": "British science fiction writer and humorist (1952–2001)"
            },
            "Q64": {
                "label": "Berlin",
                "description": "federated state, capital and largest city of Germany"
            }
        },
        "language": "en"
    },
    "meta": {
        "timestamp": "2026-06-01T08:14:05.713Z",
        "request_id": "1b310788-7586-45d9-ab21-9aabba8e1c3f"
    },
    "status": "ok",
    "message": "Labels retrieved",
    "success": true
}
```

### Reference

#### `GET /v1/property` — A property's metadata

**Parameters:**
- `id` (query, required, string) — P-id, e.g. P69 Example: `P69`
- `language` (query, optional, string) — Language code (default en) Example: `en`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikidata-api/v1/property?id=P69&language=en"
```

**Response:**
```json
{
    "data": {
        "property": {
            "id": "P69",
            "label": "educated at",
            "aliases": [
                "alma mater",
                "education",
                "alumni of",
                "alumna of",
                "college attended",
                "school attended",
                "studied at",
                "graduate of",
                "graduated from",
                "faculty",
                "place of education",
                "alumnus of",
                "attended",
                "went to school at",
                "schooled at",
                "attended school at",
                "schooling place",
                "education place",
                "student of",
                "student at"
            ],
            "datatype": "wikibase-item",
            "description": "educational institution attended by subject"
        }
    },
    "meta": {
        "timestamp": "2026-06-01T08:14:05.943Z",
        "request_id": "38ebe279-912c-4b27-a597-b34c9f17c834"
    },
    "status": "ok",
    "message": "Property retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikidata-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "The Wikidata structured knowledge graph. /v1/search?query=Douglas Adams (type=item|property, language=en) = search entities, returning their Q/P ids, labels & descriptions; /v1/entity?id=Q42 = an entity with its label, description, aliases, a summary of its statements (property + value samples), sitelink count and Wikipedia link; /v1/claims?id=Q42&property=P69 = the statements for a property of an entity (value, rank, qualifiers; omit property for all); /v1/labels?ids=Q42,Q64,P31 = resolve up to 50 Q/P ids to human-readable labels & descriptions in one call; /v1/property?id=P69 = a property's label, description and datatype. Items are Q-ids, properties are P-ids. Statement values reference other entities by id — resolve them with /v1/labels. Data from Wikidata, CC0. For article text use the Wikipedia API.",
        "source": "Wikidata action API (wikidata.org/w/api.php)",
        "endpoints": [
            "/v1/search",
            "/v1/entity",
            "/v1/claims",
            "/v1/labels",
            "/v1/property",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T08:14:05.992Z",
        "request_id": "8114ebf3-26b1-455d-972e-2675ddda170e"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/wikidata-api
OpenAPI spec: https://www.oanor.com/api/wikidata-api/openapi.json
