# Memento TimeMap Harvester (`datamule/memento-timemap-harvester`) Actor

Point at ANY Memento (RFC 7089) TimeMap and extract every archived snapshot as flat rows — memento URI, datetime (ISO 8601), rel, original URI, collection, raw link line. Works across the Internet Archive, arquivo.pt and every Memento-compliant web archive. Pay per memento.

- **URL**: https://apify.com/datamule/memento-timemap-harvester.md
- **Developed by:** [Datamule](https://apify.com/datamule) (community)
- **Categories:** Developer tools
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 memento parseds

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

## Memento TimeMap Harvester

Point at **any Memento (RFC 7089) TimeMap** and get every archived snapshot of a URL as clean, flat rows — across the Internet Archive, arquivo.pt, and every Memento-compliant web archive worldwide.

**Memento** is the time-travel-for-the-web standard. A **TimeMap** is a machine-readable `application/link-format` list of every archived snapshot (a **memento**) of a URL. Unlike a Wayback-only tool, this actor speaks the *cross-archive* Memento standard, so **one actor works against archives all over the world** — you just supply the TimeMap URL.

### What you get

One dataset row per memento, with these columns:

| Field | Description |
|---|---|
| `memento_uri` | URL of the archived snapshot |
| `datetime` | Capture time, parsed to ISO 8601 (`2014-10-09T10:19:54+00:00`) |
| `datetime_raw` | The original RFC 1123 datetime string (lossless) |
| `rel` | The link relation verbatim (`memento`, `first memento`, `last memento`) |
| `type` | Content type param, when the archive supplies one |
| `collection` | Archive collection tag, when present (e.g. arquivo.pt's `$root`) |
| `original_uri` | The original (live-web) URL, from the TimeMap's `rel="original"` link |
| `timemap_self` | The canonical TimeMap URL, from the `rel="self"` link |
| `timemap_from` / `timemap_until` | The archival span of the URL (ISO 8601), when the archive reports it |
| `source_timemap` | The TimeMap URL you supplied |
| `_raw` | The raw link-format line for this memento (lossless) |

### Input

```json
{
  "timemapUrls": [
    "https://web.archive.org/web/timemap/link/https://www.example.com",
    "https://arquivo.pt/wayback/timemap/link/https://www.example.com/"
  ],
  "maxMementosPerSource": 50
}
```

- **`timemapUrls`** (required) — one or more full TimeMap endpoint URLs. The target URL is embedded in the path. Examples of TimeMap endpoints:
  - Internet Archive — `https://web.archive.org/web/timemap/link/<URL>`
  - arquivo.pt (Portugal) — `https://arquivo.pt/wayback/timemap/link/<URL>`
  - Icelandic web archive — `https://vefsafn.is/timemap/link/<URL>`
  - …and any other Memento-compliant archive.
- **`maxMementosPerSource`** (optional) — cap the number of mementos emitted per TimeMap. A busy URL on the Internet Archive can have hundreds of thousands of snapshots; this keeps a run small and cheap. Leave empty to emit them all.
- **`userAgent`** (optional) — override the request User-Agent.

### Why this is not a naive comma-splitter

The `application/link-format` grammar (RFC 6690 / RFC 8288) is deceptively tricky: every memento's `datetime` is an RFC 1123 date that **contains commas** (`"Thu, 09 Oct 2014 10:19:54 GMT"`), and rels can be multi-token (`rel="first memento"`). This actor uses a proper quote- and angle-bracket-aware tokenizer, so links are split only on true top-level commas, multi-token rels are handled, and archive-specific params (`collection`, `from`, `until`) are all captured.

### How it behaves

- A URL an archive has never captured → **0 rows, clean success** (never fabricated).
- A source that returns HTML / a 404 / anything that is not a TimeMap → skipped with a warning; the rest of the batch continues. A run where *every* source fails that way fails loudly.
- Public archives serve TimeMaps anonymously — no credentials needed.

### Pricing

Pay-per-event: you are charged once per **memento** row returned. A run that returns nothing costs nothing.

### Common uses

- Web archiving / digital preservation research and QA.
- Building a capture timeline for a URL across multiple archives.
- Link-rot and reference-persistence studies (scholarly citation, journalism).
- Competitive / brand monitoring over historical snapshots.

# Actor input Schema

## `timemapUrls` (type: `array`):

One or more Memento (RFC 7089) TimeMap URLs — each a machine-readable application/link-format list of every archived snapshot (memento) of a URL, served by ANY Memento-compliant web archive. Supply the FULL TimeMap endpoint (the target URL is embedded in the path). Examples: https://web.archive.org/web/timemap/link/https://www.example.com (Internet Archive), https://arquivo.pt/wayback/timemap/link/https://www.example.com/ (arquivo.pt / Portugal), https://vefsafn.is/timemap/link/https://www.example.com/ (Iceland). One actor works against every Memento-compliant archive worldwide.

## `maxMementosPerSource` (type: `integer`):

Optional cap on the number of memento rows emitted per TimeMap (each emitted memento is one billable event). A busy URL on the Internet Archive can have hundreds of thousands of snapshots — set this to keep the run small and cheap. Leave empty to emit every memento in each TimeMap. NOTE: the full TimeMap is still downloaded to parse it; the cap limits rows/billing, not the fetch size.

## `userAgent` (type: `string`):

Optional User-Agent header override for the TimeMap requests. Public archives serve TimeMaps anonymously; a descriptive default is used if this is left empty.

## Actor input object example

```json
{
  "timemapUrls": [
    "https://web.archive.org/web/timemap/link/https://www.example.com"
  ],
  "maxMementosPerSource": 50
}
```

# Actor output Schema

## `results` (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 = {
    "timemapUrls": [
        "https://web.archive.org/web/timemap/link/https://www.example.com"
    ],
    "maxMementosPerSource": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamule/memento-timemap-harvester").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 = {
    "timemapUrls": ["https://web.archive.org/web/timemap/link/https://www.example.com"],
    "maxMementosPerSource": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("datamule/memento-timemap-harvester").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 '{
  "timemapUrls": [
    "https://web.archive.org/web/timemap/link/https://www.example.com"
  ],
  "maxMementosPerSource": 50
}' |
apify call datamule/memento-timemap-harvester --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datamule/memento-timemap-harvester"
        }
    }
}

```

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/phcfVdYFtZ8ox9ioy/builds/cdkYZlgNh7EdItZvn/openapi.json
