# News sitemap scraper: article titles and dates

**Use case:** 

Reads a news sitemap index and saves the articles of the last two days with their headline, publication name, language and publication date.

## Input

```json
{
  "startUrls": [
    {
      "url": "https://www.bbc.com/sitemaps/https-index-com-news.xml"
    }
  ],
  "maxUrls": 500,
  "modifiedSince": "2 days",
  "keepUrlsWithoutLastmod": false,
  "onlyNewUrls": false,
  "checkStatus": false,
  "maxConcurrency": 5,
  "includeImagesVideosNews": true,
  "respectRobotsTxt": true,
  "maxSitemapsPerSite": 1000
}
```

## Output

```json
{
  "url": {
    "label": "URL",
    "format": "link"
  },
  "images": {
    "label": "Images",
    "format": "array"
  },
  "videos": {
    "label": "Videos",
    "format": "array"
  },
  "news": {
    "label": "News",
    "format": "object"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Sitemap Extractor: All URLs from sitemap.xml, robots.txt & .gz Actor is ready to run with the inputs already set for "News sitemap scraper: article titles and dates". [Sign up or log in](https://console.apify.com/create-task-from-example/IBPFU7FsnjesM6ZMO) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "News sitemap scraper: article titles and dates" task

The Sitemap Extractor: All URLs from sitemap.xml, robots.txt & .gz Actor will start running based on the input automatically. You can also change all the input fields, like websites or sitemap urls, max urls, and more, to match your specific use case.

### 3. Receive the "News sitemap scraper: article titles and dates" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as URL, images, videos, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "News sitemap scraper: article titles and dates" task via API](https://apify.com/makerio/sitemap-extractor.md).

## FAQ

### What does the news sitemap task return?

One row per URL from the sitemaps: lastmod, changefreq, priority, images, videos, news and hreflang. The summary lists every sitemap file and any errors.

### How much does one run of this task cost?

$0.10 per 1,000 URLs saved; reading the sitemaps is free. As set up, at most 500 URLs, so a run costs up to $0.05, usually less.

### Can I use it for my own site?

Yes. Duplicate the "News sitemap scraper: article titles and dates" task and put in your website or sitemap URL. The sitemaps are found through robots.txt and the usual locations.

### What if the site has no sitemap?

The run still succeeds, and the summary lists every location that was tried. This Actor reads sitemaps only and does not crawl pages.

## About this Actor

This example demonstrates how to use [Sitemap Extractor: All URLs from sitemap.xml, robots.txt & .gz](https://apify.com/makerio/sitemap-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/makerio/sitemap-extractor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/makerio/sitemap-extractor.md

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`).
