Wikidata
App · Misc References · 4 actions
Look up structured facts from Wikidata, the free knowledge base behind Wikipedia: search for entities by name, read an entity's statements as readable property/value pairs, resolve a Wikipedia article to its entity, and run SPARQL queries. No account or API key required.
Actions
| Action | What it does |
|---|---|
| Find Wikidata entity by Wikipedia title | Resolve a Wikipedia article title to the Wikidata entity behind it. |
| Get Wikidata entity | Get everything Wikidata records about one entity: its name, description, aliases, Wikipedia link, and its statements as readable property/value pairs (e.g. 'date of birth' → 1815-12-10). |
| Run Wikidata SPARQL query | Run a SPARQL query against the Wikidata Query Service. |
| Search Wikidata | Search Wikidata for people, places, organisations, works, and concepts by name. |
Find Wikidata entity by Wikipedia title
Resolve a Wikipedia article title to the Wikidata entity behind it. Use this when you already have an article name and want its structured data. Returns a null entity id when no article matches, rather than failing.
Inputs
- Title
titletextRequired - Wikipedia article title, e.g. Ada Lovelace. Capitalisation and underscores are normalised for you.
- Wikipedia site
wikipedia_sitetext - Which Wikipedia the title belongs to, e.g. enwiki, frwiki, dewiki. Defaults to enwiki.
- Language
languagetext - Language code for labels and descriptions, e.g. en, fr, de, ja. Defaults to en.
Outputs
concept_uritext- Stable RDF identifier. Null when nothing matched.
descriptiontext- One-line description. Null when nothing matched.
entity_idtext- Wikidata entity id for the article, e.g. Q7259. Null when no article matches the title.
labeltext- Entity name. Null when nothing matched.
urltext- wikidata.org page for the entity. Null when nothing matched.
Example output
{
"concept_uri": "http://www.wikidata.org/entity/Q7259",
"description": "English mathematician (1815-1852)",
"entity_id": "Q7259",
"label": "Ada Lovelace",
"url": "https://www.wikidata.org/wiki/Q7259"
}Get Wikidata entity
Get everything Wikidata records about one entity: its name, description, aliases, Wikipedia link, and its statements as readable property/value pairs (e.g. 'date of birth' → 1815-12-10). Optionally narrow it to just the properties you need.
Inputs
- Entity ID
entity_idtextRequired - Wikidata entity id, e.g. Q7259. You can get this from the Search Wikidata action.
- Language
languagetext - Language code for labels and descriptions, e.g. en, fr, de, ja. Defaults to en.
- Properties
propertiestext - Optional comma-separated property ids to return, e.g. P569,P570,P106. Leave blank to return every statement, which for a well-covered entity can be a few hundred.
- Wikipedia site
wikipedia_sitetext - Which Wikipedia to link to, e.g. enwiki, frwiki, dewiki. Defaults to enwiki.
Outputs
entityobject
Example output
{
"entity": {
"aliases": [
"Lady Ada",
"Augusta Ada King, Countess of Lovelace"
],
"concept_uri": "http://www.wikidata.org/entity/Q7259",
"description": "English mathematician (1815-1852)",
"id": "Q7259",
"label": "Ada Lovelace",
"statement_count": 2,
"statements": [
{
"property_id": "P106",
"property_label": "occupation",
"values": [
{
"entity_id": "Q170790",
"unit_id": null,
"value": "mathematician"
},
{
"entity_id": "Q5482740",
"unit_id": null,
"value": "programmer"
}
]
},
{
"property_id": "P569",
"property_label": "date of birth",
"values": [
{
"entity_id": null,
"unit_id": null,
"value": "1815-12-10T00:00:00Z"
}
]
}
],
"url": "https://www.wikidata.org/wiki/Q7259",
"wikipedia_url": "https://en.wikipedia.org/wiki/Ada_Lovelace"
}
}Run Wikidata SPARQL query
Run a SPARQL query against the Wikidata Query Service. Use this for questions no single lookup answers, such as listing every item matching a set of conditions. Returns one row per result with the query's own variable names as keys.
Inputs
- Query
querytextRequired - SPARQL query text. Add a LIMIT clause: the service caps a query at 60 seconds and will reject one that scans too much. Include the wikibase:label service to get readable names alongside ids.
Outputs
countnumber- Number of rows returned.
rowslist- One entry per result row, keyed by the query's own variable names with the plain values. A variable left unbound for a row, as an OPTIONAL clause can leave it, is absent from that row.
variableslist- The variable names the query selected, in order. These are the keys on each row.
Example output
{
"count": 1,
"rows": [
{
"item": "http://www.wikidata.org/entity/Q12418",
"itemLabel": "Mona Lisa"
}
],
"variables": [
"item",
"itemLabel"
]
}Search Wikidata
Search Wikidata for people, places, organisations, works, and concepts by name. Returns the matching entity ids, which the other Wikidata actions take as input.
Inputs
- Query
querytextRequired - Text to search for, e.g. Ada Lovelace.
- Language
languagetext - Language code for labels and descriptions, e.g. en, fr, de, ja. Defaults to en.
- Limit
limitnumber - How many results to return, 1 to 50. Defaults to 10.
- Entity type
entity_typetext - What kind of entity to search for. Defaults to item, which covers people, places, and things. Use property to find the P-ids used in statements.One of:
item(Item (Q-id)),property(Property (P-id)),lexeme,form,sense.
Outputs
countnumber- Number of results returned.
resultslist- Matching entities, best match first.
Example output
{
"count": 1,
"results": [
{
"concept_uri": "http://www.wikidata.org/entity/Q7259",
"description": "English mathematician (1815-1852)",
"id": "Q7259",
"label": "Ada Lovelace",
"match_text": "Ada Lovelace",
"url": "https://www.wikidata.org/wiki/Q7259"
}
]
}