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

clinic-visit-prep

帮助患者整理就诊前问题、既往记录、检查清单与时间线,不提供诊断。;use for healthcare, intake, prep workflows;do not use for 给诊断结论, 替代医生意见.

Archived SourceRecently Updated
Automation

changelog-curator

从变更记录、提交摘要或发布说明中整理对外 changelog,并区分用户价值与内部改动。;use for changelog, release-notes, docs workflows;do not use for 捏造未发布功能, 替代正式合规审批.

Archived SourceRecently Updated
Automation

klaviyo

Klaviyo API integration with managed OAuth. Access profiles, lists, segments, campaigns, flows, events, metrics, templates, catalogs, and webhooks. Use this skill when users want to manage email marketing, customer data, or integrate with Klaviyo workflows. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).

Archived SourceRecently Updated
Automation

lifelog

生活记录自动化系统。自动识别消息中的日期(今天/昨天/前天/具体日期),使用 SubAgent 智能判断,记录到 Notion 对应日期,支持补录标记。 适用于:(1) 用户分享日常生活点滴时自动记录;(2) 定时自动汇总分析并填充情绪、事件、位置、人员字段

Archived SourceRecently Updated