A higher busy percentage can still mean fewer visitors.
You're choosing locations for a campaign. The spreadsheet sorts cleanly, the busiest-looking place wins, and you feel that small dread: what exactly did you rank?
Popular Times expresses activity against each place's own typical peak. Sorting those percentages across locations can't establish a visitor-volume ranking. The arithmetic works. The campaign decision might not.
Example acquisition for a fixed shortlist, with unresolved inputs included for inspection:
import { ApifyClient } from 'apify-client'; const client = new ApifyClient({ token: process.env.APIFY_TOKEN, }); const run_input = { placeIds: [ 'ChIJaXQRs6lZwokRY6EFpJnhNNE', 'ChIJabtoT7hlwokRLECK0SW3_8I', ], includeFailedPlaces: true, }; const run = await client .actor('nimbryxo-studio/google-maps-popular-times-and-live-busyness') .call(run_input); if (run.status !== 'SUCCEEDED') { throw new Error(`Campaign acquisition stopped: ${run.status}`); } const { items } = await client .dataset(run.defaultDatasetId) .listItems(); That fetch gives you a dataset page. For larger lists, complete dataset pagination before treating the acquisition as complete.
A successful run is also separate from having usable activity data for every requested place.
Why can't the percentage rank visitor volume?
The chart answers a timing question: how busy is this place usually, relative to its own peak?
Its reference point makes quieter and busier hours readable without publishing an absolute visitor count. That reference belongs to the place, however. It doesn't become shared just because your dashboard puts the bars beside each other.
The live comparison adds another reference: this place's usual activity at the reading's hour.
Keep those questions separate in your pipeline:
Weekly chart -> this place versus its own typical peak -> candidate hours within this place Live comparison -> this place versus its usual activity now -> relative activity observation Visitor-volume ranking -> independently measured or calibrated counts -> campaign location selection An unusually active small venue and an unusually active large venue can both deserve attention. Neither observation tells you which offers more potential campaign exposure.
Even a calibrated visitor count would leave another question: are those visitors relevant to your campaign? Volume and audience fit need separate evidence.
The fallback preserves the place, not the chart
Google withholds Popular Times from the limited view it serves to signed-out sessions. When that happens, the Actor returns the resolved place's basic details without estimating busyness.
That distinction matters when you're enriching a sales list. A valid address can survive a missing chart; an activity score can't.
Requests start directly. A configured proxy is reserved for the final attempts on hard-to-reach places. The sign-in restriction is treated as a practical boundary, rather than something additional retries can reliably remove.
So your retry policy should distinguish retrieval trouble from unavailable evidence. Repeating the same acquisition isn't a calibration strategy.
Fields the page doesn't expose are omitted. Missing activity therefore needs its own state in your campaign workflow, separate from observed quiet activity.
| Source behavior | Assumption it breaks | Consumer decision |
|---|---|---|
| Each place has its own peak | Percentages share a denominator | Keep rankings within each place |
| Limited pages omit the chart | Every resolved place has activity data | Track activity eligibility separately |
| Unresolved inputs can have failure records | Every dataset item is a usable place | Route records before scoring |
| Each search query keeps its own record | Place observations are always unique | Reconcile identities before aggregation |
Repeated place URLs or Place IDs are deduplicated for the same place. Search-query records retain their own outcomes, even when they resolve to an already represented place.
That makes query resolution auditable. It also means row count is a poor substitute for distinct-place count.
Validate evidence without rejecting basic records
Your validator should accept an honest basic record while rejecting malformed activity values.
The schema below validates the fields this workflow consumes. It doesn't require a chart merely because a place resolved.
import { z } from 'zod'; const day = z.enum([ 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', ]); const hour = z.number().int().min(0).max(23); const percentage = z.number().finite().min(0).max(100); const hourly = z.array(z.object({ hour, busyness: percentage, })); const placeSchema = z.object({ recordType: z.literal('popularTimes'), featureId: z.string().min(1).optional(), cid: z.string().min(1).optional(), timezone: z.string().min(1).optional(), observedAtLocal: z.string().min(1).optional(), popularTimesAvailable: z.boolean().optional(), popularTimes: z.object({ monday: hourly.optional(), tuesday: hourly.optional(), wednesday: hourly.optional(), thursday: hourly.optional(), friday: hourly.optional(), saturday: hourly.optional(), sunday: hourly.optional(), }).optional(), liveReadingStatus: z.string().optional(), currentBusyness: z.number().finite().nonnegative().optional(), usualBusyness: percentage.optional(), liveToUsualRatio: z.number().finite().nonnegative().optional(), liveMinusUsual: z.number().finite().optional(), currentBusynessDay: day.optional(), currentBusynessHour: hour.optional(), }).refine(p => p.featureId !== undefined || p.cid !== undefined); const envelopeSchema = z.object({ recordType: z.string().optional(), }); const places: z.infer<typeof placeSchema>[] = []; const otherRecords: unknown[] = []; const invalidRecords: unknown[] = []; for (const item of items) { const envelope = envelopeSchema.safeParse(item); if (!envelope.success) { invalidRecords.push(item); continue; } if (envelope.data.recordType !== 'popularTimes') { otherRecords.push(item); continue; } const parsed = placeSchema.safeParse(item); if (parsed.success) places.push(parsed.data); else invalidRecords.push(item); } Keep the original records available for diagnosis. The parsed objects deliberately contain only this workflow's working fields.
Neither otherRecords nor invalidRecords belongs in an activity average. They still belong in your acquisition accounting.
Also reconcile the requested shortlist against resolved identities and unavailable outcomes. A chart-eligible subset is a coverage result, not automatically a representative sample of your target market.
Carry the reference into your transformations
Build separate collections for scheduling and live comparison. The names should make an accidental visitor-volume export uncomfortable.
The objects below are consumer-owned views. Timing candidates retain their weekday as a key inside popularTimes; their reference labels aren't additional source fields.
const withinPlaceTimingCandidates = places.flatMap(p => { if ( p.popularTimesAvailable !== true || !p.popularTimes || !p.timezone || !p.observedAtLocal ) return []; return [{ featureId: p.featureId, cid: p.cid, timezone: p.timezone, observedAtLocal: p.observedAtLocal, popularTimes: Object.fromEntries( Object.entries(p.popularTimes).map(([weekday, entries]) => [ weekday, [...(entries ?? [])].sort((a, b) => b.busyness - a.busyness), ]), ), reference: 'this-place-typical-peak' as const, }]; }); const eligibilityFloor = 30; // Consumer policy for live comparisons. const relativeToUsualActivityObservations = places.flatMap(p => { if ( p.liveReadingStatus !== 'live' || !p.timezone || !p.observedAtLocal || p.currentBusynessDay === undefined || p.currentBusynessHour === undefined || p.currentBusyness === undefined || p.usualBusyness === undefined || p.usualBusyness < eligibilityFloor || p.liveToUsualRatio === undefined || p.liveMinusUsual === undefined ) return []; return [{ featureId: p.featureId, cid: p.cid, timezone: p.timezone, observedAtLocal: p.observedAtLocal, currentBusynessDay: p.currentBusynessDay, currentBusynessHour: p.currentBusynessHour, currentBusyness: p.currentBusyness, usualBusyness: p.usualBusyness, liveToUsualRatio: p.liveToUsualRatio, liveMinusUsual: p.liveMinusUsual, reference: 'this-place-usual-at-this-hour' as const, }]; }); Timing candidates stay grouped by place and weekday. Each day's hours are sorted by activity within that place, so the collection never becomes a global leaderboard.
Chart hours are local to the place. Scheduling a field visit also requires checking the relevant opening hours and campaign date; a usual weekly pattern isn't a booking guarantee.
The live collection applies an explicit baseline floor. Ratios become sensitive when their denominator is small, so an eligibility policy belongs beside any anomaly comparison.
This floor is consumer policy. The Actor's similarly named monitoring threshold governs its monitoring summaries; it doesn't change the meaning of the raw comparison fields.
Retain both supplied comparison metrics. A ratio describes proportional deviation, while the difference describes movement on that place's normalized scale. Neither measures additional visitors.
If these collections travel through an automation workflow, carry their reference labels with them. A field renamed simply score tends to acquire responsibilities it never applied for.
Refuse the export your data can't support
The worked source is Google Maps Place Data & Popular Times (When Available). Its place-relative activity fields support timing and anomaly workflows.
For a campaign tool, make unsupported requests a structured result rather than a plausible-looking sort.
function requestVisitorVolumeRanking() { return { ok: false, reason: 'MISSING_VISITOR_VOLUME_CALIBRATION', explanation: 'Place-relative activity fields cannot establish visitor counts.', requiredEvidence: 'Independent counts or a validated per-place calibration ' + 'for the relevant observation periods.', } as const; } const visitorVolumeExport = requestVisitorVolumeRanking(); That response gives your workflow something explicit to route: request calibration, choose a timing workflow, or leave the location decision pending.
Calibration needs its own provenance. Record the counting method, relevant periods, uncertainty, and conditions under which the relationship remains usable.
A convenient multiplier without that evidence merely moves the unsupported assumption into another column.
What broke was the denominator
The failure is semantic: a percentage lost the reference population that gave it meaning.
You can demonstrate the ambiguity without pretending to know any venue's actual traffic.
Example synthetic fixtures use invented peak visitor counts solely to expose the ranking reversal:
const syntheticFixtures = [ ['synthetic-small', 100, 30], ['synthetic-large', 40, 240], ] as const; // [label, relative percentage, assumed peak visitor count] const rankedByPercentage = [...syntheticFixtures] .sort((a, b) => b[1] - a[1]); const rankedBySyntheticVisitorCount = [...syntheticFixtures] .sort((a, b) => (b[1] * b[2]) - (a[1] * a[2])); const rankingReverses = rankedByPercentage[0][0] !== rankedBySyntheticVisitorCount[0][0]; if (!rankingReverses) { throw new Error('Synthetic fixture no longer demonstrates the trap.'); } The fixture assumes a linear relationship purely for illustration. It isn't a visitor-estimation method.
Its useful result is narrower: the relative percentages alone can't rule out an opposite visitor-volume ordering.
A green schema check wouldn't catch that mistake. The data can be valid, the sort stable, and the business interpretation unsupported.
Before the campaign job runs
- Confirm the requested locations and acquisition outcomes reconcile.
- Separate missing activity from measured quiet activity.
- Preserve place identity, local hour, observation time, and comparison reference.
- Reconcile repeated identities before place-level aggregation.
- Apply a baseline eligibility policy to anomaly comparisons.
- Require independent calibration before exporting visitor-volume rankings.
Your dashboard should say “relative to this location's usual activity.” If that label feels too qualified, the decision probably needs different data.
Drafted with AI assistance and reviewed for accuracy.
