---
name: pull-wikimedia-commons
description: Search and download original public-domain files from Wikimedia Commons via the MediaWiki API. Use to upgrade an existing artwork to a larger scan of the same work, or to pull NASA/museum files that Commons hosts at higher resolution than the museum site.
---

# Pull Wikimedia Commons

Use the API. Do not scrape HTML thumbnails. Run the script.

```
node scripts/pull-commons.mjs --search "The Abduction of Europa Rembrandt Getty"
node scripts/pull-commons.mjs --file "File:Rembrandt - The Toilet of Bathseba.JPG" --download
```

Downloads land in `tmp-scans/`. Then `catalog-work`. Traps: `known-source-failures`.

API: `https://commons.wikimedia.org/w/api.php`

User-Agent is required: `MorganGoinsArchive/1.0 (+https://morgangoins.org/.well-known/image-sources.json)`

## Search files

```
action=query
list=search
srnamespace=6
srlimit=10
format=json
srsearch=TITLE + ARTIST + MUSEUM
```

Namespace 6 is `File:`. Search with the exact painting title plus artist and repository so you do not pick up a different work with a similar name.

## Read original size

```
action=query
titles=File:Example.jpg
prop=imageinfo
iiprop=url|size|mime
format=json
```

`imageinfo[0].url` is the original. `width` / `height` / `size` are the original pixels and bytes. Ignore `/thumb/` URLs.

## Download

1. GET the original URL with the same User-Agent.
2. Verify JPEG (or the expected mime) and record native pixels.
3. Keep the Commons file title, original URL, and the museum object record as provenance.

## Same-work upgrade rule

Replace an existing archive file only when **all** of these are true:

- Same artwork, not a related print, copy, study, or another artist's canvas
- Same museum / accession when the work is institution-specific (Met object ID, NGA accession, etc.)
- Original pixel count is higher on at least one axis and not a zoomed crop of a detail
- License is public domain or otherwise reusable

Google Art Project filenames on Commons are often the largest museum scans (Bierstadt *Lake Lucerne*, *Sunrise, Yosemite Valley*). Commons also beat NASA `~orig` for Earthrise (`AS08-14-2383`, `5584²` vs NASA's smaller orig).

A larger file of a **different** Rembrandt (for example the Kenwood/Rijksmuseum Google Art self-portrait at `12243×15859`) must not replace the Met 1660 Altman self-portrait.

## Thumbnails are capped

`Special:Redirect/file/...&width=16000` often returns ~3840 px. Download the original `imageinfo` URL, then downsample with `vips thumbnail` if the file is too large for the viewer. Do not treat the 3840 thumb as the original.

This VPS has 2 GB of RAM. Never decode a 20k+ original in memory (`vips copy`, `vips rotate`, Sharp, ImageMagick). A 42k Europa scan used 1.5 GB RSS on 2026-08-17, the kernel OOM-stalled, and Cloudflare returned Error 1033. Always `vips thumbnail` (or `vipsthumbnail`) to the viewer size. The `vips` wrapper on this box caps virtual memory; do not set `VIPS_NO_MEMCAP=1`.

NGA IIIF `info.json` can report 20k+ pixels while `/full/max/` still serves 4096. Prefer the Commons original when it is larger. *The Last of the Buffalo* (NGA 2014.79.5) is `10602×6252` on Commons (`File:The Last of the Buffalo.jpg`, IIPImage export); NGA `/full/max/` is 4096. Smithsonian IIIF caps *Among the Sierra Nevada* at 3000; Commons has the Hasselblad master at `10500×6298`. Cleveland open-access TIFFs of the same objects are on Commons (*Fir Trees and Storm Clouds* `5049×3698`, *Mount Vesuvius at Midnight* `4780×3366`).

## Known useful Commons originals in this archive

- `File:Rembrandt - The Abduction of Europa - Google Art Project.jpg` — Getty 95.PB.7, `42582×33430` (1314 PPI). A second file, `File:Rembrandt_Harmensz._van_Rijn_-_The_Abduction_of_Europa_-_Google_Art_Project.jpg`, is only `30000×23413`. Getty IIIF is `9710×7540`. Keep the 42k file as the print master (`art/masters/` on R2, or `tmp-scans/` on disk). Serve the 16000 px view as `image` / `view`. Popup first paint uses the 2560 px preview; zoom fetches `https://media.morgangoins.org/art/tiles/{name}/{z}/{row}/{col}.jpg`. Catalog with `catalog-work` (R2 is the default). Do not `vips thumbnail` the 42k original on this 2 GB box.
- `File:Rembrandt van Rijn - Zelfportret (1629) - Alte Pinakothek.jpg` — Munich inv. 11427, `6105×7369` on a 5 × 6⅛ in. oak panel (1203 PPI)
- `File:Rembrandt laughing.jpg` — Getty 2013.60, `6274×8171` on 6¾ × 8¾ in. copper (929 PPI)
- `File:Rembrandt van Rijn - Self-Portrait - Google Art Project.jpg` — Kenwood *Self-Portrait with Two Circles*, `12243×15859`
- `File:Rembrandt van Rijn - The Mill - Google Art Project.jpg` — NGA, `12229×10167`
- `File:Rembrandt - The Toilet of Bathseba.JPG` — Met 437393, `5957×4467`
- `File:The Night Watch - HD.jpg` — Rijksmuseum SK-C-5, `57813×48438` (~324 PPI on 379.5 × 453.5 cm). Reduced export of the 2019 20 μm scan. Larger than the GAP Night Watch (`28128×23334`). Long edge 57k: download the original for `--pixels-from`, serve a ≤16000 view. Do not decode on this 2 GB VPS. Ingest when RAM is upgraded.
- `File:Rembrandt Harmensz van Rijn - Return of the Prodigal Son - Google Art Project.jpg` — Hermitage, `22991×30000` (~285 PPI on 262 × 205 cm). Same 30k / 16k pattern as Europa. Ingest when RAM is upgraded.
- `File:Andromeda, Rembrandt van Rijn, 1630-1631, Mauritshuis, The Hague.jpg` — Mauritshuis 707, `4318×6000` on 34 × 24.5 cm (~448 PPI)
- `File:Rembrandt The Artist in his studio.jpg` — MFA Boston 38.1838, `3746×2942` on 24.8 × 31.7 cm (~300 PPI). Not `File:Boston MFA Rembrandt.jpg`.
- `File:Rembrandt Harmensz. van Rijn - Jeremia treurend over de verwoesting van Jeruzalem - Google Art Project.jpg` — Rijksmuseum SK-A-3276, `3857×4902` on 58.3 × 46.6 cm (~210 PPI)
- `File:AS08-14-2383.jpg` — Apollo 8 Earthrise, `5584×5584`
- `File:Albert_Bierstadt_-_Sunrise,_Yosemite_Valley_(c._1870).jpg` — Amon Carter, `12732×8815`
- `File:Albert Bierstadt - Fir Trees and Storm Clouds - 1982.37 - Cleveland Museum of Art.tif` — Cleveland 1982.37, `5049×3698`
- `File:Albert Bierstadt - Indians Spear Fishing - Google Art Project.jpg` — MFA Houston 2008.226, `6345×4124`
- `File:Albert Bierstadt - Mount Vesuvius at Midnight - 1949.541 - Cleveland Museum of Art.tiff` — Cleveland 1949.541, `4780×3366`
- `File:The Last of the Buffalo.jpg` — NGA 2014.79.5 / Corcoran, `10602×6252` (not the Whitney 60×96 in. replica)
- `File:Bierstadt - Among the Sierra Nevada Mountains - 1868.jpg` — SAAM 1977.107.1, `10500×6298`
- `File:Albert_Bierstadt_-_Lake_Lucerne_-_Google_Art_Project.jpg` — NGA, `7104×4233`
- `File:Valley_of_the_Yosemite_by_Albert_Bierstadt_1868.jpeg` — MFA Boston, `5547×4296`
- `File:CONCORDE_-_BRITISH_FRENCH_SUPERSONIC_TRANSPORT_AIRPLANE_-_NARA_-_17426977.jpg` — NARA 17426977, `4645×5480` on 4×5. Record is `catalog.archives.gov/id/17426977`.
- `File:USAF_General_Kevin_Schneider_pilots_F-22_Raptor_off_the_coast_of_Oahu,_Hawaii,_April_2025.jpg` — USAF digital, `5052×3368` on 35mm full frame
- `File:Bell_X-1.jpg` — NACA 46-063, `5100×4000`
- `File:Lockheed_SR-71_Blackbird.jpg` — NASA 831 / EC94-42883-4, `5100×3996`
- `File:X-15_Mounted_to_B-52_Mothership_Pylon_in_Flight_-_GPN-2000-000141.jpg` — GPN-2000-000141, `3024×2426`
- `File:SR-71_Takeoff_with_Afterburner_Showing_Shock_Diamonds_in_Exhaust.jpg` — NASA 831, `3030×2416`
- `File:JF-104.jpg` — Dryden E-6595, `3030×2394`

## Works in this archive

<!-- generated:archive-works -->
55 works. Written from `lib/collection.ts` by `node scripts/write-image-sources.mjs`. Do not hand-edit.

### bierstadt
- Valley of the Yosemite — 5547 × 4296 px — 291 PPI — `Valley_of_the_Yosemite_by_Albert_Bierstadt_1868.jpeg`
- Fir Trees and Storm Clouds — 5049 × 3698 px — 269 PPI — `Albert_Bierstadt_-_Fir_Trees_and_Storm_Clouds_-_1982.37_-_Cleveland_Museum_of_Art.tif`
- Sunrise, Yosemite Valley — 12732 × 8815 px — 241 PPI — `Albert_Bierstadt_-_Sunrise,_Yosemite_Valley_(c._1870).jpg`
- Indians Spear Fishing — 6345 × 4124 px — 214 PPI — `Albert_Bierstadt_-_Indians_Spear_Fishing_-_Google_Art_Project.jpg`
- Mount Vesuvius at Midnight — 4780 × 3366 px — 200 PPI — `Albert_Bierstadt_-_Mount_Vesuvius_at_Midnight_-_1949.541_-_Cleveland_Museum_of_Art.tiff`
- The Last of the Buffalo — 10602 × 6252 px — 88 PPI — `The_Last_of_the_Buffalo.jpg`
- Among the Sierra Nevada, California — 10500 × 6298 px — 87 PPI — `Bierstadt_-_Among_the_Sierra_Nevada_Mountains_-_1868.jpg`
- Lake Lucerne — 7104 × 4233 px — 58 PPI — `Albert_Bierstadt_-_Lake_Lucerne_-_Google_Art_Project.jpg`
### caravaggio
- Bacchus — 5700 × 6648 px — 170 PPI — `Bacchus_by_Caravaggio_1.jpg`
- Narcissus — 5951 × 7205 px — 164 PPI — `Narcissus-Caravaggio_(1594-96).jpg`
- Amor Vincit Omnia — 7120 × 9844 px — 160 PPI — `Caravaggio_-_Cupid_as_Victor_-_Google_Art_Project.jpg`
- Saint Francis of Assisi in Ecstasy — 7832 × 5640 px — 155 PPI — `Saint_Francis_of_Assisi_in_Ecstasy-Caravaggio_(c.1595).jpg`
- The Supper at Emmaus — 11412 × 8117 px — 146 PPI — `Supper_at_Emmaus-Caravaggio_(1601).jpg`
- The Taking of Christ — 9893 × 7666 px — 144 PPI — `The_Taking_of_Christ-Caravaggio_(c.1602).jpg`
- The Denial of Saint Peter — 7344 × 5292 px — 143 PPI — `The_Denial_of_Saint_Peter-Caravaggio_(1610).jpg`
- Saint John the Baptist in the Wilderness — 7382 × 9803 px — 141 PPI — `John_the_Baptist-Caravaggio_(Kansas_City).jpg`
- The Cardsharps — 4501 × 3239 px — 87 PPI — `Caravaggio_(Michelangelo_Merisi)_-_The_Cardsharps_-_Google_Art_Project.jpg`
- The Crowning with Thorns — 5256 × 3987 px — 80 PPI — `Michelangelo_Merisi,_called_Caravaggio_-_The_Crowning_with_Thorns_-_Google_Art_Project.jpg`
### century-of-speed
- F-22 Raptors off Oahu — 5052 × 3368 px — 3558 PPI — `USAF_General_Kevin_Schneider_pilots_F-22_Raptor_off_the_coast_of_Oahu,_Hawaii,_April_2025.jpg`
- Concorde — 4645 × 5480 px — 1096 PPI — `CONCORDE_-_BRITISH_FRENCH_SUPERSONIC_TRANSPORT_AIRPLANE_-_NARA_-_17426977.jpg`
- X-1 on Rogers Dry Lake — 5100 × 4000 px — 1000 PPI — `Bell_X-1.jpg`
- SR-71 over the mountains — 5100 × 3996 px — 999 PPI — `Lockheed_SR-71_Blackbird.jpg`
- X-15 under the B-52 — 3024 × 2426 px — 605 PPI — `X-15_Mounted_to_B-52_Mothership_Pylon_in_Flight_-_GPN-2000-000141.jpg`
- SR-71 takeoff — 3030 × 2416 px — 604 PPI — `SR-71_Takeoff_with_Afterburner_Showing_Shock_Diamonds_in_Exhaust.jpg`
- F-104 Starfighter — 3030 × 2394 px — 599 PPI — `JF-104.jpg`
### rembrandt
- The Abduction of Europa — 42582 × 33430 px — 1314 PPI — `Rembrandt_-_The_Abduction_of_Europa_-_Google_Art_Project.jpg`
- Self-Portrait — 6105 × 7369 px — 1203 PPI — `Rembrandt_van_Rijn_-_Zelfportret_(1629)_-_Alte_Pinakothek.jpg`
- Rembrandt Laughing — 6274 × 8171 px — 929 PPI — `Rembrandt_laughing.jpg`
- Andromeda — 4318 × 6000 px — 448 PPI — `Andromeda,_Rembrandt_van_Rijn,_1630-1631,_Mauritshuis,_The_Hague.jpg`
- Self-Portrait with Two Circles — 12243 × 15859 px — 331 PPI — `Rembrandt_van_Rijn_-_Self-Portrait_-_Google_Art_Project.jpg`
- The Artist in his Studio — 3746 × 2942 px — 300 PPI — `Rembrandt_The_Artist_in_his_studio.jpg`
- The Mill — 12229 × 10167 px — 294 PPI — `Rembrandt_van_Rijn_-_The_Mill_-_Google_Art_Project.jpg`
- Jeremiah Lamenting the Destruction of Jerusalem — 3857 × 4902 px — 210 PPI — `Rembrandt_Harmensz._van_Rijn_-_Jeremia_treurend_over_de_verwoesting_van_Jeruzalem_-_Google_Art_Project.jpg`
- The Toilet of Bathsheba — 5957 × 4467 px — 198 PPI — `Rembrandt_-_The_Toilet_of_Bathseba.JPG`
### rockwell
- Girl in Snow With Dog — 2684 × 3542 px — 394 PPI — `Norman_Rockwell_-_Girl_in_Snow_With_Dog_-_Google_Art_Project.jpg`
- Daniel Boone, Pioneer Scout — 2506 × 4001 px — 200 PPI — `Norman_Rockwell_-_Daniel_Boone,_Pioneer_Scout_-_Google_Art_Project.jpg`
- Hey Fellers, Come On In! — 3163 × 3713 px — 166 PPI — `Norman_Rockwell_-_Hey_Fellers,_Come_On_In!_-_Google_Art_Project.jpg`
- Slim Finnegan — 3215 × 4001 px — 146 PPI — `Norman_Rockwell_-_Slim_Finnegan_-_Google_Art_Project.jpg`
- Scouting With Daniel Boone — 3883 × 2364 px — 139 PPI — `Norman_Rockwell_-_Scouting_With_Daniel_Boone_-_Google_Art_Project.jpg`
- Vacation's Over — 3325 × 4001 px — 133 PPI — `Norman_Rockwell_-_Vacation's_Over_(Girl_Returning_from_Summer_Trip_)_-_Google_Art_Project.jpg`
- Boy with Baby Carriage — 2376 × 2584 px — 129 PPI — `Norman_Rockwell_-_Boy_with_Baby_Carriage_-_Google_Art_Project.jpg`
- Cousin Reginald Spells Peloponnesus — 3829 × 3845 px — 128 PPI — `Norman_Rockwell_-_Cousin_Reginald_Spells_Peloponnesus_(Spelling_Bee)_-_Google_Art_Project.jpg`
- No Swimming — 2643 × 2985 px — 119 PPI — `Norman_Rockwell_-_No_Swimming_-_Google_Art_Project.jpg`
- The Catch — 2990 × 3022 px — 103 PPI — `Norman_Rockwell_-_Catch,_The_-_Google_Art_Project.jpg`
### spaceflight
- Endeavour docked over Earth — 4032 × 6048 px — 4259 PPI — `Endeavour_docked_to_ISS.jpg`
- Atlantis on Pad 39A — 4015 × 2672 px — 2827 PPI — `Brightly_lit_STS-135_on_launch_pad_39a.jpg`
- Columbia, first launch — 6084 × 6084 px — 2765 PPI — `Space_Shuttle_Columbia_launching.jpg`
- Earthrise — 5584 × 5584 px — 2532 PPI — `AS08-14-2383.jpg`
- Gemini 6 views Gemini 7 — 4600 × 4410 px — 2005 PPI — `S65-63221_-_Gemini_6_Views_Gemini_7_(Raw_scan).tif`
- Earth from translunar coast — 4400 × 4600 px — 2000 PPI — `Apollo_11_Image_of_the_Earth,_showing_Africa,_Europe_and_Asia_(AS11-36-5355).jpg`
- Tracy's Rock — 3952 × 3952 px — 1796 PPI — `AS17-145-22224.jpg`
- Cernan walks to the rover — 3922 × 3922 px — 1783 PPI — `AS17-140-21388.jpg`
- The orange soil — 3909 × 3909 px — 1777 PPI — `AS17-137-20989.jpg`
- Rover close-up, Taurus-Littrow — 3879 × 3879 px — 1763 PPI — `AS17-137-20979.jpg`
- Atlantis on the 747 — 3030 × 2360 px — 590 PPI — `Atlantis_on_Shuttle_Carrier_Aircraft.jpg`
<!-- /generated:archive-works -->
