Police officers are sometimes entitled to stop people seemingly at random, as when roadblocks and sobriety checkpoints are involved. But they generally need a level of suspicion that lies somewhere between a hunch and probable cause in order to detain and question citizens. And they need more than that to search them.
The Difference Between a Police "Search" and a Police "Frisk"
A search is more extensive than a frisk--but the line can be hard to draw.
When Can Police Set Up Roadblocks?
When police stop only "suspicious" cars at roadblocks, the stops may not be legal.