On this page
Where a targeted API mailing list comes from
| Source | Who it reaches | Where the addresses come from |
|---|---|---|
| Your own customers | Past buyers, lapsed customers, members | Your database, CRM or a spreadsheet export |
| Public records | New owners, people building or remodeling | County recorder sales and city permits, with the owner’s mailing address from the assessor (public records guide) |
| Bought consumer lists | Homeowners or absentee owners in an area | Exports from DataZapp or PropStream |
| Business lists | Companies, or people by role | Data Axle, Apollo, ZoomInfo or a Clay table |
| Neighbors of a job | The street around work you just finished | An owner list for that street, as roofers use after a new roof, or an agent’s farm for just sold postcards |
Your own customers are the list you already have and the one that knows you. If some of them gave you only an email, an email to address lookup can match part of them to mailing addresses. The others reach people who don’t know you yet, so the card has to say who you are and why you’re writing. Running the mailing itself, with a group held out to measure it, is in direct mail campaign.
How to narrow a list before an API mailing
A list from any source is wider than the people you want. Each of these is a line of code before the send: What to send once the list is ready is in direct mail examples.
- Recency: customers whose last order or visit was more than 60 days ago.
- Place: the ZIP codes or the distance you actually serve.
- Ownership or property: homeowners, absentee owners, a recent pool permit. Owner lists carry this; your own data may not.
- Exclusions: anyone mailed in the last 30 days, anyone who asked not to get mail, and existing customers on a prospect list.
New movers and new homeowners on an API mailing list
People who just moved are worth mailing, but one tool is off limits for finding them. NCOA updates the records already on your list, and the USPS form every list owner signs says NCOALink may not be used to create or maintain new movers’ lists. For new owners in your area, use the county’s recorded sales, which name each buyer, or ask your list provider what it offers. Use NCOA for what it’s for: keeping your own list current. The whole job, from recorded sales to a welcome card, is in new homeowner mailing list.
Clean the list, then send it by API
- One card per household. Combine the sources and dedupe on a normalized address.
- Update old lists for moves. Anything not updated in the last 95 days goes through NCOA first.
- Check every address. Add
"verify": true, or sort the list first with the address check, as in CASS address verification. - Keep a record of what you mailed, so next month’s run skips this month’s households.
This script does all four for two sources, your customers and an owner list, and mails what’s left as 6x9 postcards:
# Combine two sources, keep one card per household, skip anyone mailed in the last 30 days, then send.
# customers.csv and owners.csv: name, first_name, line1, line2, city, state, zip (owners.csv from your list provider)
# mailed.csv: key, date of every address you've mailed before (this script appends to it)
import csv, datetime, os, re, requests
SERVE = {"85201", "85203", "85204", "85210"} # ZIP codes you serve
today = datetime.date.today()
def key(r): # one key per household: street line plus ZIP, normalized
return re.sub(r"[^a-z0-9]", "", f"{r['line1']}{r.get('line2') or ''}".lower()) + r["zip"][:5]
recent = set()
if os.path.exists("mailed.csv"):
with open("mailed.csv", newline="") as f:
recent = {k for k, d in csv.reader(f) if (today - datetime.date.fromisoformat(d)).days < 30}
seen, rows = set(), []
for path in ["customers.csv", "owners.csv"]:
with open(path, newline="") as f:
for r in csv.DictReader(f):
k = key(r)
if r["zip"][:5] in SERVE and k not in seen and k not in recent:
seen.add(k)
rows.append(r)
print(len(rows), "households to mail")
for n, start in enumerate(range(0, len(rows), 1000)):
chunk = rows[start:start + 1000]
resp = requests.post(
"https://api.mailr.dev/v1/batches",
headers={"Authorization": f"Bearer {os.environ['MAILR_API_KEY']}",
"Idempotency-Key": f"spring-target-{today.isoformat()}-{n}"},
json={"kind": "postcard", "size": "6x9", "verify": True,
"front": open("mail/front.html").read(), "back": open("mail/back.html").read(),
"recipients": [{"to": {"name": r["name"][:40], "line1": r["line1"], "line2": r["line2"] or None,
"city": r["city"], "state": r["state"], "zip": r["zip"]},
"merge": {"first_name": (r["first_name"] or "Neighbor")[:14]}} for r in chunk]},
timeout=60,
)
resp.raise_for_status()
with open("mailed.csv", "a", newline="") as f:
csv.writer(f).writerows([key(r), today.isoformat()] for r in chunk)
print(resp.json()["id"], resp.json()["count"], resp.json()["price"])mlr_test_ key the batches are checked, priced and proofed, and nothing prints or charges.Targeted API mail or Every Door Direct Mail
Every Door Direct Mail skips the list: USPS delivers to every address on the carrier routes you pick, with no names, for less postage per piece. It suits an announcement every household should see. Targeted mail suits everything else: a certain kind of customer, a few streets, a name on the piece. The two are compared side by side in how to mail flyers to a neighborhood. Once the list is set, postcard marketing covers the card itself. USPS’s own options are laid out in USPS direct mail.
Targeted direct mail questions from API senders
What is targeted direct mail?
Mail sent only to the people a list picks, by name and address, instead of to every address in an area. The opposite is Every Door Direct Mail, which reaches every address on a carrier route without names.
Does Mailr sell mailing lists?
No. Mailr mails the addresses you send. Lists come from your own data, public records, or a provider you choose, such as DataZapp, PropStream, Data Axle, Apollo or ZoomInfo.
How do I mail people who just moved into my area?
Use the county's recorded sales, which show each new owner, or ask your list provider what it offers. NCOA can't do it: the USPS form every list owner signs says NCOALink may not be used to create or maintain new movers' lists.
How do I keep from mailing the same household twice?
Dedupe on a normalized address before you send, and keep a record of what you've mailed so the next run skips it. An Idempotency-Key on each batch also stops a retried request from mailing twice.
What does a targeted mailing cost?
The list, from whoever sells it, plus the mail: a 6x9 postcard is $0.89 on pay as you go, printing and postage included, and an address check is 7¢ more if you add "verify": true.