# Audience Match Keys: Email to SHA256 and MAID (`moltsets/audience-match-keys`) Actor

Turn emails and LinkedIn URLs into hashed emails and mobile advertising IDs for customer match audiences. Bring your own MoltSets API key; you only pay MoltSets for matches.

- **URL**: https://apify.com/moltsets/audience-match-keys.md
- **Developed by:** [MoltSets](https://apify.com/moltsets) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Audience Match Keys: email to SHA256 and MAID for ad audiences

Turn a contact list into match keys for customer match and custom audiences on Meta, Google, LinkedIn, TikTok and programmatic platforms. From an email you get the SHA256 of the person's personal email and a mobile advertising ID (AAID or IDFA); from a LinkedIn URL you get SHA256 and MD5 hashes of their business and personal emails. Every input email is also hashed locally for free. Powered by [MoltSets](https://moltsets.com).

- **Reach business contacts on personal devices**: a business email becomes the SHA256 of the same person's personal email, the address their ad accounts are usually tied to.
- **Mobile advertising IDs**: Android AAIDs and Apple IDFAs for mobile retargeting and programmatic audiences.
- **LinkedIn to hashes**: business and personal email hashes in SHA256 and MD5 from a profile URL.
- **Free input hashes**: every input email is trimmed, lowercased and hashed (SHA256 and MD5) by the Actor itself, at no cost and on every plan.
- **No raw personal emails**: personal addresses only ever come back hashed.
- **Mixed lists**: emails and LinkedIn URLs can sit in the same list or dataset.

### Bring your own MoltSets API key

This Actor calls the [MoltSets API](https://developer.moltsets.com) with your own key, so MoltSets data is billed to your MoltSets account and Apify only charges for compute (the Actor itself is free).

1. [Create a free MoltSets account](https://app.moltsets.com/signup?utm_source=apify\&utm_medium=actor\&utm_campaign=audience-match-keys).
2. Copy a key from [API keys](https://app.moltsets.com/dashboard/api_keys). Keys start with `ms_`.
3. Paste it into the **MoltSets API key** field. Apify stores it encrypted and the Actor never logs it.

### What it costs

**You only pay for hits.** A lookup that finds nothing costs no tokens. It still counts towards your MoltSets Fair Use request limits.

| Lookup | MoltSets tool | Cost |
| :--- | :--- | :--- |
| Email to personal email SHA256 | `business_email_to_sha256` | 1 token per hash found |
| Email to MAID | `email_to_maid` | 1 token per MAID found |
| LinkedIn to SHA256 and MD5 | `linkedin_to_sha256` | 1 token per profile with hashes |
| Input email SHA256 and MD5 (computed by the Actor) | None | Free |

Costs are read live from your account (`get_billing`) at the start of every run, and the log shows a worst-case estimate before any lookups are made. If your balance is lower than the worst case the run still starts, because misses are free; if tokens run out it stops gracefully and keeps everything found so far.

Token costs are the published MoltSets rates at the time of writing. Lookups that find nothing cost nothing.

**Plan availability:** according to the MoltSets API docs, these three tools are not available on the $397 and $997 monthly plans. On those plans every lookup comes back `restricted` (never charged) and only the free input hashes are filled. See [pricing](https://moltsets.com/pricing) or contact support@moltsets.com.

### Input

| Field | Name | Default | Description |
| :--- | :--- | :--- | :--- |
| `apiKey` | MoltSets API key |  | Required. Your MoltSets API key (starts with `ms_`). No account yet? [Sign up free](https://app.moltsets.com/signup?utm_source=apify\&utm_medium=actor\&utm_campaign=audience-match-keys), then copy a key from [API keys](https://app.moltsets.com/dashboard/api_keys). MoltSets bills your MoltSets account directly, and only for hits. |
| `lookups` | Emails or LinkedIn URLs |  | One per line: an email address (`jane@acme.com`) or a LinkedIn profile URL (`https://www.linkedin.com/in/...`). Duplicates are removed before any lookup. |
| `datasetId` | Read from a dataset |  | Use the results of another run, for example a lead list or CRM export. Rows with an email are looked up by email; rows without one by LinkedIn URL. Combined with any lines above. |
| `emailField` | Email column |  | Leave empty to try email, Email, emailAddress, email_address, workEmail, businessEmail and contactEmail. |
| `linkedinField` | LinkedIn URL column |  | Used for rows without an email. Leave empty to try linkedinUrl, linkedInUrl, profileUrl, linkedin_url, linkedinProfileUrl, url and publicIdentifier. |
| `hashedEmails` | Hashed emails | `true` | Emails: the SHA256 of the person's personal email, from their business email. LinkedIn URLs: SHA256 and MD5 of their business and personal emails. |
| `mobileAdIds` | Mobile ad IDs | `true` | Emails only: a mobile advertising ID (Android AAID or Apple IDFA) for the person's phone. |
| `maxItems` | Maximum lookups | `100` | Hard cap on unique lookups processed in this run. |
| `maxRetryWaitSecs` | Longest Fair Use wait | `120` | If MoltSets asks the run to wait for a Fair Use window up to this long, it waits and carries on. Longer waits stop the run gracefully and keep the results so far. |

Example input:

```json
{
    "apiKey": "ms_XXXXXXXXXXX",
    "lookups": [
        "john.smith@example.com",
        "https://www.linkedin.com/in/john-smith-123"
    ],
    "hashedEmails": true,
    "mobileAdIds": true,
    "maxItems": 100
}
```

### Output

One row per input item, in input order. Each lookup has a `<lookup>_status` column:

| Status | Meaning |
| :--- | :--- |
| `found` | Data returned (and charged). |
| `not_found` | Nothing on file. Free. |
| `restricted` | Not included in your MoltSets plan. Nothing charged. See `notes`. |
| `skipped` | Not attempted: invalid input, out of phone tokens, or the run stopped early. See `notes`. |
| `error` | MoltSets could not complete the lookup after retries. Free; worth running again. |

Example row:

```json
{
    "input": "john.smith@example.com",
    "input_type": "email",
    "input_email": "john.smith@example.com",
    "input_linkedin_url": null,
    "input_email_sha256": "8e621e3d0368631d263d07a351fa8d34fba0d17c15fbcdec11a5f58008d022a0",
    "input_email_md5": "1bc5edb4799fd8eec67c66122f47eb73",
    "input_status": "valid",
    "hashes_status": "found",
    "sha256_personal": "e187e84b06e1e6577bcebe42d3905434ddc89d2d5abaab8e85691882310XXXXX",
    "md5_personal": null,
    "sha256_business": null,
    "md5_business": null,
    "maid_status": "found",
    "maid": "b8c747bb-96c5-453f-b770-9d64889XXXXX",
    "maid_type": "AAID",
    "maids_other": null,
    "notes": null
}
```

- **Which columns fill depends on the input.** Emails fill `sha256_personal` and the MAID columns. LinkedIn URLs fill all four hash columns and skip the MAID lookup (there is no LinkedIn to MAID tool).
- **`input_email_sha256`** is the hash ad platforms expect for the email you supplied: trimmed, lowercased, SHA256. Upload it alongside `sha256_personal` for the best match rate.
- **One of each**: MoltSets returns one SHA256 and one MAID per person. For multiple hashes or MAIDs per person, MoltSets sells larger data sets through its [data team](https://moltsets.com/data-sales/).

A run summary (hits and misses per lookup, tokens used, skipped lookups and why, stop reason) is saved as `SUMMARY` in the run's key-value store and shown in the run's status message.

### Chaining from a scraper

Point the Actor at a lead list or CRM export. In the Console, choose it under **Read from a dataset**; common column names such as `email`, `workEmail` and `linkedinUrl` are detected automatically. The [B2B Lead List Builder](https://apify.com/moltsets/lead-list-builder) is a good source of business emails to start from.

From code, with the [Apify API client](https://docs.apify.com/api/client/js/):

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

const apify = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await apify.actor('moltsets/audience-match-keys').call({
    apiKey: process.env.MOLTSETS_API_KEY,
    datasetId: '<dataset with an email column>',
    maxItems: 1000,
});

const { items } = await apify.dataset(run.defaultDatasetId).listItems();
```

To run it automatically after another Actor, add an [integration](https://docs.apify.com/platform/integrations/actors) on that Actor that starts this one with `{"datasetId": "{{resource.defaultDatasetId}}"}` plus your key.

### Limits

- **Plan-restricted tools**: see Plan availability above. Restricted lookups are marked `restricted` and never charged.
- **Fair Use**: MoltSets limits enrichment records and requests per rolling 5-hour and 1-week window, by plan. Every lookup counts as a request, hit or miss. If MoltSets asks the run to wait less than **Longest Fair Use wait** (default 120 seconds) it waits and continues; otherwise it stops gracefully, keeps its results and says when the window resets. See the [Fair Use Policy](https://moltsets.com/fair-use-policy-enrichment/).
- **Out of tokens**: the run stops, keeps everything processed so far and links to billing. Unprocessed rows are marked `skipped`.
- **Maximum lookups** caps unique lookups per run (default 100), so a large dataset cannot spend more than you intended.

### Other MoltSets Actors

- LinkedIn Email and Phone Finder (coming soon): business and personal emails, mobile phones and hashes from LinkedIn URLs.
- Email Finder by Name and Company (coming soon): business emails from a name and company domain.
- Reverse Email Lookup (coming soon): the person and LinkedIn profile behind an email address.
- IP to Company Lookup (coming soon): the company behind an IPv4 address.
- LinkedIn Profile Enricher (coming soon): full profile, emails and company firmographics from LinkedIn URLs.
- B2B Lead List Builder (coming soon): lead lists of people or companies by title, industry, location and size.
- LinkedIn Profile Finder (coming soon): LinkedIn profile URLs from an email or a name and company.

### Support

- MoltSets API docs: [developer.moltsets.com](https://developer.moltsets.com)
- Account, billing and plan questions: support@moltsets.com
- Bugs in this Actor: open an issue on the **Issues** tab.

# Actor input Schema

## `apiKey` (type: `string`):

Required. Your MoltSets API key (starts with <code>ms\_</code>). No account yet? <a href="https://app.moltsets.com/signup?utm_source=apify&utm_medium=actor&utm_campaign=audience-match-keys" target="_blank">Sign up free</a>, then copy a key from <a href="https://app.moltsets.com/dashboard/api_keys" target="_blank">API keys</a>. MoltSets bills your MoltSets account directly, and only for hits.

## `lookups` (type: `array`):

One per line: an email address (<code>jane@acme.com</code>) or a LinkedIn profile URL (<code>https://www.linkedin.com/in/...</code>). Duplicates are removed before any lookup.

## `datasetId` (type: `string`):

Use the results of another run, for example a lead list or CRM export. Rows with an email are looked up by email; rows without one by LinkedIn URL. Combined with any lines above.

## `emailField` (type: `string`):

Leave empty to try email, Email, emailAddress, email_address, workEmail, businessEmail and contactEmail.

## `linkedinField` (type: `string`):

Used for rows without an email. Leave empty to try linkedinUrl, linkedInUrl, profileUrl, linkedin_url, linkedinProfileUrl, url and publicIdentifier.

## `hashedEmails` (type: `boolean`):

Emails: the SHA256 of the person's personal email, from their business email. LinkedIn URLs: SHA256 and MD5 of their business and personal emails.

## `mobileAdIds` (type: `boolean`):

Emails only: a mobile advertising ID (Android AAID or Apple IDFA) for the person's phone.

## `maxItems` (type: `integer`):

Hard cap on unique lookups processed in this run.

## `maxRetryWaitSecs` (type: `integer`):

If MoltSets asks the run to wait for a Fair Use window up to this long, it waits and carries on. Longer waits stop the run gracefully and keep the results so far.

## Actor input object example

```json
{
  "lookups": [
    "https://www.linkedin.com/in/retentionadam"
  ],
  "hashedEmails": true,
  "mobileAdIds": true,
  "maxItems": 100,
  "maxRetryWaitSecs": 120
}
```

# Actor output Schema

## `results` (type: `string`):

One row per input email or LinkedIn URL.

## `summary` (type: `string`):

Counts, tokens used, skipped lookups and stop reason.

# 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 = {
    "lookups": [
        "https://www.linkedin.com/in/retentionadam"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("moltsets/audience-match-keys").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 = { "lookups": ["https://www.linkedin.com/in/retentionadam"] }

# Run the Actor and wait for it to finish
run = client.actor("moltsets/audience-match-keys").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 '{
  "lookups": [
    "https://www.linkedin.com/in/retentionadam"
  ]
}' |
apify call moltsets/audience-match-keys --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moltsets/audience-match-keys"
        }
    }
}
```

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/JahRhPCtS0DANEW5v/builds/MNltqTNdKJFnokLi6/openapi.json
