This n8n workflow automates the process of scraping business phone numbers and information from Google Maps using the Bright Data API and saves the results to Google Sheets.
Type: Form Trigger
Purpose: Start the workflow when a form is submitted
Fields:
Configuration:
8b72dcdf-25a1-4b63-bb44-f918f7095d5dType: HTTP Request
Purpose: Sends scraping request to Bright Data API
Method: POST
URL: https://api.brightdata.com/datasets/v3/trigger
Query Parameters:
dataset_id: gd_m8ebnr0q2qlklc02fzinclude_errors: truetype: discover_newdiscover_by: locationlimit_per_input: 2Headers:
Authorization: Bearer BRIGHT_DATA_API_KEYRequest Body:
{
"input": [
{
"country": "{{ $json.Location }}",
"keyword": "{{ $json.keywords }}",
"lat": ""
}
],
"custom_output_fields": [
"url",
"country",
"name",
"address",
"description",
"open_hours",
"reviews_count",
"rating",
"reviews",
"services_provided",
"open_website",
"phone_number",
"permanently_closed",
"photos_and_videos",
"people_also_search"
]
}
Type: HTTP Request
Purpose: Check if data scraping is completed
Method: GET
URL: https://api.brightdata.com/datasets/v3/progress/{{ $json.snapshot_id }}
Query Parameters:
format: jsonHeaders:
Authorization: Bearer BRIGHT_DATA_API_KEYType: Conditional (IF)
Purpose: Determine if scraping is ready or needs to wait
Condition: {{ $json.status }} equals "ready"
Type: Wait
Purpose: Pause 1 minute before checking status again
Duration: 1 minute
Webhook ID: 7047efad-de41-4608-b95c-d3e0203ef620
Type: Conditional (IF)
Purpose: Proceed only if business records are found
Condition: {{ $json.records }} not equals 0
Type: HTTP Request
Purpose: Get business information including phone numbers
Method: GET
URL: https://api.brightdata.com/datasets/v3/snapshot/{{ $json.snapshot_id }}
Query Parameters:
format: jsonHeaders:
Authorization: Bearer BRIGHT_DATA_API_KEYType: Google Sheets
Purpose: Store business data in Google Sheets
Operation: Append
Document ID: YOUR_GOOGLE_SHEET_ID
Sheet Name: GMB
Column Mapping:
{{ $json.name }}{{ $json.address }}{{ $json.rating }}{{ $json.phone_number }}{{ $json.url }}BRIGHT_DATA_API_KEY with your actual API keyYOUR_GOOGLE_SHEET_ID with your actual sheet ID0bed9bf1-00a3-4eb6-bf7c-cf07bee006a2Hm7iTSgpu2of6gz4For any questions or support, please contact:
[email protected]
or fill out this form: https://www.incrementors.com/contact-us/