# Sitemap URL Extractor (`onescales/sitemap-url-extractor`) Actor

Provide a website link to a sitemap.xml and the app will extract and list all URLs in the sitemap as well as additional data in the sitemap (i.e. https://onescales.com/sitemap.xml).

- **URL**: https://apify.com/onescales/sitemap-url-extractor.md
- **Developed by:** [One Scales](https://apify.com/onescales) (community)
- **Categories:** Developer tools, E-commerce, SEO tools
- **Stats:** 645 total users, 12 monthly users, 100.0% runs succeeded, 14 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.60 / 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

Provide a link to a sitemap.xml and the app will extract and list all URLs in the sitemap, as well as additional data in the sitemap (e.g., https://onescales.com/sitemap.xml).

### Use Cases

- SEO Analysis: Extract all URLs from a website's sitemap to analyze the site's structure and ensure all pages are indexed.
- Content Inventory: Create a list of all pages on a website for auditing or migration purposes.
- Broken Link Checking: Use the list of URLs to check for broken links or errors.
- Competitive Analysis: Analyze a competitor's sitemap to understand their site structure and content strategy.

### How to Use

- Set Up on Apify: Create an Apify account and add the Sitemap URL’s Extractor to your dashboard.
- Configure Inputs: Specify the sitemap.xml URLs you want to extract URLs from. You can enter a single URL or multiple URLs (e.g., https://onescales.com/sitemap.xml).
- Run the Scraper: Launch the scraper and let it crawl the sitemap(s) to collect the URLs and metadata.
- Review Results: Access the extracted data directly on Apify or export it for further analysis. Export in CSV and open in Excel or Google Sheets.
- Analyze Data: Use the output to study the website's structure, check for updates, or perform other analyses.

### Output Example

Here’s a sample of the data you’ll receive from a sitemap:

url: https://example.com/page1
lastmod: 2023-01-01
changefreq: monthly
priority: 0.8
url: https://example.com/page2
lastmod: 2023-02-01
changefreq: weekly
priority: 0.5...

### How to Export

Exporting your data is simple and seamless:

- Access Results: After running the scraper, view the collected data in Apify’s interface.
- Select Export Option: Choose the CSV export option to download your data.
- Open in Tools: Import the CSV file into Excel, Google Sheets, or your preferred analysis tool to visualize and explore the data.
- Share or Store: Save the file for future reference or share it with your team for collaborative analysis.

### Need Help

Have questions or need additional features? We’re here to support you!Just fill out the form at https://docs.google.com/forms/d/e/1FAIpQLSfsKyzZ3nRED7mML47I4LAfNh_mBwkuFMp1FgYYJ4AkDRgaRw/viewform?usp=dialog and we’ll try our best to help as quick as possible.

### Related Keywords

website sitemap, sitemap tool, sitemap extractor, sitemap url, sitemap.xml, download sitemap, list sitemap, actor, AI, API, apify, at scale, auditor, automated, automation, batch, bulk, checker, converter, crawler, cron, CSV, dataset, detector, downloader, Excel, export, exporter, extractor, fetcher, finder, free tool, generator, Google Sheets, HTML, ifttt, instant, JSON, lookup, make, make.com, maker, mass, MCP, monitor, n8n, no-code, no API key required, parser, PDF, pipeline, report, scanner, schedule, scheduled, scraper, spreadsheet, tool, validator, verifier, webhook, workflow, XML, zapier

# Actor input Schema

## `sitemapUrls` (type: `array`):

List of sitemap.xml URLs to extract URLs from. Click '+' to add multiple URLs or upload a file with one URL per line.

## Actor input object example

```json
{
  "sitemapUrls": [
    "https://onescales.com/sitemap.xml"
  ]
}
```

# Actor output Schema

## `extractedUrls` (type: `string`):

All URLs extracted from the sitemap with their metadata

# 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 = {
    "sitemapUrls": [
        "https://onescales.com/sitemap.xml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("onescales/sitemap-url-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 = { "sitemapUrls": ["https://onescales.com/sitemap.xml"] }

# Run the Actor and wait for it to finish
run = client.actor("onescales/sitemap-url-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 '{
  "sitemapUrls": [
    "https://onescales.com/sitemap.xml"
  ]
}' |
apify call onescales/sitemap-url-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,onescales/sitemap-url-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/OpsTnTewUvSXXKcNq/builds/Wtgx1LtcKco4zOYNZ/openapi.json
