Logo: Wikimedia Petscan

Wikimedia Petscan

Communautéit
fuzheado
wikimedia-petscan

Use PetScan for multi-source Wikimedia queries — category intersections, template filtering, SPARQL integration, Wikidata item queries, and bulk data export via the URL API and PSID system

Iwwersiicht

Editeurfuzheado
RepositoryWikipedia-AI-Skills
Skill-Nummwikimedia-petscan
Stären
27
Forks
10
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    fuzheado huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Wikimedia Petscan an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikimedia-petscan
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fuzheado/Wikipedia-AI-Skills.git /tmp/Wikipedia-AI-Skills
mkdir -p .claude/skills
cp -r /tmp/Wikipedia-AI-Skills/.claude/skills/wikimedia-petscan .claude/skills/wikimedia-petscan
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Wikimedia Petscan an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Wikimedia Petscan automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Wikimedia Petscan net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

ℹ️ User-Agent required: All API examples in this skill access PetScan (petscan.wmcloud.org). Include a descriptive User-Agent header as described in the wikimedia-api-access skill.

💡 Related skills for complementary query approaches:


SOP: What PetScan Is

PetScan is a powerful multi-source querying tool for Wikimedia, created by Magnus Manske as the successor to CatScan2. Winner of the Coolest Tool Award 2022.

It generates lists of pages or Wikidata items matching criteria across up to 6 source tabs simultaneously:

TabWhat it queriesExample
CategoriesCategory tree membership, intersection/union/differencePages in Category:Physics AND Category:Biography
Page propertiesNamespace, redirects, size, dates, edit types, ORES qualityFiles only, created after 2024, not redirects
Templates & linksTemplate presence, outlinks, incoming linksPages with {{Infobox scientist}} but NOT {{Unreferenced}}
Other sourcesSPARQL, manual list, PagePile, search queryAll QIDs from a SPARQL query, minus a manual exclusion list
WikidataWikidata item filters — statements, properties, sitelinks, labelsItems with an occupation but no image
OutputFormat, sorting, regex filter, file media typesJSON sorted by page size, with regex filter on title

The key insight: PetScan combines these sources into one result using configurable logic (subset/union/difference/at-least-N). You can mix categories with SPARQL, templates with manual lists, etc. — including cross-wiki via Wikidata.

Three Ways to Use PetScan

MethodWhenHow
Web UIOne-off queries, explorationhttps://petscan.wmcloud.org/ — fill forms, tabs, click "Do it!"
URL APIAutomation, scriptsAppend URL parameters to the base URL, get JSON/CSV/XML/...
PSIDShare, rerun, tool integrationEvery query gets a stable ID; ?psid=12345 re-runs it

SOP: PSID — Stable Query IDs

Since 2016, every submitted PetScan query is assigned a unique, stable numeric PSID (displayed in the result page). This enables:

  • Short URLs: https://petscan.wmcloud.org/?psid=552
  • Re-running queries without re-entering all parameters
  • Tool integration: Many tools (WD-FIST, PagePile, Massviews) accept PSID as input
  • Caching: PSID results are cached server-side for faster repeat access

PSIDs are anonymous — no user identity is stored with them.


SOP: URL Parameter Reference

PetScan accepts 50+ URL parameters across all six tabs. Here are the most commonly used ones in automation:

Categories Tab

ParameterDescription
languageWiki language code (en, de, commons, etc.)
projectWikimedia project (wikipedia, wiktionary, commons, wikidata)
categoriesPipe-separated category names (no Category: prefix). Append `
depthDefault category tree depth (0 = no recursion)
combinationsubset (AND — all categories), union (OR — any category)
negcatsPipe-separated categories to exclude

Page Properties Tab

ParameterDescription
ns[0], ns[6], etc.Namespace filter (set to 1 to include)
show_redirectsno (default), only, yes (include redirects)
show_soft_redirectsSame options for soft redirects
show_disambiguation_pagesSame options for disambiguation pages
after, beforeDate filter (YYYYMMDDHHMMSS format)
since_rev0Find pages created within a time window
larger, smallerPage size range in bytes
minlinks, maxlinksInternal link count range
edits[bots], edits[anons]Filter by last editor type (1 to require, 0 to exclude)
ores_predictionORES quality class (FA, GA, B, C, Start, Stub)
ores_prob_from, ores_prob_toORES probability range

Templates & Links Tab

ParameterDescription
templates_yesPipe-separated templates — page must have ALL of them
templates_anyPipe-separated templates — page must have at least ONE
templates_noPipe-separated templates — page must have NONE
outlinks_yes, outlinks_any, outlinks_noSame pattern for outgoing links
links_to_all, links_to_any, links_to_noSame pattern for incoming links

Other Sources Tab

ParameterDescription
sparqlRaw SPARQL query (URL-encoded) as a data source
manual_listNewline-separated page titles or QIDs
manual_list_wikiWiki for the manual list (e.g., enwiki, wikidatawiki)
pagepilePagePile ID
search_queryFree-text search query
search_max_resultsMax results from search source
source_combinationHow to combine sources: subset, union, or custom (e.g., manual NOT sparql)

Wikidata Tab

ParameterDescription
wikidata_itemwith, without, or any — whether items have a Wikidata ID
wikidata_source_sitesWiki to use as source for site links
wikidata_label_languageLanguage for labels in results
wpiuWikidata property item use filter
sitelinks_yes, sitelinks_any, sitelinks_noFilter by sitelink presence on specific wikis
labels_yes, labels_any, labels_noFilter by label presence in specific languages
min_sitelink_count, max_sitelink_countSitelink count range

Output Tab

ParameterDescription
formathtml, csv, tsv, wiki, json, jsonl, pagepile, kml, plain
sortbynone, title, size, date, incoming_links, random, etc.
sortorderascending or descending
output_limitMaximum number of results
rxp_filterRegular expression to filter titles/labels
file_media_typesPipe-separated media types (BITMAP, VIDEO, AUDIO, 3D, etc.)
page_imageInclude page image URL in output
json-prettyPretty-printed JSON (1)

SOP: Common API Patterns

All examples use curl. Replace language/project as needed.

Category Intersection (AND)

Pages in ALL categories — equivalent to category-intersect.py in the wikipedia-categories skill:

bash
curl -s 'https://petscan.wmcloud.org/\
  ?language=en\
  &project=wikipedia\
  &categories=Physicists%7CGerman%20scientists\
  &ns%5B0%5D=1\
  &combination=subset\
  &format=json' \
  -H 'User-Agent: MyTool/1.0 (contact@example.com)'

Category + Template Filter

Pages in Category:Physics that have {{WikiProject Physics}}:

bash
curl -s 'https://petscan.wmcloud.org/\
  ?language=en\
  &project=wikipedia\
  &categories=Physics\
  &templates_yes=WikiProject%20Physics\
  &ns%5B0%5D=1\
  &format=json' \
  -H 'User-Agent: ...'

Category + ORES Quality Filter

FA-class articles in a category:

bash
curl -s 'https://petscan.wmcloud.org/\
  ?language=en\
  &project=wikipedia\
  &categories=Physics\
  &ores_prediction=FA\
  &ns%5B0%5D=1\
  &format=json' \
  -H 'User-Agent: ...'

SPARQL as a Data Source

Get all items from a SPARQL query that are also in a category:

bash
SPARQL_ENC=$(python3 -c "import urllib.parse; print(urllib.parse.quote(\"\"\"\
SELECT ?item WHERE { ?item wdt:P31 wd:Q5 ; wdt:P106 wd:Q2519376 }
\"\"\"))")
curl -s "https://petscan.wmcloud.org/\
  ?language=en\
  &project=wikipedia\
  &categories=American%20jewellers\
  &sparql=$SPARQL_ENC\
  &combination=subset\
  &format=json" \
  -H 'User-Agent: ...'

Manual List + SPARQL Exclusion

QIDs from a manual list, minus those that already have a certain occupation:

bash
MANUAL="Q123\nQ456\nQ789"
MANUAL_ENC=$(python3 -c "import urllib.parse; print(urllib.parse.quote('''$MANUAL'''))")
SPARQL_EXCLUDE=$(python3 -c "import urllib.parse; print(urllib.parse.quote(\"\"\"\
SELECT ?item WHERE { ?item wdt:P31 wd:Q5 ; wdt:P106 wd:Q2519376 }\
\"\"\"))")
curl -s "https://petscan.wmcloud.org/\
  ?manual_list=$MANUAL_ENC\
  &manual_list_wiki=wikidatawiki\
  &sparql=$SPARQL_EXCLUDE\
  &source_combination=manual%20NOT%20sparql\
  &format=json" \
  -H 'User-Agent: ...'

Items Without Wikidata Statements (Data Quality)

Find English Wikipedia articles in a category that have a Wikidata item but no statements:

bash
curl -s 'https://petscan.wmcloud.org/\
  ?language=en\
  &project=wikipedia\
  &categories=United%20States%20geography%20stubs\
  &ns%5B0%5D=1\
  &wikidata_item=with\
  &wpiu_no_statements=1\
  &format=json' \
  -H 'User-Agent: ...'

Commons: Find Uncategorized Files with a Language Template

bash
curl -s 'https://petscan.wmcloud.org/\
  ?language=commons\
  &project=wikimedia\
  &categories=Uncategorized%20files\
  &depth=1\
  &ns%5B6%5D=1\
  &templates_yes=ro\
  &format=json' \
  -H 'User-Agent: ...'

PSID-Based Query

Re-run a previously saved query:

bash
curl -s 'https://petscan.wmcloud.org/?psid=552&format=json' \
  -H 'User-Agent: ...'

Output as Wiki Table

Any format parameter changes the output:

bash
curl -s 'https://petscan.wmcloud.org/\
  ?language=en&project=wikipedia&categories=Physics\
  &ns%5B0%5D=1&format=wiki' \
  -H 'User-Agent: ...'

SOP: Multi-Source Combination Logic

When using multiple sources (categories + SPARQL + manual list + pagepile + search), the combination parameter controls how they are merged. With source_combination, you get more control:

ValueEffect
subset (default)Return only results present in ALL sources (AND)
unionReturn results from ANY source (OR)
source1 NOT source2Results from first source minus second
source1 AND source2Explicit AND between named sources

Sources are ordered as: categories → manual_list → pagepile → sparql → search. Use source_combination to reorder or mix.

Cross-wiki magic: Use common_wiki=wikidata to merge results across different wikis. PetScan will resolve pages from different wikis through Wikidata to find common items.


SOP: Integration with Other Tools

ToolHow PetScan Feeds Into It
PagePileOutput format pagepile creates a new PagePile; or feed PSID into PagePile's "from external tool" field
Massviews AnalysisUse PagePile ID from PetScan as source → get pageviews for the query result set
WD-FISTPSID → find free images for a list of articles
QuickStatementsExport as JSON/CSV, transform to QuickStatements format

Relationship to Other Skills

  • wikipedia-categories — Covers category tree concepts and ships category-intersect.py (uses PetScan's URL API for basic AND intersection). This skill covers the full parameter surface PetScan offers.
  • wikimedia-search-cirrussearch — CirrusSearch is faster for simple keyword+category. PetScan is the right choice when you need category intersection/union/difference, multi-source combination (categories + templates + SPARQL), ORES filtering, or bulk export. See the comparison table in that skill.
  • wikidata — For complex SPARQL queries that exceed PetScan's single-query input, use the Wikidata Query Service directly.
  • wikimedia-commons-sparql — For Commons-specific MediaInfo queries; PetScan complements with file media type filtering and uncategorized file detection.

Heefeg gestallte Froen

Wat mécht de KI-Skill Wikimedia Petscan?

Use PetScan for multi-source Wikimedia queries — category intersections, template filtering, SPARQL integration, Wikidata item queries, and bulk data export via the URL API and PSID system

Firwat Wikimedia Petscan op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Wikimedia Petscan besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Wikimedia Petscan an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikimedia-petscan an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Wikimedia Petscan benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Wikimedia Petscan benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Wikimedia Petscan domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Wikimedia Petscan gratis?

Jo. fuzheado huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇