At its lowest form, the scarab is a humble beetle that rolls, devours, and lays its eggs in a ball of dung. In its highest form, the scarab is a form of the Egyptian sun god Ra, rolling daily across the heavens to give life to all below.
That’s pretty much spans the entire gamut of respectability right there.
Technically we’ve already had the giant scarab (as the scarab beetle from Inner Sea Bestiary, though the Bestiary 5 version has slight differences in the stat block and packs filth fever in its bite), so let’s focus on a bit more on scarab swarms.
Adventurers come across a witch trial in progress. In the excitement, a farmer’s manure cart is overturned. Not only does this cause a mess, but it also attracts a swarm of scarabs. Unfortunately for the accused woman, scarabs are considered guides to the land of the dead, effectively sealing her fate unless the adventuring company intervenes.
In order to bribe an orc king, adventurers must find a steed worthy of his greatness—ideally, one of the titanic megafauna. Fortunately the large animals aren’t hard to track, thanks to the copious amounts of spoor they leave behind. Unfortunately, dung-hungry giant scarabs trail the great beasts, becoming violent if approached.
Adventurers infiltrate a medical school searching for suspected necromancers. When they find a secret door in the basement leading to sub-basement not on the official maps, they think they’ve cracked the case wide open. Unfortunately, all they've found is the school’s body farm—a set of sunken graves where the faculty and students examine cadavers in various states of controlled decomposition. A locked door leads to the “cleaning room” stocked with beetles used to pick clean the bones of corpses. The beetles instinctively dislike torches and will attack as a swarm if one is held too close.
—Inner Sea Bestiary 5, Pathfinder Adventure Path #79 88–89 & Pathfinder Bestiary 5 221