# Legacy Obituaries Extractor (`kawsar/legacy-obituaries-extractor`) Actor

Legacy.com obituary scraper that looks up death notices by name and returns full name, age, birth and death dates, funeral home, location, and a link to each obituary, ready to export.

- **URL**: https://apify.com/kawsar/legacy-obituaries-extractor.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Legacy Obituaries Extractor

Search Legacy.com for obituaries and death notices by name and get the results back as clean, structured data. Type a person's name, run the actor, and collect every matching record ready for a spreadsheet, database, or your own application.

Legacy.com is one of the largest obituary networks online, carrying death notices from thousands of local newspapers and funeral homes across the United States and beyond. This actor turns that search into an export you can actually work with.

### What it does

Give the actor one name or a list of names. For each name it searches the Legacy.com obituary index, pages through the matches, and returns a structured record for every person it finds, including:

- The person's full name, and first and last name
- Age at death, plus birth and death dates
- The biography or death notice summary text
- The funeral home or newspaper that published the notice, with a link
- The city and country associated with the person
- A photo when one is available
- A direct link to the full obituary page on Legacy.com

You control how many records come back with a single limit, and the actor stops paging as soon as it reaches that number.

### Features

- **Search by name.** Full names, partial names, first name only, or surname only all work.
- **Batch mode.** Pass a list of names and process them all in one run. Results are combined into a single dataset.
- **Automatic pagination.** The actor walks through result pages until it hits your item limit, so you are not capped at the first page.
- **Duplicate protection.** The same person is never written twice, even when they appear across pages or overlapping searches.
- **Clean, typed output.** Every record has the same shape. Missing values come back as `null` rather than being dropped, so downstream parsing stays simple.
- **Empty searches are handled.** A name with no matches writes no rows and logs a clear message instead of returning junk.
- **Export anywhere.** Results download as JSON, CSV, Excel, or HTML, or pull them straight from the Apify API.

### Use cases

- **Genealogy and family history.** Trace relatives, confirm death dates, and gather source records for a family tree.
- **Memorial and tribute sites.** Pull structured obituary data to seed or enrich a remembrance platform.
- **Research and journalism.** Verify names, ages, and dates against a public record, or study patterns across many notices.
- **Funeral and cemetery services.** Cross reference published notices and keep records aligned.
- **Data and archival projects.** Build a searchable obituary archive from a list of names.

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes\* | The name to search for, for example `Harry Potter`. |
| `queries` | array of strings | No | Extra names to search in the same run, each looked up separately. |
| `maxItems` | integer | No | Maximum records to collect across all searches. Default `100`, maximum `1000`. |
| `requestTimeoutSecs` | integer | No | Per request timeout in seconds. Default `30`. |

\* Provide a name in `query`, in `queries`, or both. At least one name is required.

#### Example input

```json
{
    "query": "Harry Potter",
    "queries": ["John Smith", "Mary Johnson"],
    "maxItems": 100
}
```

### Output

Each obituary is one item in the dataset. Fields that a listing does not include are returned as `null`, so every row has the same structure.

#### Output fields

| Field | Type | Description |
| --- | --- | --- |
| `fullName` | string | The person's full name as published. |
| `firstName` | string / null | Given name, taken from the full name when not supplied separately. |
| `lastName` | string / null | Surname, taken from the full name when not supplied separately. |
| `age` | integer / null | Age at death, when available. |
| `birthDate` | string / null | Date of birth in `YYYY-MM-DD` format. |
| `deathDate` | string / null | Date of death in `YYYY-MM-DD` format. |
| `bio` | string / null | The obituary or death notice summary text. |
| `photo` | string / null | URL of the person's photo, when one is published. |
| `personId` | string / null | Legacy.com identifier for the person. |
| `personUrl` | string / null | Direct link to the full obituary page. |
| `funeralHome` | string / null | Funeral home or newspaper that published the notice. |
| `funeralHomeUrl` | string / null | Link to the publisher's version of the notice. |
| `publishedDate` | string / null | Date the notice was first posted. |
| `obituaryCount` | integer / null | Number of notices on record for this person. |
| `locality` | string / null | City or town associated with the person. |
| `country` | string / null | Country associated with the person. |
| `locationCount` | integer / null | Number of locations linked to the person. |
| `searchQuery` | string | The name you searched that produced this record. |
| `scrapedAt` | string | UTC timestamp of when the record was collected. |

#### Example output

```json
{
    "fullName": "Harold David Potter",
    "firstName": "Harold",
    "lastName": "Potter",
    "age": 82,
    "birthDate": "1944-02-26",
    "deathDate": "2026-05-06",
    "bio": "Harold David Potter passed away on Wednesday, May 6, 2026. The family is being cared for by Mynatt Funeral Home, Inc. - Powell Chapel.",
    "photo": null,
    "personId": "61322071",
    "personUrl": "https://www.legacy.com/person/harold-david-potter-61322071",
    "funeralHome": "Mynatt Funeral Home, Inc. - Powell Chapel",
    "funeralHomeUrl": "https://www.mynattfh.com/obituaries/harold-potter",
    "publishedDate": "2026-05-06",
    "obituaryCount": 1,
    "locality": "Powell",
    "country": "United States",
    "locationCount": 3,
    "searchQuery": "Harry Potter",
    "scrapedAt": "2026-08-29T12:00:00+00:00"
}
```

### How to use

#### On the Apify platform

1. Open the actor and go to the input tab.
2. Enter a name in the **Name to search** field, or add several under **Additional names**.
3. Set **Max items** if you want more or fewer than 100 records.
4. Click **Start** and download the dataset from the **Storage** tab when the run finishes.

### Tips

- **Common names return many matches.** A name like `John Smith` can fill the dataset quickly. Use `maxItems` to keep runs focused, or search more specific full names.
- **Search broad, then filter.** Pull a wide set of records and filter by `deathDate`, `locality`, or `funeralHome` in your spreadsheet or code afterward.
- **Batch related names together.** Put every name you are researching in `queries` so a single run covers the whole list.

### FAQ

**Which names can I search?**
Any full or partial name. First name only, surname only, and full name all return matches from the index.

**How many results can I get per run?**
Up to 1000 records, set with `maxItems`. The actor pages through results automatically to reach the number you ask for.

**Why are some fields null?**
Not every notice lists an age, photo, or exact dates. When a value is not published, the field comes back as `null` so the record shape stays consistent.

**What happens if a name has no obituaries?**
The actor writes no rows for that name and logs a message noting the empty search. Your dataset only ever contains real records.

**In what formats can I export the data?**
JSON, CSV, Excel, and HTML, plus direct access through the Apify API and client libraries.

### Notes and disclaimer

Records come from the public Legacy.com search index and reflect what is published there at the time of the run. Obituary content belongs to the families, funeral homes, and publishers who posted it. Use this actor responsibly and in line with Legacy.com's terms and applicable laws, and treat the data with the sensitivity the subject deserves.

# Actor input Schema

## `query` (type: `string`):

Full or partial name of the person to look up in the obituary index.

## `queries` (type: `array`):

Search several names in one run. Each entry is looked up separately and results are combined.

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

Maximum number of obituary records to collect across all searches.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## Actor input object example

```json
{
  "query": "Harry Potter",
  "queries": [],
  "maxItems": 100,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

## `properties` (type: `string`):

Extract obituaries and death notices from Legacy.com search results, including full name, age, birth and death dates, biography, funeral home, location, and photo.

# 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 = {
    "query": "Harry Potter"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/legacy-obituaries-extractor").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 = { "query": "Harry Potter" }

# Run the Actor and wait for it to finish
run = client.actor("kawsar/legacy-obituaries-extractor").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 '{
  "query": "Harry Potter"
}' |
apify call kawsar/legacy-obituaries-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/legacy-obituaries-extractor"
        }
    }
}

```

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/da82HpIODNKaNlsPF/builds/NNtOzqpcqZVjp9ppw/openapi.json
