# Updated Content Checker (`tomas.gabik/updated-content-checker`) Actor

Monitors sitemaps for new/updated content. Returns only URLs modified since a specified date for efficient incremental scraping.

- **URL**: https://apify.com/tomas.gabik/updated-content-checker.md
- **Developed by:** [Tomáš Gabík](https://apify.com/tomas.gabik) (community)
- **Categories:** Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 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?

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

## Updated Content Checker

Apify Actor that monitors sitemaps for new/updated content. Returns only URLs modified since a specified date, enabling efficient incremental scraping with tools like Website Content Crawler (WCC).

### Features

- Parses regular sitemaps and sitemap indexes
- **Relative date filter**: "7 days", "2 weeks", "1 month", "24 hours"
- **Absolute date filter**: ISO 8601 dates like "2026-01-15"
- Optional regex pattern filtering for URLs
- Persists last check timestamp for automatic incremental checks

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `sitemapUrl` | string | Yes | URL of the sitemap.xml file |
| `newerThan` | string | No | Relative filter: "7 days", "2 weeks", "1 month", "24 hours" |
| `newerThanDate` | string | No | Absolute date filter (ISO 8601) |
| `urlPattern` | string | No | Regex pattern to filter URLs |
| `storeLastCheck` | boolean | No | Store timestamp for future runs (default: false) |
| `storeName` | string | No | Key-value store name for persistence |

**Priority**: `newerThan` > `newerThanDate` > stored date

### Output

#### Dataset

```json
{
    "url": "https://example.com/article",
    "lastModified": "2026-01-20T15:59:22Z"
}
```

#### OUTPUT (Summary)

```json
{
    "sitemapUrl": "https://example.com/sitemap.xml",
    "totalUrlsInSitemap": 500,
    "filteredUrlCount": 500,
    "updatedUrlCount": 10,
    "cutoffDate": "2026-01-13T00:00:00Z",
    "cutoffSource": "relative time: 7 days",
    "checkedAt": "2026-01-20T16:00:00Z"
}
```

### Usage Examples

#### Get URLs updated in the last 7 days

```json
{
    "sitemapUrl": "https://help.wealthsimple.com/hc/sitemap.xml",
    "newerThan": "7 days"
}
```

#### Get URLs updated since a specific date

```json
{
    "sitemapUrl": "https://help.wealthsimple.com/hc/sitemap.xml",
    "newerThanDate": "2026-01-15"
}
```

#### Filter only English articles

```json
{
    "sitemapUrl": "https://help.wealthsimple.com/hc/sitemap.xml",
    "newerThan": "7 days",
    "urlPattern": "/en-ca/articles/"
}
```

### Integration with Website Content Crawler

Use the output dataset as input for WCC to scrape only updated pages:

1. Run this Actor to get updated URLs
2. Pass the dataset URLs to Website Content Crawler
3. Only changed content gets scraped

# Actor input Schema

## `sitemapUrl` (type: `string`):

URL of the sitemap.xml file to check for updates

## `newerThan` (type: `string`):

Relative time filter. Examples: '7 days', '2 weeks', '1 month', '24 hours'. Only URLs modified within this period will be returned.

## `newerThanDate` (type: `string`):

Absolute date filter (ISO 8601 format, e.g., '2026-01-15'). Only URLs modified after this date will be returned.

## `urlPattern` (type: `string`):

Optional regex pattern to filter URLs. Only matching URLs will be included.

## `storeLastCheck` (type: `boolean`):

If enabled, stores the current timestamp for use in subsequent runs (uses named key-value store)

## `storeName` (type: `string`):

Name of the key-value store to persist the last check date. Used when 'Store Last Check Date' is enabled.

## Actor input object example

```json
{
  "sitemapUrl": "https://blog.apify.com/sitemap.xml",
  "newerThan": "",
  "newerThanDate": "",
  "urlPattern": "",
  "storeLastCheck": false,
  "storeName": "updated-content-checker-state"
}
```

# 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 = {
    "sitemapUrl": "https://blog.apify.com/sitemap.xml",
    "newerThan": "",
    "newerThanDate": "",
    "urlPattern": "",
    "storeName": "updated-content-checker-state"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tomas.gabik/updated-content-checker").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 = {
    "sitemapUrl": "https://blog.apify.com/sitemap.xml",
    "newerThan": "",
    "newerThanDate": "",
    "urlPattern": "",
    "storeName": "updated-content-checker-state",
}

# Run the Actor and wait for it to finish
run = client.actor("tomas.gabik/updated-content-checker").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 '{
  "sitemapUrl": "https://blog.apify.com/sitemap.xml",
  "newerThan": "",
  "newerThanDate": "",
  "urlPattern": "",
  "storeName": "updated-content-checker-state"
}' |
apify call tomas.gabik/updated-content-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tomas.gabik/updated-content-checker"
        }
    }
}
```

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/8blxA0uDJCQWLiXT4/builds/l5k40na7xvBcrJ7EO/openapi.json
