apyhub
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
http://localhost:8080/apyhub/extract-sitemap-from-url-api/extract
QUICKSTARTGUIDE

Quickstart

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

curl -X POST "http://localhost:8080/apyhub/extract-sitemap-from-url-api/extract" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.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)

AttributeTypeMandatoryDescription
modeENUMNoAllowed value: async
maxUrlsIntegerNoMaximum number of URLs to return. Minimum 1, maximum 250000.
includeMetadataENUMNoAllowed values: true, 1

Request Body

ParameterTypeMandatoryDescription
urlStringYesWebsite 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.

ParameterTypeMandatoryDescription
successBooleanYesIndicates whether the request succeeded.
dataObjectYesSuccess 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.metaObjectNoMetadata about sitemap discovery and processing.
data.meta.inputUrlStringNoInput URL used for the extraction.
data.meta.sourceTypeENUMNoSource type. Allowed values: website, sitemap.
data.meta.discoveryMethodENUMNoDiscovery method. Allowed values: direct, robots_txt, sitemap_xml.
data.meta.discoveredSitemapsString ArrayNoDiscovered sitemap URLs.
data.meta.allProcessedSitemapsString ArrayNoAll sitemap URLs processed.
data.urlsObject ArrayNoArray of URL entries. Returns URL strings when includeMetadata=false, or objects when includeMetadata=true.
data.urls[].urlStringNoURL value for a sitemap entry object.
data.urls[].lastmodStringNoLast modification date or null.
data.urls[].priorityNumberNoPriority value or null.
data.urls[].changefreqStringNoChange frequency or null.
data.partialBooleanNoIndicates whether the URL set is partial.
data.summaryObjectNoAggregated counts and processing metrics.
data.summary.uniqueUrlsIntegerNoCount of unique URLs.
data.summary.limitReachedBooleanNoIndicates whether the URL limit was reached.
data.summary.totalUrlsFoundIntegerNoTotal URLs found before deduplication or limiting.
data.summary.processingTimeMsIntegerNoProcessing time in milliseconds.
data.summary.duplicatesRemovedIntegerNoNumber of duplicate URLs removed.
data.summary.sitemapsProcessedIntegerNoNumber of sitemaps processed.
data.summary.invalidUrlsSkippedIntegerNoNumber of invalid URLs skipped.
data.summary.sitemapsDiscoveredIntegerNoNumber of sitemaps discovered.
data.summary.urlSitemapsProcessedIntegerNoNumber of URL sitemaps processed.
data.summary.sitemapIndexesProcessedIntegerNoNumber of sitemap indexes processed.
data.warningsString ArrayNoWarning messages.
data.limitReasonENUMNoLimit reason. Allowed values: MAX_URLS_REACHED, null.
data.jobIdStringNoAsync job identifier.
data.statusENUMNoJob status. Allowed values: pending, running.
data.messageStringNoStatus 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.

Query parameters

Name
Type
Description
modeOPTIONAL
string
async
maxUrlsOPTIONAL
integer
includeMetadataOPTIONAL
string
true · 1

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
GET
Poll sitemap extraction job status
http://localhost:8080/apyhub/extract-sitemap-from-url-api/jobs/:jobId
QUICKSTARTGUIDE

Quickstart

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

curl -X GET "http://localhost:8080/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)

AttributeTypeMandatoryDescription
jobIdStringYesJob 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.

AttributeTypeMandatoryDescription
successBooleanYesIndicates whether the API call itself succeeded.
dataObjectYesJob status payload. The exact fields vary by status.
data.jobIdStringYesJob identifier.
data.statusENUMYesJob state. Allowed values: pending, running, failed, done.
data.messageStringYes (if status is pending or running)Status message returned while the job is still in progress.
data.errorStringYes (if status is failed)Human-readable failure reason.
data.metaObjectNoMetadata for a completed job result. See schema for nested fields.
data.urlsString Array or Object ArrayNoExtracted URLs. The schema allows an array of strings, or an array of objects with url, lastmod, priority, and changefreq.
data.partialBooleanNoIndicates whether the result is partial.
data.summaryObjectNoSummary of the extraction outcome. See schema for nested fields.
data.warningsString ArrayNoWarning messages returned with the result.
data.limitReasonENUMNoLimit reason when present. Allowed values: MAX_URLS_REACHED, null.

Path parameters

Name
Type
Description
jobIdREQUIRED
string
▣ 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.