apyhub
Back
▣ DATA EXTRACTION · DEVELOPER TOOLS

Extract Sitemap from URL API

Hosted on ApyHub

What it does

Sitemap Extractor finds and returns the URLs exposed by a website’s sitemap files. Send a website URL or a direct sitemap URL, and it will resolve the sitemap source, process sitemap indexes and nested sitemaps, and give you back the collected URLs.

Use it when you need a crawl seed list, want to audit what a site exposes to search engines, or need to compare sitemap coverage against live pages. The request accepts a url in the body, with optional mode=async, maxUrls, and includeMetadata. If you pass includeMetadata, the response can include each URL with lastmod, priority, and changefreq; otherwise you get plain URL strings.

The response also includes extraction metadata such as the source URL, how the sitemap was discovered, processed sitemap lists, and a summary with counts like uniqueUrls, totalUrlsFound, duplicatesRemoved, and whether a limit was reached. If extraction is running asynchronously, the initial response gives you a jobId, and you can poll the job endpoint until it returns done or failed.

Sitemap Extractor is a good fit for SEO tools, site monitoring, content inventory, and any workflow that needs a structured list of URLs from one site.

▣ ENDPOINT 01 / 02
POST
Extract all URLs from a website's sitemaps
https://api.eu.apyhub.com/apyhub/extract-sitemap-from-url-api/extract

QUICKSTART

GUIDE

Quickstart

Fetch URLs from a sitemap or website by sending the target URL in a JSON body.

curl -X POST "https://api.eu.apyhub.com/apyhub/extract-sitemap-from-url-api/extract" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://apyhub.com"}'

What you'll get back

Returns a JSON object with success and data fields. On a completed extraction, data contains the extracted URLs plus optional metadata and summary information; in async mode, data contains a jobId, status, and message.

{
  "success": true,
  "data": {
    "urls": ["https://example.com/page-one"],
    "partial": false
  }
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Website URL or direct sitemap URL. If the path ends in .xml, .xml.gz, or contains "sitemap" it is used directly; otherwise robots.txt is consulted and /sitemap.xml is tried as a fallback.

About this endpoint

What it does

Extracts all URLs discovered from a website’s sitemaps. It accepts either a website URL or a direct sitemap URL, and can return the URLs immediately or start an async job depending on the selected query mode.

Query Parameter(s)

AttributeTypeDescription
modeENUMAllowed value: async
maxUrlsIntegerMaximum number of URLs to return. Minimum 1, maximum 250000.
includeMetadataENUMAllowed values: true, 1

Request Body

ParameterTypeDescription
urlStringWebsite URL or direct sitemap URL. Must be a valid URI. If the path ends in .xml, .xml.gz, or contains sitemap, it is used directly; otherwise robots.txt is consulted and /sitemap.xml is tried as a fallback.

Response

Returns a JSON object with a success boolean field and a data object field. The success response is either the synchronous result payload or an async job payload, depending on the request mode.

ParameterTypeDescription
successBooleanIndicates whether the request succeeded.
dataObjectSuccess payload. In the synchronous shape, this object includes meta, urls, partial, summary, warnings, and limitReason. In the async shape, this object includes jobId, status, and message.
data.metaObjectMetadata about sitemap discovery and processing.
data.meta.inputUrlStringInput URL used for the extraction.
data.meta.sourceTypeENUMSource type. Allowed values: website, sitemap.
data.meta.discoveryMethodENUMDiscovery method. Allowed values: direct, robots_txt, sitemap_xml.
data.meta.discoveredSitemapsString ArrayDiscovered sitemap URLs.
data.meta.allProcessedSitemapsString ArrayAll sitemap URLs processed.
data.urlsObject ArrayArray of URL entries. Returns URL strings when includeMetadata=false, or objects when includeMetadata=true.
data.urls[].urlStringURL value for a sitemap entry object.
data.urls[].lastmodStringLast modification date or null.
data.urls[].priorityNumberPriority value or null.
data.urls[].changefreqStringChange frequency or null.
data.partialBooleanIndicates whether the URL set is partial.
data.summaryObjectAggregated counts and processing metrics.
data.summary.uniqueUrlsIntegerCount of unique URLs.
data.summary.limitReachedBooleanIndicates whether the URL limit was reached.
data.summary.totalUrlsFoundIntegerTotal URLs found before deduplication or limiting.
data.summary.processingTimeMsIntegerProcessing time in milliseconds.
data.summary.duplicatesRemovedIntegerNumber of duplicate URLs removed.
data.summary.sitemapsProcessedIntegerNumber of sitemaps processed.
data.summary.invalidUrlsSkippedIntegerNumber of invalid URLs skipped.
data.summary.sitemapsDiscoveredIntegerNumber of sitemaps discovered.
data.summary.urlSitemapsProcessedIntegerNumber of URL sitemaps processed.
data.summary.sitemapIndexesProcessedIntegerNumber of sitemap indexes processed.
data.warningsString ArrayWarning messages.
data.limitReasonENUMLimit reason. Allowed values: MAX_URLS_REACHED, null.
data.jobIdStringAsync job identifier.
data.statusENUMJob status. Allowed values: pending, running.
data.messageStringStatus message for the async job.

Notes

This endpoint supports an async mode when mode=async. In that case it returns immediately with data.jobId, data.status, and data.message; poll the corresponding job-check flow using the returned jobId until the status reaches a terminal state.

▣ ENDPOINT 02 / 02
GET
Poll sitemap extraction job status
https://api.eu.apyhub.com/apyhub/extract-sitemap-from-url-api/jobs/:jobId

QUICKSTART

GUIDE

Quickstart

Fetch the status for a sitemap extraction job by replacing jobId in the path.

curl -X GET "https://api.eu.apyhub.com/apyhub/extract-sitemap-from-url-api/jobs/:jobId" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with success and data fields. success is a boolean, and data is an object whose shape depends on the job status: it may include jobId, status, and either message for pending/running, or urls and related result fields for done, or error for failed.

{
  "success": true,
  "data": {
    "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "pending",
    "message": "Job is still processing"
  }
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Polls the status of a sitemap extraction job using the jobId in the path. The success response is a JSON object with a success boolean and a data object whose shape depends on the job status.

Path Parameter(s)

AttributeTypeDescription
jobIdStringJob identifier.

Response

Returns a JSON object with a success boolean and a data object. When the job is still in progress, data includes jobId, status (pending or running), and message; when the job has failed, data includes jobId, status (failed), and an error message; when the job is done, data includes jobId, status (done) plus the extraction result fields.

AttributeTypeDescription
successBooleanIndicates whether the API call itself succeeded.
dataObjectJob status payload. The exact fields vary by status.
data.jobIdStringJob identifier.
data.statusENUMJob state. Allowed values: pending, running, failed, done.
data.messageStringStatus message returned while the job is still in progress.
data.errorStringHuman-readable failure reason.
data.metaObjectMetadata for a completed job result. See schema for nested fields.
data.urlsString Array or Object ArrayExtracted URLs. The schema allows an array of strings, or an array of objects with url, lastmod, priority, and changefreq.
data.partialBooleanIndicates whether the result is partial.
data.summaryObjectSummary of the extraction outcome. See schema for nested fields.
data.warningsString ArrayWarning messages returned with the result.
data.limitReasonENUMLimit reason when present. Allowed values: MAX_URLS_REACHED, null.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.