Skip to content

Get a random work from Trove by generating random ids

Here's a way you can get a random work from Trove's book, article, picture, map, music, or collection zones. It generates random work id prefixes and performs a wildcard search using the id index. If the prefix returns no results, a digit is sliced off the end. If a prefix returns more than 100 results, a digit is added to the end. This continues until the result set hits the sweet spot between 0 and 100. You can apply values for top-level facets like Format, but going too deep into the facet hierarchy will mean the id search will generate more misses. If you want to apply your own queries or facets, try the method below.

Run live on ARDC Binder

Other options

Additional documentation

Getting help

Cite as

Sherratt, Tim. (2023). GLAM-Workbench/trove-random (version v1.0.0). Zenodo.