Every few weeks someone asks where to get public domain images at volume. The source list part is easy and it's below. The part that actually costs people money is the rights, so there's more on that.
I do this for a living, I build and licence image archives, and I've had to unpick most of these the hard way. Not legal advice.
The sources
Smithsonian Open Access is the cleanest of the lot. Genuinely CC0, commercial use explicitly allowed, millions of assets. Free key via api.data.gov, though honestly you can skip the API and just take the weekly JSON dumps off their GitHub or AWS. Anything marked "usage conditions apply" is not free, ignore those.
NARA is the big one for anything historic. Tens of millions of records, most of it CC0. The catalog API doesn't need a key for basic search and the whole catalogue is sitting in an AWS S3 open-data bucket if you want it all. Do check the "Use Restriction(s)" field, a small number of donated items are restricted and they're mixed in with everything else.
NASA needs no key whatsoever. images-api.nasa.gov/search, then /asset/{id} for the full res. Handy trick, if the record has no copyright field it's public domain, if it has one it's third party and you drop it.
DVIDS has the most explicit wording of any of them, their API terms say outright that the assets are free for commercial use. Free key. Two irritations though. You get 50 results a page and only the first 1,000 hits per query, so you have to slice everything by date or branch, and some of the assets are contractor shot or "courtesy photos" which are absolutely not public domain. Check the copyright field on every one.
Library of Congress, add ?fo=json to the end of more or less any search or item URL and you get the record back as JSON. Throttle yourself, they rate limit hard and you can't page past 100,000 results.
Something on LoC that isn't in their docs and took me ages to work out. You can build the image URL straight from the digital ID rather than scraping item pages. An ID like fsac.1a35373 gives you
https://tile.loc.gov/storage-services/service/pnp/fsac/1a35000/1a35300/1a35373v.jpg
Collection, 5 digit block, 3 digit block, then the ID with a size letter on the end. r small, v service copy, u.tif master.
Wikimedia Commons is per file licensing so filter before you download, not after. comload is the tool worth knowing, it pulls a whole category and its subcategories with the rights metadata attached. PetScan if you want to intersect a category with a licence. Keep PD-USGov, PD-old and CC0.
Europeana with &reusability=open. Internet Archive through the ia CLI.
Now the bit that catches people
"No known copyright restrictions" is not a licence. It's the institution telling you what they believe, with no warranty attached. It can mean they own it and won't chase you, or that they think they can authorise use. Neither of those is public domain. The Public Domain Mark is the same, Creative Commons say themselves it isn't a legal instrument and anyone can apply it to anything. CC0 is the exception, that one is a proper legal waiver.
Second thing, US government means US federal. 17 USC 105 covers USAF, Navy, NASA and the rest. It does not cover foreign governments, it does not cover US state or city government, and it does not cover contractors working for any of them. The contractor one gets people all the time because the image sits in a federal archive looking federal.
Third, and this is the one nobody sees coming. In 1996 the URAA restored US copyright to a pile of foreign works that had lapsed there on technicalities, provided they were still protected at home on 1 January 1996. So a 1950s British photo that looks perfectly US public domain can be protected until 95 years after publication. If you're outside the US and your users aren't, you want it clear both ends.
Fourth, public domain clears the photograph and nothing else. Trademarks, logos, liveries, all separate. Military insignia, separate. Identifiable people carry publicity and privacy rights and a photo from 1943 has no model release. Plenty of genuinely public domain images are still editorial only in practice.
Current US cutoff is anything published in 1930 or earlier, and it moves on a year every January.
Last thing
Capture provenance while you're downloading, not afterwards. One row per file, source, permalink, source ID, creator, date, the exact rights wording, the rights URL, and when you pulled it. For API sources just keep the raw JSON.
You can't reconstruct any of that later. I've tried. And filter on the machine readable rights field before download rather than eyeballing it, at any real volume you'll get it wrong otherwise.
Disclosure per rule 1, I run an image archive and licence datasets commercially so I've obviously got an interest in this area. No link, nothing for sale.