Skip to main content

How to send Browse AI data to Salesforce

M
Written by Melissa Shires

This guide covers three ways to send your Browse AI scraped data into Salesforce, from no-code automation to custom API integrations. Choose the method that best fits your team's technical comfort and use case.

πŸ“– Prerequisites

You'll need an approved Browse AI robot with scraped data, and a Salesforce account with API access. For API-based methods, you'll also need a Browse AI API key.

Which method should I use?

Here's a quick comparison to help you decide:

Method

Best for

Technical level

Speed

Zapier / Make

Teams without developers

No code

Near real-time

Webhooks

Real-time pipelines with custom logic

Intermediate

Real-time

API polling

Batch processing, scheduled syncs

Intermediate

On schedule

Method 1: Zapier or Make (no code)

The fastest way to connect Browse AI to Salesforce. No coding required. Just map your scraped fields to Salesforce objects.

Setting up with Zapier

  1. Go to zapier.com and create a new Zap.

  2. Trigger: Choose Browse AI as the trigger app, then select New Successful Task Finished as the event.

  3. Connect your Browse AI account and select the robot you want to sync data from.

  4. Action: Choose Salesforce as the action app, then select the action that matches your use case, for example, Create Record for new Leads, Contacts, or custom objects.

  5. Connect your Salesforce account and choose the Salesforce object type (Lead, Contact, Account, Opportunity, or a custom object).

  6. Map your fields: Match each Browse AI captured field to the corresponding Salesforce field. For example, map Company Name β†’ Company, Email β†’ Email, Website β†’ Website.

  7. Test the Zap, then turn it on.

πŸ’‘ Tip: Use Zapier's Find Record step before Create Record to check if a Lead or Contact already exists. This prevents duplicates and lets you update existing records instead.

Setting up with Make (formerly Integromat)

  1. Create a new scenario in Make.

  2. Add a Webhooks β†’ Custom webhook module as the trigger. Copy the webhook URL.

  3. In Browse AI, go to your robot's Integrate tab and add the Make webhook URL under Webhooks. Select the taskFinishedSuccessfully event.

  4. Add a Salesforce β†’ Create a Record module, connect your Salesforce account, and map your fields.

  5. Activate the scenario.

Method 2: Webhooks (real-time, custom code)

Use Browse AI webhooks to push data directly into Salesforce as soon as a task finishes. This gives you full control over data transformation and error handling.

How it works

  1. Browse AI sends a webhook POST request to your server when a task completes.

  2. Your server receives the scraped data, transforms it to match Salesforce field formats.

  3. Your server authenticates with Salesforce's REST API and creates or updates records.

Step 1: Create a Salesforce Connected App

You'll need a Connected App in Salesforce to authenticate API requests.

  1. In Salesforce Setup, search for App Manager and click New Connected App.

  2. Fill in the basic info (name, contact email).

  3. Under API (Enable OAuth Settings), check Enable OAuth Settings.

  4. Set the callback URL (e.g. https://yourdomain.com/callback).

  5. Add the OAuth scope Manage user data via APIs (api).

  6. Save, then note your Consumer Key and Consumer Secret.

Step 2: Build your webhook endpoint

This example receives Browse AI webhook data and creates a Lead in Salesforce:

import requests
from flask import Flask, request, jsonifyapp = Flask(__name__)# Salesforce credentials
SF_CLIENT_ID = "your_consumer_key"
SF_CLIENT_SECRET = "your_consumer_secret"
SF_USERNAME = "your_salesforce_username"
SF_PASSWORD = "your_password_plus_security_token"def get_salesforce_token():
    """Authenticate with Salesforce using OAuth 2.0 password flow."""
    resp = requests.post("https://login.salesforce.com/services/oauth2/token", data={
        "grant_type": "password",
        "client_id": SF_CLIENT_ID,
        "client_secret": SF_CLIENT_SECRET,
        "username": SF_USERNAME,
        "password": SF_PASSWORD
    })
    auth = resp.json()
    return auth["access_token"], auth["instance_url"]def create_salesforce_record(access_token, instance_url, sobject, data):
    """Create a record in Salesforce."""
    resp = requests.post(
        f"{instance_url}/services/data/v62.0/sobjects/{sobject}/",
        headers={
            "Authorization": f"Bearer {access_token}",
            "Content-Type": "application/json"
        },
        json=data
    )
    return resp.json()@app.route("/browse-ai-webhook", methods=["POST"])
def handle_webhook():
    payload = request.get_json()    # Only process successful task completions
    if payload.get("event") != "taskFinishedSuccessfully":
        return jsonify({"status": "ignored"}), 200    task = payload["task"]
    captured = task.get("capturedTexts", {})    # Map Browse AI fields to Salesforce Lead fields
    lead_data = {
        "FirstName": captured.get("first_name", ""),
        "LastName": captured.get("last_name", "Unknown"),
        "Company": captured.get("company_name", "Unknown"),
        "Email": captured.get("email", ""),
        "Website": captured.get("website", ""),
        "LeadSource": "Browse AI",
        "Description": f"Auto-imported from Browse AI robot {task.get('robotId')}"
    }    # Authenticate and create the Lead
    access_token, instance_url = get_salesforce_token()
    result = create_salesforce_record(access_token, instance_url, "Lead", lead_data)    return jsonify({"status": "created", "salesforce_id": result.get("id")}), 200if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000)

Step 3: Register the webhook in Browse AI

You can register your webhook URL through the Browse AI dashboard or the API:

Via the dashboard:

  1. Open your robot and go to the Integrate tab.

  2. Under Webhooks, click Add webhook.

  3. Paste your endpoint URL (e.g. https://yourdomain.com/browse-ai-webhook).

  4. Select the taskFinishedSuccessfully event.

Via the API:

curl -X POST "https://api.browse.ai/v2/robots/YOUR_ROBOT_ID/webhooks" \
  -H "Authorization: Bearer YOUR_BROWSE_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yourdomain.com/browse-ai-webhook",
    "events": ["taskFinishedSuccessfully"]
  }'

πŸ’‘ IP allowlisting: Browse AI sends webhooks from IP address 3.228.254.190. If your server has a firewall, add this to your allowlist. See Webhooks: IP address for allowlisting.

Method 3: API polling (batch/scheduled)

If you prefer to pull data on a schedule rather than receive it in real time, you can poll the Browse AI API for completed tasks and push results into Salesforce in batches.

Example: Poll and sync to Salesforce

import requests
import json
from datetime import datetime, timedeltaBROWSE_AI_API_KEY = "your_browse_ai_api_key"
ROBOT_ID = "your_robot_id"def get_recent_tasks(since_hours=1):
    """Fetch tasks completed in the last N hours."""
    resp = requests.get(
        f"https://api.browse.ai/v2/robots/{ROBOT_ID}/tasks",
        headers={"Authorization": f"Bearer {BROWSE_AI_API_KEY}"},
        params={"pageSize": 100}
    )
    tasks = resp.json().get("result", {}).get("robotTasks", {}).get("items", [])    cutoff = datetime.utcnow() - timedelta(hours=since_hours)
    return [t for t in tasks if t.get("status") == "successful"
            and datetime.fromisoformat(t["finishedAt"].replace("Z","")) > cutoff]def sync_to_salesforce(tasks, access_token, instance_url):
    """Create Salesforce records from Browse AI task results."""
    for task in tasks:
        captured = task.get("capturedTexts", {})
        lead_data = {
            "LastName": captured.get("last_name", "Unknown"),
            "Company": captured.get("company_name", "Unknown"),
            "Email": captured.get("email", ""),
            "LeadSource": "Browse AI"
        }
        requests.post(
            f"{instance_url}/services/data/v62.0/sobjects/Lead/",
            headers={
                "Authorization": f"Bearer {access_token}",
                "Content-Type": "application/json"
            },
            json=lead_data
        )# Run this script on a schedule (e.g. cron job every hour)

πŸ“– For full API details, including pagination, bulk operations, and task filtering, see the API Guide: Getting started and API Guide: Bulk operations.

Salesforce-specific tips

Preventing duplicate records

Use Salesforce's upsert endpoint instead of a plain create to avoid duplicates. Upsert matches on an external ID field. For example, you could create a custom field called Browse_AI_Task_ID__c on your Lead object and use it as the external ID:

# Upsert: create if new, update if the external ID already exists
requests.patch(
    f"{instance_url}/services/data/v62.0/sobjects/Lead/Browse_AI_Task_ID__c/{task_id}",
    headers={
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json"
    },
    json=lead_data
)

Common field mappings

Here are typical mappings between Browse AI captured fields and standard Salesforce Lead fields:

Browse AI field

Salesforce Lead field

Notes

company_name

Company

Required for Leads

last_name

LastName

Required for Leads

first_name

FirstName

email

Email

phone

Phone

website

Website

job_title

Title

address

Street

(origin URL)

Description or custom field

Available as task.inputParameters.originUrl

πŸ’‘ Custom objects: These examples use the Lead object, but you can target any Salesforce object: Contacts, Accounts, Opportunities, or custom objects. Just change the sobject value in the API URL and adjust the field mapping.

Sending monitoring data to Salesforce

If you're using Browse AI monitors to track changes on websites, you can also push change events into Salesforce. Use the taskCapturedDataChanged webhook event to trigger updates. For example, updating a Contact's record when their LinkedIn profile changes, or creating a Task in Salesforce when a competitor's pricing page is updated.

To set this up, register a webhook for the taskCapturedDataChanged event and handle the payload in your endpoint alongside taskFinishedSuccessfully.

Troubleshooting

Salesforce returns a 401 Unauthorized error

Your OAuth token may have expired. Salesforce access tokens expire after the session timeout configured in your org (typically 2 hours). Refresh the token before retrying.

Records aren't appearing in Salesforce

Check that required fields are populated. Salesforce Leads require at minimum LastName and Company. If either is missing from your Browse AI data, provide a fallback value.

Webhook isn't firing

Make sure the webhook URL is publicly accessible and that your server responds with a 200 status code. See the Webhooks: Set up guide for detailed debugging steps.

Duplicate records in Salesforce

Use Salesforce's upsert endpoint with an external ID field (see "Preventing duplicate records" above) instead of a plain create.

Did this answer your question?