# Branch Email Finder - Local Contact and Address Evidence (`variable_mitts/branch-contact-resolver`) Actor

Match published website emails to supplied branch names and addresses. Separate branch-confirmed, central and ambiguous contacts with source evidence.

- **URL**: https://apify.com/variable_mitts/branch-contact-resolver.md
- **Developed by:** [Dhan sites](https://apify.com/variable_mitts) (community)
- **Categories:** Lead generation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.60 / 1,000 input record inspecteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Branch Email Finder - Local Contact and Address Evidence

Match published website emails to supplied branch names and addresses. Separate branch-confirmed, central and ambiguous contacts with source evidence.

### Why use this workflow?

Find local contact evidence for the intended branch without treating a shared company website as proof of branch ownership. Branch confirmation requires the supplied branchName, city and street or postalCode in the same local HTML block, a single distinct email in that context, and no known sitewide/central or conflicting reused context. This is a conservative heuristic, not verified ownership. Missing evidence stays ambiguous.

### Start with the offline example

The prefilled example is fictional HTML on example.com. Click Start, then open START_HERE.md and the dataset. This makes no external website requests. The demo bills one record inspection at the base price shown below; it is not a free simulation.

```json
{
  "records": [
    {
      "id": "demo-berlin",
      "branchName": "Acme Mitte",
      "city": "Berlin",
      "street": "Teststrasse 12",
      "postalCode": "10115",
      "pages": [
        {
          "url": "https://example.com/mitte",
          "html": "<section><h2>Acme Mitte</h2><p>Teststrasse 12, 10115 Berlin. Email: mitte [at] example [dot] com</p></section><footer>Company office: info@example.com</footer>"
        }
      ]
    }
  ],
  "maxRecords": 5,
  "maxPagesPerRecord": 4,
  "maxTotalPages": 10
}
```

Replace inline pages with website when fetching a permitted public site, and enable permissionConfirmed. Keep your original id and optional knownEmails. Do not supply both website and pages. All supplied rows remain in the dataset, including skipped and unprocessed rows.

### Results and interpretation

Branch-name evidence may also come from the sole page H1, disclosed as branchName_heading. City and street/postal evidence must still occur in the local contact block. Multiple distinct five-digit postal codes in one block prevent branch confirmation. These rules favor abstaining when ownership is uncertain; they do not establish a corporate relationship independently.

Statuses: branch_confirmed, central_only, ambiguous, not_found, fetch_failed, not_processed. central_only means a footer/header/navigation or explicitly central-office context was observed; it is not an independently verified corporate hierarchy. A source can contain both local and central contacts. Use each contact attribution, not just the row status. Shared/conflicting contexts can prevent confirmation. Strict local blocks can miss genuine branch emails placed elsewhere on the page.

Each returned contact includes email, source_url, method, evidence snippet, local context, DOM path, and attribution. REPORT contains coverage and complete per-record outputs. CONTACTS.jsonl flattens contacts with input_id and record_index for downstream joins. Deduplication is per input record and case-insensitive email, retaining the strongest eligible evidence; it is not global entity deduplication. Read the inspected-prefix and evidence cap flags before treating an output as complete.

### Price and limits

Base price: $12 per 1,000 inspected input records. A record is charged once if at least one supplied/fetched HTML page was parsed, including an ambiguous or not-found outcome. Up to four page attempts are included per inspected record. Technical failures with zero parsed pages, skipped existing rows, invalid top-level input and unprocessed rows incur no record event. No run-start or automatic dataset-row fee is configured. Subscription discounts: Bronze 10%, Silver 15%, Gold/Platinum/Diamond 20%.

For example, 100 inspected records cost $1.2 in base Actor fees. No external model, proxy subscription, Maps search or email-verification API is used. Spending limits reduce the inspected prefix before work; all remaining records are disclosed as not_processed.

Maximum 50 supplied records; default 20 processed, configurable 1–50; at most 4 pages per record and 50 page attempts per run (default 20). Inline HTML maximum 500 KB/page and 2 MB serialized input overall. Fetched responses are capped at 2 MB and parsed HTML at 500 KB. HTML trees are capped at 15,000 elements. At most 100 email-evidence items per page and 50 distinct contacts per record, with cap warnings. Up to 10 JSON-LD scripts of 100,000 characters and bounded JSON traversal. Network work stops after 65 seconds or the current bounded request; timeout 120 seconds. Memory 256–512 MB.

### Access and operational boundaries

Static public HTML only. No browser rendering, login, CAPTCHA bypass, Maps discovery, mailbox validation, outreach or guessed addresses. Same-host contact discovery is bounded to one level. Robots restrictions are respected; private/reserved/mixed-DNS destinations and redirects are blocked through pinned public connections. Inline URLs are provenance labels and are not fetched. Only process data you are entitled to use.

### Troubleshooting

not_found means no eligible contact was observed within coverage, not proof none exists. fetch_failed means inspect errors or use an authorized HTML snapshot. Ambiguous branch matches require better address/page evidence, not a lower confidence threshold. Review context for repeated shared-domain contacts and inspect errors/truncation before importing. Report issues with a run ID and a small non-sensitive example, never API tokens or private customer data.

### Validation scope

The release includes20 manually labeled synthetic branch scenarios, parser/limit/network regressions, and targeted live public-site checks. Synthetic cases are not a20-business independent accuracy benchmark. No universal recall, ownership accuracy, 90+ quality score or earnings guarantee is claimed. Built with the Apify Python SDK and lxml.

### Who is this for?

Lead-data teams checking which published email belongs to a supplied local branch. Provide branch name, city and street or postal-code evidence with its website.

### Frequently asked questions

#### Does a matching website domain prove an email belongs to the branch?

No. Confirmation requires supported local branch and address evidence. Central contacts and conflicting or shared evidence remain central or ambiguous. This is heuristic attribution, not mailbox verification or independent proof of company structure.

#### How do I try it before using my full input?

Open the Input tab, review the prefilled example, and run a small batch with a spending limit. Inspect the dataset and report before increasing the batch. Examples can incur the documented inspection or analysis fee; an execution marked successful can still contain rejected records or incomplete coverage.

#### Can I use the Actor through an API or on a schedule?

Yes. Use Apify's [Actor API](https://docs.apify.com/api/v2/acts-run-sync-get-dataset-items-post) or [schedules](https://docs.apify.com/platform/schedules). Keep credentials private and use the documented input fields. The pricing and limits below apply to API runs too.

### Related tools for the next step

- [Missing Email Recovery - Obfuscated Website Emails](https://apify.com/variable_mitts/missing-email-recovery)
- [Website Contact Extractor - Emails, Phones and Source URLs](https://apify.com/variable_mitts/website-contact-evidence-extractor)

# Actor input Schema

## `records` (type: `array`):

1–50 objects. Each needs website OR pages:\[{url,html}], not both. Optional id and knownEmails. Inline pages are an offline alternative; website mode fetches public HTML. Branch mode additionally needs branchName, city, and street or postalCode.

## `permissionConfirmed` (type: `boolean`):

Required only when records use website URLs. Synthetic inline examples make no network calls.

## `maxRecords` (type: `integer`):

A spending/time/page cap may reduce coverage. Unprocessed input rows remain as uncharged not_processed diagnostics.

## `maxPagesPerRecord` (type: `integer`):

Includes homepage and at most three discovered contact/location pages. Only one discovery level and exact input host/www variant are allowed.

## `maxTotalPages` (type: `integer`):

Shared across all records; page attempts include unsuccessful requests. Robots and redirect requests are additionally bounded.

## Actor input object example

```json
{
  "records": [
    {
      "id": "demo-berlin",
      "branchName": "Acme Mitte",
      "city": "Berlin",
      "street": "Teststrasse 12",
      "postalCode": "10115",
      "pages": [
        {
          "url": "https://example.com/mitte",
          "html": "<section><h2>Acme Mitte</h2><p>Teststrasse 12, 10115 Berlin. Email: mitte [at] example [dot] com</p></section><footer>Company office: info@example.com</footer>"
        }
      ]
    }
  ],
  "permissionConfirmed": false,
  "maxRecords": 5,
  "maxPagesPerRecord": 4,
  "maxTotalPages": 10
}
```

# Actor output Schema

## `file0` (type: `string`):

No description

## `file1` (type: `string`):

No description

## `file2` (type: `string`):

No description

## `rows` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "records": [
        {
            "id": "demo-berlin",
            "branchName": "Acme Mitte",
            "city": "Berlin",
            "street": "Teststrasse 12",
            "postalCode": "10115",
            "pages": [
                {
                    "url": "https://example.com/mitte",
                    "html": "<section><h2>Acme Mitte</h2><p>Teststrasse 12, 10115 Berlin. Email: mitte [at] example [dot] com</p></section><footer>Company office: info@example.com</footer>"
                }
            ]
        }
    ],
    "maxRecords": 5,
    "maxPagesPerRecord": 4,
    "maxTotalPages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("variable_mitts/branch-contact-resolver").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "records": [{
            "id": "demo-berlin",
            "branchName": "Acme Mitte",
            "city": "Berlin",
            "street": "Teststrasse 12",
            "postalCode": "10115",
            "pages": [{
                    "url": "https://example.com/mitte",
                    "html": "<section><h2>Acme Mitte</h2><p>Teststrasse 12, 10115 Berlin. Email: mitte [at] example [dot] com</p></section><footer>Company office: info@example.com</footer>",
                }],
        }],
    "maxRecords": 5,
    "maxPagesPerRecord": 4,
    "maxTotalPages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("variable_mitts/branch-contact-resolver").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "records": [
    {
      "id": "demo-berlin",
      "branchName": "Acme Mitte",
      "city": "Berlin",
      "street": "Teststrasse 12",
      "postalCode": "10115",
      "pages": [
        {
          "url": "https://example.com/mitte",
          "html": "<section><h2>Acme Mitte</h2><p>Teststrasse 12, 10115 Berlin. Email: mitte [at] example [dot] com</p></section><footer>Company office: info@example.com</footer>"
        }
      ]
    }
  ],
  "maxRecords": 5,
  "maxPagesPerRecord": 4,
  "maxTotalPages": 10
}' |
apify call variable_mitts/branch-contact-resolver --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,variable_mitts/branch-contact-resolver"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/QqbTjmm8AfoN0hezq/builds/Wt5ri63msqwcgKw7f/openapi.json
