Wikidata API

Structured access to the world’s largest Open Knowledge Graph

The Wikidata API gives you programmatic access to Wikidata, the Wikimedia project that stores the structured data behind Wikipedia, Wikivoyage, Wiktionary, Wikisource, and every other Wikimedia project. Wikidata contains over 120 million entities, each a machine-readable concept connected to others through typed statements, in a collaborative multilingual Linked Open Data knowledge graph that anyone can edit.

Wikidata endpoints are available in Beta as part of Wikimedia Enterprise On-demand and Realtime APIs. Use your existing access token to query structured entity data, multilingual labels, aliases, statements, and sitelinks to power semantic search, enhance machine learning models with relational context, feed knowledge graphs, and build data-driven applications on top of the Linked Open Web.

Why Wikidata is built for machines

The content on Wikipedia and most other Wikimedia projects is written for humans. Wikidata is different. It stores information as Items, Properties, and Values, structured as triplets in a graph database: Subject → Predicate → Object. That structure is machine-readable, highly interoperable, and language-agnostic by default.

Wikidata functions as the largest online knowledge graph by assigning every concept a universal Linked Open Data identifier. Every item has a unique Q-number (such as Q42 for Douglas Adams) and every property has a P-number (like P31 for ‘instance of’), forming machine-readable statements like Q42 P31 Q5 (human). A single global identifier represents a concept universally while supporting labels and descriptions in hundreds of languages. Because the data is structured as a graph rather than HTML or wikitext, algorithms can traverse it for rich context without parsing prose.

What you can build with Wikidata

Every item in Wikidata is verifiable, backed by cited references and a transparent public edit history. All Wikidata content is released under a CC0 waiver, so the full interconnected web of data is freely available for commercial applications, AI training, and RAG systems.

 Some examples Wikidata unlocks:

  • Normalize and deduplicate data: A QID refers to a single language-agnostic concept. Use Wikidata labels, descriptions, and aliases to match variant spellings or translations of names, places, events, and time periods against its unique identifier.
  • Answer questions no one has asked before: Traverse the graph to ground RAG systems and agents in provable facts. For example, “which animal species have the forest as their natural habitat and have at one point been awarded ‘Animal of the Year’?’
  • Surface the right information per concept type: Use common properties like ‘instance of‘ to classify an entity, then retrieve the statements that matter for that class: dates for events, birth and death for people, Latin names for species..
  • Connect disparate databases: Wikidata works as a pivot database via external identifiers. Map your existing datasets to Wikidata QIDs to link against VIAF, AAT, GND, ISNI, the Library of Congress, WorldCat, and hundreds of authority files.

Unify across Wikimedia projects: Wikidata is the structured data glue that connects Wikimedia projects. Most Wikipedia infoboxes are built on it, and every Wikidata item has sitelinks to the corresponding page on Wikipedia, Wikivoyage, Wikisource, Wiktionary, and more, across every available language.

How to access Wikidata

Access Wikidata’s structured firehose through the Wikimedia Enterprise Wikidata endpoints. All endpoints are currently in Beta and available on the On-demand and Realtime APIs.

The three On-demand endpoints are:

  • Wikidata Item Lookup. Retrieve all available data for a Wikidata item by Q-number, including labels, descriptions, aliases, statements, references, and sitelinks.
  • Wikidata Property Lookup. Retrieve the definition and metadata for a Wikidata property by P-number.
  • Wikidata Labels List. Translate machine-readable identifiers into human-readable labels in any available language.
visual showing how data from all different Wikimedia projects are embedded in Wikidata
  • Wikidata Item Lookup. Retrieve all available data for a Wikidata item by Q-number, including labels, descriptions, aliases, statements, references, and sitelinks.
  • Wikidata Property Lookup. Retrieve the definition and metadata for a Wikidata property by P-number.
  • Wikidata Labels List. Translate machine-readable identifiers into human-readable labels in any available language.
visual showing how data from all different Wikimedia projects are embedded in Wikidata

Example call to get structured data for Douglas Adams (Q42):

curl -L 'https://api.enterprise.wikimedia.com/v2/wikidata/items/Q42' -H 'Authorization: Bearer ACCESS_TOKEN'

Example call to look up the “instance of” property (P31):

curl -L 'https://api.enterprise.wikimedia.com/v2/wikidata/properties/P31' -H 'Authorization: Bearer ACCESS_TOKEN'

Getting a 403: Forbidden (You are not authorized to access this resource) error? Don’t forget to sign up for a free Wikimedia Enterprise account and use the Login endpoint to get an access token.

What’s inside the Wikidata API response?

  • Items: the main unit of information in Wikidata, representing concepts, topics, objects, people, and events. 
  • Labels: the human-readable name the item is most commonly known by. Items are language agnostic, so most have labels in many languages.
  • Descriptions: short neutral phrases that describe the item. Great to display under a Label, and also available per language. 
  • Aliases: other names an item is known by, including variant spellings and translations. A single item may have many aliases per language.
  • Statements: the graph’s connective tissue. Each statement links an item to a value through a property. For example: Marie Curie (item identifier Q7186) has the occupation (property identifier P106) of physicist (item identifier Q169470). Values are themselves wikidata items, so each statement links two Wikidata items through a property predicate.
  • References: pointers to verifiable sources that back up a statement. References work similarly to statements: they link a statement to a value using a property, such as ‘stated in’ or ‘ reference URL’. They ensure that knowledge stored in Wikidata is always linked to a source of truth. Statements can convey conflicting information, as long as each is properly sourced, which makes Wikidata the premier platform for tracking how knowledge evolves and how consensus is built.
  • Sitelinks: the connection points between Wikidata and every other Wikimedia project. Sitelinks link a Wikidata item to the corresponding article on Wikipedia, Wikisource, Wikivoyage, and others, across all available languages. They power the “see this article in other languages” links on Wikipedia and make it easy to navigate between language versions for that item. 
  • External Identifiers: unique identifiers linking a Wikidata item to records in external databases, authority files, archives, and encyclopedias. This turns Wikidata into a central hub of the Linked Open Web. If your datasets contain unique identifiers from other sources, you can enrich them by looking those identifiers up in Wikidata and joining the knowledge stored there.
a detailed look at the Douglas Adams Wikidata item

Wikidata API example payload

The first fields of a Wikidata Article Lookup response for Q42 (Douglas Adams) return identifying info and metadata about the current and previous version of the item:

{
    "name": "Q42",
    "identifier": 138,
    "date_created": "2025-12-09T20:13:59Z",
    "date_modified": "2025-12-09T20:13:59Z",
    "version": {
        "identifier": 2440217749,
        "comment": "/* wbsetdescription-set:1|nl */ Engelse schrijver (1952–2001)"
    },
    "previous_version": {
        "identifier": 2440217365
    },
    "url": "https://www.wikidata.org/wiki/Q42",
    "namespace": {
        "identifier": 0
    },
    "is_part_of": {
        "identifier": "wikidatawiki"
    },
 "visibility": {
        "text": true,
        "editor": true,
        "comment": true
    },
    "event": {
        "identifier": "a5a43df6-3977-4f8e-8a1e-f9e0d2b7b5b7",
        "type": "update",
        "date_created": "2025-12-09T20:14:00.193403Z",
        "date_published": "2025-12-09T20:14:00.193403Z"
    }

The entity object contains labels, descriptions, and aliases for the item, for describing the item and finding variant spellings and translations:

"entity": {
        "identifier": "Q42",
        "type": "item",
        "labels": {
            "ar": "دوغلاس آدمز",
            "mul": "Douglas Adams",
        },
        "descriptions": {
            "de": "britischer Science-Fiction-Autor und Humorist",
            "en-us": "English science fiction writer and humorist (1952–2001)",
        },
        "aliases": {
            "eo": [
                "Douglas ADAMS",
                "Douglas Noël ADAMS"
            ],
            "he": [
                "דגלס אדמס",
                "דאגלס נואל אדמס"
            ],
        },

The statements object contains every subject – predicate – object link for the item. Statements objects are often long, with tens or hundreds of entries This example shows a single statement: the property P101 “Field of Work” connects Q42 to the value Q3238422 (“science fiction literature”). Statements can also carry qualifiers that refine the value and references that back up the claim.

"statements": {
            "P101": [
                {
                    "identifier": "Q42$0C5C0A36-7389-4E16-969B-851D25C94AC2",
                    "rank": "normal",
                    "property": {
                        "identifier": "P101",
                        "data_type": "wikibase-item",
                        "labels": {
                            "en": "field of work"
                        }
                    },
                    "value": {
                        "type": "value",
                        "content_data": {
                            "entity-type": "item",
                            "id": "Q3238422",
                            "numeric-id": "3.238422e+06"
                        },
                        "labels": {}
                    },
                    "qualifiers": null,
                    "references": [
                        {
                        }
                    ]
                }
            ],
        },

The sitelinks object is one of the most powerful sections of the Wikidata payload. It connects the Wikidata item to its corresponding article or page on every other Wikimedia project, in every available language. 

"sitelinks": {
  "enwiki": {
    "title": "Douglas Adams",
    "badges": null,
    "url": "https://en.wikipedia.org/wiki/Douglas_Adams"
  },
  "enwikiquote": {
    "title": "Douglas Adams",
    "badges": null,
    "url": "https://en.wikiquote.org/wiki/Douglas_Adams"
  },
}

Frequently Asked Questions

What’s the difference between Wikipedia and Wikidata?

Wikipedia contains articles written for humans, collecting knowledge as textual encyclopedia entries. Wikidata contains the structured facts and relationships behind that same knowledge, stored as triples in a graph database that machines and humans can both read.When pulling a Wikipedia article through the Wikimedia Enterprise APIs, you can boost your knowledge graph or RAG pipeline by joining it to the Wikidata Q-number in the additional_entities array. That QID links to every other language version of the article, and to the same concept on Wiktionary, Wikivoyage, and other Wikimedia projects.

Example: get the Wikidata QID from a Wikipedia article response.

curl -L 'https://api.enterprise.wikimedia.com/v2/articles/NASA' -H 'Authorization: Bearer ACCESS_TOKEN'

From the response, pull the QID from additional_entities:

"additional_entities": [
  {
    "identifier": "Q309751",
    "url": "https://www.wikidata.org/entity/Q309751",
    "aspects": ["C.P18", "S", "T"]
  }
]

Then query Wikidata directly:

curl -L 'https://api.enterprise.wikimedia.com/v2/wikidata/items/Q309751' -H 'Authorization: Bearer ACCESS_TOKEN'

Is the Wikidata API free?

Yes. A free Wikimedia Enterprise account includes access to the Beta Wikidata endpoints on the On-demand API, with monthly request limits. For higher volume, real-time streaming, or production SLAs, paid accounts are available. Sign up for a free account or contact sales.

What Wikidata endpoints are available?

The On-demand API currently exposes three Wikidata endpoints in Beta: Wikidata Item Lookup, Wikidata Property Lookup, and Wikidata Labels List. A Wikidata stream is also available on the Realtime API for live updates. Full details are in the On-demand documentation.

Is Wikidata content openly licensed?

Yes. Wikidata is released under a CC0 public domain waiver, which makes it the most permissively licensed data in the Wikimedia ecosystem. You can use Wikidata content for any purpose, including commercial applications and model training, without attribution requirements (though attribution is always appreciated).

Get Started

Access Wikidata, Wikipedia, and other Wikimedia project data through one unified API delivering consistent JSON output. Scale your knowledge-based applications with high-availability infrastructure; get started with free instant access today.