PTENES
MODULE 4.3

📊 Lead Scoring with Apify

Having a thousand leads doesn't tell you where to start. This qualification skill classifies each business, scores brands across three dimensions with Google search via Apify, and sorts the queue by priority — so your highest-effort outreach always goes to the lead most likely to convert.

6
Topics
50
Minutes
Inter.
Level
Practice
Type
1

🎯 Why score leads

The bottleneck in outreach is never the number of leads—it’s your time. With a long list, contacting people at random wastes the most expensive effort—a personalized approach—on people who were never going to buy. Lead scoring solves this by assigning each lead a score and ranking the queue by likelihood to convert.

🎯 The concrete problem

You scan the web and Shopify to find brands in a niche that manufacture their own products. You find hundreds. Now: which one should you contact first to offer your data product? Without a score, it’s a guess. With a score, it’s an ordered queue.

📊 The three benefits of scoring

  • • 🚀 Outreach prioritization: instead of reaching out at random, the skill ranks leads by readiness and fit—the greatest effort goes to the lead most likely to become a customer.
  • • 📊 Consistent, unbiased score: every brand is evaluated using the same criteria, removing guesswork and the mood of the day from the process.
  • • 🧠 Rich context for each brand: the score provides evidence about each business, so you know where to focus and how to adjust the message before reaching out.
Prioritization

Queue sorted by likelihood of closing.

No bias

Same criteria for everyone.

Repeatable

Runs the same way on any list.

Context

Evidence guides the message.

2

🏷️ The classification that comes first

Scoring someone who isn't the target wastes time and API calls. That's why, before scoring, the skill classifies each business reading the site HTML: only those selling their own products (brand) enters the scoring phase. Salons, resellers, and unknowns are flagged and left out.

Website HTML signals product own? salon / barber brand ✓ retailer 3D scoring only brand gets included

The decision tree (from the skill code)

1. ≥2 sinais de salão E nenhum produto próprio  → salon / barber
2. tem sinal de produto próprio                 → brand
3. tem páginas de produto, 0 revenda, ≥2 sinais → brand
4. tem sinal de revenda E 0 produto próprio     → retailer
5. tem páginas de produto                       → brand
6. tipo já era salon/barber                      → preserva
7. caso contrário                                → unknown

✓ Signs of a "brand" (your own product)

  • ✓Pages /products, /collections, /shop.
  • ✓Phrases like “our formula,” “small batch,” “we formulate.”
  • ✓™ / ® marks in the content.
  • ✓Founder story: “our story,” “founder.”

✗ Signals that exclude from scoring

  • ✗"we stock", "brands we love" → it's a retailer.
  • ✗"book appointment", "our services" → it's a service provider (salon).
  • ✗Social domains, marketplaces, and directories are skipped.
  • ✗No detectable product of its own → unknown, out of the queue.
Decision tree

Ordered, clear rules.

Signals in the HTML

Read the site, don't guess.

Only brand scores

Filter before spending.

No evidence, no label

Doesn’t invent a "brand".

3

📐 The three dimensions of the score

Each brand gets a score from 0 to 100, made up of three dimensions with explicit weights. The weights aren’t arbitrary: they reflect what matters when selling a data product — product development capability weighs more, while brand maturity weighs less.

0–50
Product development

Does it have an R&D team? Does it develop its own formulations? Does it hire for R&D roles?

0–30
Data maturity

Does it have quizzes/personalization? A marketing stack? Data/CRM roles?

0–20
Brand maturity

Are you in major retailers? Do you have awards/press coverage? A large team?

Signal (Dim. 1 — Product)Points
R&D / lab / formulation on the site+8
“Clinically tested” claims+7
Senior R&D role on LinkedIn+25
Junior formulation/R&D role+15
Open development position+10

💡 Tip: the score must be explainable

Dimensions with visible weights make the number easy to understand. You don't just know the brand scored 86—you know it scored 42 in product, 30 in data, and 14 in brand. This helps you read the lead: "this company has a strong product team but an emerging brand" changes the approach.

Three dimensions

Product, data, brand.

Weights 50/30/20

Product matters more.

Scored signals

Each signal is worth X points.

Explainable score

You know why the number is what it is.

4

🔎 Two Passes: Site and Apify

The scoring takes place in two passes, and the order matters: get the cheap signal first, pay for the expensive one only afterward. Pass 1 reads only the website (free). Pass 2 runs 5 Google searches via Apify per brand to find LinkedIn roles, jobs, awards, and retail presence.

1

Pass 1 — site only (free)

Search the brand’s site once (with caching) and look for signals in the HTML: mentions of R&D, science claims, personalization quiz, review system, marketing tools (Klaviyo, GA), “where to buy” page. Mark the result as scoring_depth=website_only.

2

Pass 2 — enrichment via Apify (paid)

Runs 5 Google searches for the brand via Apify (actor apify~google-search-scraper): R&D and data roles on LinkedIn, open positions, retailer presence, press/awards, team size. Add these points to the website score, with a cap per dimension, and mark scoring_depth=full.

📊 Real cost and time

  • • ~$0.045 per brand — 5 Google searches per brand.
  • • Full run (15 brands): ~20 minutes, ~$0.70 of Apify.
  • • Phase 2 only (78 marks): ~2 hours, ~$3.50 of Apify.
  • • Domain filtering: social media, marketplace, coupon, and directory results are discarded before scoring — only relevant signals count.

Apify query example (Dim. 1 — R&D role)

"{nome da marca}" (formulation OR chemist OR "R&D"
  OR "product development" OR "cosmetic scientist")
  site:linkedin.com

→ achou cargo sênior  → +25
→ achou cargo júnior  → +15
→ nada                → +0  (não inventa evidência)

⚠️ Golden rule: don't fabricate evidence

If a search returns no results, the skill scores 0 for that signal—it never makes anything up. A score is only valid if every point has traceable evidence. That principle is what separates reliable scoring from a generator of pretty numbers.

Two-pass

Website first, Apify later.

Free vs. paid

Cheap signal before the expensive one.

~$0.045/brand

Predictable cost per lead.

Real evidence

No search, score 0.

5

🏆 Tiers and the output contract

The number from 0 to 100 is translated into a tier — the actionable label that tells you where to start. And the output CSV carries not just the score, but the subscores and evidence for each dimension, forming a contract that the next skill (the outreach one) can consume without guesswork.

Tier 4 · <30weak signals Tier 3 · 30–49worth a try Tier 2 · 50–69high potential Tier 1 · ≥70top priority
TierScoreMeaning
Tier 1≥ 70Has a product team AND data capabilities. Top priority.
Tier 250–69Has a product OR data, not both. High potential.
Tier 330–49Brand owner with limited R&D/data signals. Worth reaching out.
Tier 4< 30Weak signals. Probably small or at an early stage.

Output example — a Tier 1 brand (illustrative recreation)

business_name      : Marca Exemplo Hair Care
qualification_score: 86
qualification_tier : Tier 1
product_dev_score  : 42  (cargo sênior de R&D + ciência no site)
data_maturity_score: 30  (quiz de cabelo, reviews, Klaviyo detectado)
brand_maturity_score: 14 (imprensa + 2 redes sociais ativas)
product_dev_evidence: LinkedIn: senior R&D role found |
                      science-backed claims on website
data_evidence      : hair quiz on website | reviews system |
                      marketing tech stack detected
scoring_depth      : full

Output line recreated to illustrate the CSV contract — not real customer data.

💡 Tip: the contract serves the next skill

The CSV is sorted by descending score and includes predictable columns (qualification_tier, product_dev_evidence, etc.). The outreach skill reads that contract directly: takes the top of the queue and uses the evidence to personalize the message. Clear output is what makes the pipeline composable.

Four tiers

≥70 / 50 / 30 / <30.

Evidence per dim.

The CSV explains why.

Sorted by score

Top of the queue = start here.

Downstream contract

Outreach consumes directly.

6

⚙️ Checkpoint, resume, and modes

Scoring 78 brands takes hours and uses API calls. An interruption midway can't cost you the work already done. That's why the skill has two modes of operation and a file for checkpoint that saves progress after each checkpoint—making the run safe to interrupt and resume.

Mode 1 — full run (default)

Processes only rows without a score yet. Classifies (phase 1b), scores based on the website (pass 1), enriches with Apify (pass 2), merges with previously scored rows, and saves them sorted.

python3 qualify_leads_apify.py \
  --input leads.csv

Mode 2 — phase 2 only

Re-scores only the marked rows website_only with Apify, without repeating the classification. Useful when you already have a CSV scored based only on the site.

python3 qualify_leads_apify.py \
  --input scored.csv --phase2-only

📊 How the checkpoint protects the run

  • • Saves a checkpoint file after each brand scored.
  • • On restart, skips brands already in the checkpoint and continues where it left off.
  • • Preserves lines already scored in full mode — it doesn’t reprocess what’s already done.
  • • When the run finishes, the checkpoint file is removed automatically.

✓ Robust error handling

  • ✓Without APIFY_API_TOKEN → stop and notify.
  • ✓Synchronous run times out → falls back to asynchronous polling.
  • ✓Website returns 403/429 → skip classification for that row.
  • ✓Interrupted? Run the same command—it resumes from the checkpoint.

✗ Without these safeguards

  • ✗A crash at milestone 60 of 78 loses the 60 already completed.
  • ✗Rerunning charges again for everything that was already scored.
  • ✗An Apify timeout brings down the entire process.
  • ✗One site going down stops the batch instead of skipping the row.

✍️ Hands-on exercises

1

Define your dimensions. For your own ICP, write 3 dimensions and their weights (adding up to 100). Which signals earn points in each one? Explain why the greatest weight goes where it does.

2

Create a runnable SKILL.md. Write a SKILL.md for qualification with the description triggering on "qualify/score/filter leads," document both modes and the CSV output contract. Test the trigger with a small spreadsheet.

3

Design the classification. Before scoring, what signals on the site distinguish your target from a non-target? Write the decision tree (like the one in topic 2) for your niche.

4

Test the checkpoint. Score 5 rows, interrupt on the 3rd, and run it again. Does the skill resume from the 3rd or start over? Make sure the evidence for each dimension has a traceable source (never fabricated).

📌 Module Summary

✓
Score prioritizes the queue — your time is the bottleneck; prioritizing leads multiplies the return on the same effort.
✓
Classify before scoring — only brand enters the scoring; a decision tree based on website signals filters out the noise.
✓
Three dimensions with weights — product (0–50), data (0–30), brand (0–20); explainable score.
✓
Two-pass: website, then Apify — free signal first, paid search later; ~$0,045/brand, without fabricating evidence.
✓
Tiers + checkpoint — Tiers 1 to 4, CSV as the contract, and a checkpoint that protects long runs.

End of Track 4:

You’ve mastered three skills that work with data and automation. The next track brings skills into AI consulting.