Logo di Wikimedia Petscan

Wikimedia Petscan

Community
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

Panoramica

Pubblicato dafuzheado
RepositoryWikipedia-AI-Skills
Nome della skillwikimedia-petscan
Stelle
27
Fork
10
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da fuzheado su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Wikimedia Petscan in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikimedia-petscan
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Wikimedia Petscan in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Wikimedia Petscan non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Wikimedia Petscan non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

ℹ️ 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.

Domande frequenti

Cosa fa la skill IA 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

Perché usare Wikimedia Petscan su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Wikimedia Petscan è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Wikimedia Petscan in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikimedia-petscan. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Wikimedia Petscan?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Wikimedia Petscan?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Wikimedia Petscan: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Wikimedia Petscan è gratuita?

Sì. È pubblicata su GitHub da fuzheado con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇