wikidata-search

Search for items and properties on Wikidata and retrieve entity details, claims, and external identifiers. Supports both keyword search (Wikidata Action API) and semantic/hybrid search (Wikidata Vector Database), plus direct entity retrieval (Special:EntityData) and structured querying (WDQS SPARQL).

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "wikidata-search" with this command: npx skills add kltng/humanities-skills/kltng-humanities-skills-wikidata-search

Wikidata Search Skill

Search and retrieve data from Wikidata, the free knowledge base.

Critical: Things Claude Won't Know Without This Skill

Wikidata Vector Database (semantic search)

This is the highest-value feature of this skill. The Wikidata Vector Database at wd-vectordb.wmcloud.org provides semantic/hybrid search over all Wikidata items — something you can't do with the standard Action API or SPARQL.

A descriptive User-Agent header is required or you get 403.

curl -H 'User-Agent: WikidataSearchSkill/1.0 (contact: you@example.com)' \
  'https://wd-vectordb.wmcloud.org/item/query/?query=historical+Chinese+cartography&lang=all&K=20'

Response includes QID, similarity_score, rrf_score, and source (vector vs keyword).

Property search: replace /item/query/ with /property/query/.

Optional params: lang, K (result count), instanceof (comma-separated QIDs), rerank.

WDQS SPARQL also requires User-Agent

curl -G 'https://query.wikidata.org/sparql' \
  --data-urlencode 'query=SELECT ?item ?label WHERE { ?item wdt:P31 wd:Q12857432 . ?item rdfs:label ?label . FILTER(LANG(?label)="en") }' \
  -H 'Accept: application/sparql-results+json' \
  -H 'User-Agent: WikidataSearchSkill/1.0 (contact: you@example.com)'

External identifiers live in claims

# claims[property_id][0]["mainsnak"]["datavalue"]["value"] → identifier string
# Common: P214 (VIAF), P244 (LoC), P227 (GND), P213 (ISNI), P268 (BnF)

Choosing an Access Method

NeedMethod
Keyword search by label/aliasAction API wbsearchentities
Semantic / fuzzy concept discoveryVector Database (hybrid vector + keyword)
Fetch a known entity's JSONSpecial:EntityData/{ID}.json
Complex graph queries / reportingWDQS SPARQL

Python Script

Use scripts/wikidata_api.py for programmatic access (zero dependencies):

from scripts.wikidata_api import WikidataAPI
wd = WikidataAPI()

# Keyword search
results = wd.search("Zhu Xi", language="en", limit=5)

# Semantic search (Vector DB) — the key differentiator
candidates = wd.vector_search_items("historical Chinese cartography", lang="all", k=20)

# Entity retrieval
entity = wd.get_entity("Q9397", props=["labels", "descriptions", "claims"])

# External identifiers
ids = wd.get_identifiers("Q9397", include_labels=True)
# → {'VIAF ID (P214)': '46768804', 'Library of Congress ID (P244)': 'n81008179', ...}

# SPARQL
results = wd.sparql_json("SELECT ?item ?label WHERE { ?item wdt:P31 wd:Q12857432 . ?item rdfs:label ?label . FILTER(LANG(?label)='en') }")

# Direct entity JSON (fast for current state)
data = wd.get_entitydata("Q42", flavor="simple")

API Endpoints Quick Reference

EndpointURL
Action APIhttps://www.wikidata.org/w/api.php
Entity JSONhttps://www.wikidata.org/wiki/Special:EntityData/{ID}.json
SPARQLhttps://query.wikidata.org/sparql
Vector DBhttps://wd-vectordb.wmcloud.org

API Etiquette

  • Rate limit: 0.5–1s between requests
  • User-Agent: Required for Vector DB and WDQS (include contact info)
  • Respect 429: Honor Retry-After headers
  • Action API: Use maxlag parameter; batch with pipe-separated IDs (max 50)
  • SPARQL: Request only needed fields; use LIMIT

Related Skills

  • cbdb-api: Cross-reference Wikidata entities with CBDB biographical data for Chinese historical figures
  • chgis-tgaz: Look up historical places found via Wikidata in the CHGIS Temporal Gazetteer for detailed administrative history

Resources

  • references/api_reference.md — Complete API specs for all four access methods
  • scripts/wikidata_api.py — Full-featured Python client with rate limiting, retries, and identifier extraction

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Turing Pyramid

Prioritized action selection for AI agents. 10 needs with time-decay and tension scoring replace idle heartbeat loops with concrete next actions.

Registry SourceRecently Updated
Automation

Agent Memory Local

Local-first memory retrieval for Agent/OpenClaw workspaces. Use when the user asks about prior work, decisions, dates, preferences, root causes, todo history...

Registry SourceRecently Updated
Automation

Wip Ldm Os Private

LDM OS ... shared infrastructure for AI agents. Identity, memory, ownership, collaboration, compatibility, payments. One system across all your AIs.

Registry SourceRecently Updated
Automation

Workflow Builder

工作流设计与优化工具。流程设计、自动化方案、流程优化、文档化、审批流、系统集成。Workflow builder with design, automate, optimize, document, approval, and integration capabilities. Use when you need...

Registry SourceRecently Updated