GnistAI GnistAI
Log in

Wikidata

Structured knowledge base — entities, properties, and relationships from Wikidata.

Overview   |   MCP   |   REST API   |   OpenAPI   |   CLI   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 5 tools tools 5 5 type: api wrapper type type api wrapper api wrapper lifecycle: maintained lifecycle lifecycle maintained maintained Reference

Data source: Wikidata (Wikimedia)

REST Bridge Endpoint https://context.gnist.ai/rest/wikidata/
Authentication

All requests require a Gnist-API-Key header (or api_key query parameter).

Free tier: 100 calls/day. Get your API key.

Tools (5)

search_wikidata_entity

Search Wikidata for entities by name or alias.

Resolves a natural-language label to one or more Wikidata QIDs. Use this
as the entry point before calling get_wikidata_entity or get_wikidata_linked_ids.

Args:
label: Name or phrase to search for (e.g. "Barack Obama", "Apple Inc").
language: BCP-47 language code for labels and descriptions. Default "en".
limit: Maximum results to return (1–20, default 5).

Returns:
Dictionary with 'count' and 'results' list. Each result has qid, label,
description, and aliases.

ParameterTypeRequiredDescription
labelstringrequiredName or phrase to search for (e.g. "Barack Obama", "Apple Inc").
languagestringoptionalBCP-47 language code for labels and descriptions. Default "en". (default: "en")
limitintegeroptionalMaximum results to return (1–20, default 5). (default: 5)
Request Body
{
  "label": "example"
}
get_wikidata_entity

Fetch a Wikidata entity with its statements, normalized to human-readable form.

Returns the entity's label, description, aliases, and all non-deprecated
statements as {property_label: [values]} pairs. Property labels are resolved
to English names (e.g. "P569" → "date of birth").

Args:
qid: Wikidata item ID (e.g. "Q76" for Barack Obama, "Q312" for Apple Inc).

Returns:
Entity metadata including statements dict. Statement values are normalized:
dates as YYYY-MM-DD, quantities as numbers, entities as "Label (QID)",
coordinates as "lat, lon".

ParameterTypeRequiredDescription
qidstringrequiredWikidata item ID (e.g. "Q76" for Barack Obama, "Q312" for Apple Inc).
Request Body
{
  "qid": "example"
}
get_wikidata_linked_ids

Return all external database identifiers for a Wikidata entity.

Fetches all external-id type statements: IMDb, VIAF, ISNI, MusicBrainz,
GeoNames, OpenCorporates, Freebase, PubMed, ORCID, and many others.
This is the bridge between Wikidata and every other database in the MCP toolbox.

Args:
qid: Wikidata item ID (e.g. "Q76" for Barack Obama).

Returns:
Dictionary with 'qid', 'label', 'wikidata_url', and 'identifiers' —
a flat map of {database_name: identifier_value}.

ParameterTypeRequiredDescription
qidstringrequiredWikidata item ID (e.g. "Q76" for Barack Obama).
Request Body
{
  "qid": "example"
}
wikidata_sparql

Execute a SPARQL query against the Wikidata Query Service.

Use for complex relational queries not covered by other tools — e.g.
"all EU heads of state born after 1970", "Nobel Prize winners in physics since 2000",
"companies headquartered in Oslo with stock exchange listings".

The Wikidata SPARQL endpoint uses Blazegraph. Queries must use Wikidata prefixes:
- wd: (entities), wdt: (direct claims), wikibase:, rdfs:label
Example: SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q146. SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

Args:
query: SPARQL SELECT query string. Must be valid SPARQL 1.1.
timeout_s: Query timeout in seconds (default 30, max 55).

Returns:
Dictionary with 'columns' list and 'rows' list. Each row is a
{variable: value} dict with string values.

ParameterTypeRequiredDescription
querystringrequiredSPARQL SELECT query string. Must be valid SPARQL 1.1.
timeout_sintegeroptionalQuery timeout in seconds (default 30, max 55). (default: 30)
Request Body
{
  "query": "example"
}
report_feedback

Report a bug, feature request, or general feedback for this data source.

Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.

Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")
Request Body
{
  "feedback": "example"
}

Quick Start

Shell
curl -X POST "https://context.gnist.ai/rest/wikidata/search_wikidata_entity" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"label": "example"}'
Python
import httpx

resp = httpx.post(
    "https://context.gnist.ai/rest/wikidata/search_wikidata_entity",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={
  "label": "example"
},
)
print(resp.json())

Related Toolkits (Reference)

Resources