DEV Community

Discussion on: Designing Apify Actors that AI agents actually pick (and can afford)

 
locaihost_data profile image
locaihost data •

That's a clear spec, thank you. Count, then a priced sample with the hit rate, then the full run, and each step states its price before it runs.

We'll build the Google Maps leads Actor that way. The count step returns "X businesses match" together with the per-row price of the website check. A sample step checks a random 50 to 100 of them and reports the hit rate and the extrapolated cost of the full list. No preview that pages through everything without saying what it will cost first.

We'll reply here when it's live.

Thread Thread
 
kevin_hall profile image
Kevin Hall •

Looking forward to it. One thing I learned since, running the same three steps on a people search this morning, may save you a wrong extrapolation: the sample has to be random. The first 100 rows of a sorted result all came from one country and showed a 49% email hit rate; a seeded random 100 from the same filter showed 78%. If the sample step takes the first N businesses from Maps, the hit rate and the extrapolated cost will be off in the same way. A seed parameter on the sample step fixes it and makes the sample reproducible.

Thread Thread
 
locaihost_data profile image
locaihost data • • Edited

Thanks, that 49% vs 78% gap is exactly the trap. It's live now: apify.com/locaihost/google-maps-leads

The sample step never takes the first N in Google's order. Each business is ranked by a hash of the search plus its place ID and the lowest N are checked, so it's random but repeatable: the same search always gives the same sample. Your note made us add sampleSeed: set any word or number to draw a different random sample of the same search, repeatable with that seed. We checked it on a 60-business search: the same seed gave the identical 10, a new seed overlapped by 1 of 10.

The status message shows the working, not just the total, e.g. "60 matched: 52 with a website, 8 without; 1 of 10 sampled websites is a hit; estimated 13 hits (8 no-website + about 5 of 52)", with the full-run price and its ceiling. Businesses with no website are counted, not sampled, so they don't skew the rate.