Skip to content

Get a random work from Trove using queries and facets

Here's another way you can get a random work from Trove's book, article, picture, map, music, or collection zones. This approach is particularly useful if you want to get a random result from a search, or want to apply a variety of facets. It's not as quick as pinging random work ids at Trove, but it's more flexible. Basically this method gets all the available facets for a particular search. If the search has more than 100 results, it chooses one of the facets at random and applies it. It keeps doing this until the search returns less that 100 results. Then it chooses a work at random from the results. If you don't supply a query, it uses a random stop word to mix things up a bit.

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.