<!-- retoor <retoor@molodetz.nl> -->
# Image chain and licenses

Order: Wikimedia Commons, Openverse, DuckDuckGo images, Bing
images, licensed stock APIs last.

## Commons

`GET https://commons.wikimedia.org/w/api.php` with
`action=query`, `generator=search`, `gsrsearch` set to the query,
`gsrnamespace=6`, `prop=imageinfo`, `iiprop=url|size|mime|extmetadata`,
`format=json`. Creator is `extmetadata.Artist.value` stripped of
HTML; license short name is `extmetadata.LicenseShortName.value`;
license URL is `extmetadata.LicenseUrl.value`. All three are
computable per file; missing license means the file is unusable.

## Openverse

`GET https://api.openverse.org/v1/images/` with `q`. Read creator,
license, and the direct foreign URL per result.

## Fallbacks

DuckDuckGo and Bing image pages parse like their web variants and
return thumbnail URLs; treat licenses as unknown and prefer them
only for non-published working material. Stock APIs come last and
only with a configured key; their license terms ride with the file
record.

## Rules

Download bytes locally for every published image. Record creator,
source page URL, direct file URL, and license per file. Render the
required credit line under each published figure. Never hotlink
random web images into a deliverable.
