I want to discuss a task or project
Done! We will get back to you within one business day
Something went wrong. Please try again
Alexander Start:Duck 🦢
@olga_startduck
Write to Telegram
Назад
1k+ участников
Вступить в Telegram
n8n
30.10.2025

Business Scraper - Telegram bot for automatic lead collection

System description

N8n automation with an AI agent on Telegram to intelligently collect business information from Google Places. The user sends a text request with a business category and location, the system automatically parses the data and saves it to Google Sheets for later calls.

How it works:

  1. Send a business category to Telegram (for example: “Restaurants in Moscow”)
  2. AI agent recognizes category and location
  3. Apify parses Google Places and collects data
  4. Information is stored in Google Sheets
  5. The bot sends examples of sites found

System architecture

Main workflow components

1. Telegram Trigger - Entry Point

  • Webhook ID: 931f5c9d-8924-4954-a755-2a6cfdd37931
  • Credentials: Leads scraper bot
  • Feature: Receiving text requests from users

2. AI Agent - Intelligent query parser

Settings:

  • Model: GPT-4.1-mini
  • Memory: Simple Memory (SessionKey: 12345)
  • Output Parser: Structured Output Parser

System prompt:

You're an AI agent that helps you collect information about potential leads for calls. You receive a request with a business category that you want to study. Only list the business category that the user named.

3. Structured Output Parser

Purpose: Structuring an AI response in JSON format

Output scheme: {'Category': 'Restaurant', 'Location': 'Moscow', 'Results': 20}

Parameters:

  • Auto Fix: true (structure autofix)
  • Language Model: GPT-4.1-mini

4. HTTP Request - Launch Apify scraper

Purpose: Initiating Google Places scraping

Settings:

Request body: {“SearchStringsArray”: ["[Category] [Location]"], “MaxCrawledPlacePerSearch”: [Number of Results], “language”: “ru”, “IncludeWebResults”: false, “ExportPlaceUrls”: true, “AdditionalInfo”: true}

5. Wait - Waiting for parsing to finish

  • Duration: 20 seconds
  • Feature: Gives Apify time to collect data

6. HTTP Request1 - Getting results

Purpose: Downloading collected data

URL: https://api.apify.com/v2/datasets/ {{$json.data.defaultDatasetid}} /items? token= (your Apify token)

Returned data:

  • title (company name)
  • CategoryName (category)
  • address
  • PhoneUnformatted (phone)
  • website (site)
  • SearchPageURL (Google link)
  • description (description)

7. Append row in sheet - Save to a table

Purpose: Writing data to Google Sheets

Settings:

  • Document ID: your document's ID
  • Sheet: Sheet1

Field mapping:

Name → title Type → CategoryName Address → address Number → phoneUnformatted Site → website Link → searchPageURL Description → description

8. Limit → Aggregate → Send message

Finalization process:

Limit: Takes the first 4 Aggregate records: Collects sites into an array Send message: Sends results to Telegram

Response format:

Your request has been successfully processed! Here are a few examples: [Site 1] [Site 2] [Site 3] [Site 4] The rest of the data is available in the table: [link]

System operation process

Step by step scenario:

  1. User: “Find dentistry in St. Petersburg”
  2. AI Agent processes: {“Category”: “Dentistry”, “Location”: “Saint Petersburg”, “Results”: 20}
  3. Apify parses Google Places:
    • Search: “Stomatology St. Petersburg”
    • Collecting up to 20 results
    • Retrieve all contact details
  4. Save to Google Sheets:
    • Automatically add rows
    • Structured call data
  5. User response:
    • 4 examples of sites found
    • Link to the full table

Data collected

Data structure about each business:

Parsing options

Supported categories:

  • Restaurants and cafes
  • Medical facilities
  • Beauty salons
  • Fitness centers
  • Car services
  • Stores
  • Hotels
  • Any other categories on Google Places

Search parameters:

  • Location: Any city or district
  • Radius: Automatic by Google
  • Language: Russian (customizable)
  • Quantity: Up to 100 results per request

Setting up the system

Required services:

1. Telegram Bot:

Creating via @BotFather /newbot /setname Leads Scraper Bot /setdescription Collecting business contacts

2. Apify Account:

  • Register on apify.com
  • Obtaining an API token
  • Subscribe to “Google Places Scraper”
  • At least $49/month for 1000+ results

3. Google Sheets:

  • Creating a “Places and Leads” table
  • Setting up OAuth2 in N8n
  • Granting recording rights

4. OpenAI API:

  • GPT-4.1-mini access key
  • A balance of at least $5

Advanced features

Additional filters:

{“OnlyWithWebsites”: true,//Only with “OnlyWithPhones” sites: true,//Only with “MinRating” phones: 4.0,//MinReviews minimum rating: 10,//Minimum “OpenNow” reviews: true//Only open now}

Data enrichment:

  1. Email search:
    • Website parsing for email search
    • Hunter.io integration
    • Validity check
  2. Social media:
    • Instagram profiles
    • Facebook pages
    • LinkedIn companies
  3. Additional information:
    • Opening hours
    • Photographs
    • Customer reviews
    • Menu (for restaurants)

Performance metrics

Performance:

ROI for the sales department:

  • Save time: 10 hours/week to search
  • Increased reach: x5 potential customers
  • Lead quality: +40% conversion to meetings
  • Cost: -80% vs manual search

Use cases

1: B2B software sales

“Find IT companies in Moscow” → 50 companies with contacts → 15 meetings scheduled → 3 new customers

2: HoReCa supplier

“Restaurants in the center of St. Petersburg” → 80 restaurants → 30 interested → 10 contracts

3: Marketing agency

“Beauty salons without a website in Kazan” → 40 salons → 20 need a website → 8 new projects

Frequently asked questions

Q: How many leads can I collect per day? A: Up to 1000 with a basic Apify subscription

Q: Is it legal? A: Yes, public data from Google Places

Q: Can I filter by email? A: Yes, through additional site parsing

Q: Does it work with other countries? A: Yes, Google supports all countries

Result

The system turns Telegram into a powerful lead generation tool, where you just need to write a business category to get a ready-made call base with full contact details. Perfect for sales teams, marketing agencies, and any B2B business.

Читайте также

No items found.

write to us and we will show you the way to efficiency