Maybe this has happened to you.

Locked out of your car or home, you pull out your phone and type “locksmith” into Google. Up pops a list of names, the most promising of which appear beneath the paid ads, in space reserved for local service companies.

You might assume that the search engine’s algorithm has instantly sifted through the possibilities and presented those that are near you and that have earned good customer reviews. Some listings will certainly fit that description. But odds are good that your results include locksmiths that are not locksmiths at all.

They are call centers — often out of state, sometimes in a different country — that use a high-tech ruse to trick Google into presenting them as physical stores in your neighborhood. These operations, known as lead generators, or lead gens for short, keep a group of poorly trained subcontractors on call. After your details are forwarded, usually via text, one of those subcontractors jumps in a car and heads to your vehicle or home. That is when the trouble starts.

The goal of lead gens is to wrest as much money as possible from every customer, according to lawsuits. The typical approach is for a phone representative to offer an estimate in the range of $35 to $90. On site, the subcontractor demands three or four times that sum, often claiming that the work was more complicated than expected. Most consumers simply blanch and pay up, in part because they are eager to get into their homes or cars.