String Web Access API
API Reference

Sitemap

Full request and response reference for the asynchronous sitemap crawl endpoints.

Discovers every URL on a site from a single starting point. Crawls are asynchronous jobs: submit for a quote, approve, poll status, then page through the results. See the Sitemap crawl guide for the walkthrough.

MethodPathDescription
POST/sitemapSubmit a crawl and get a quote.
POST/sitemap/{jobId}/approveApprove the quote; starts the crawl.
GET/sitemap/{jobId}Job status and progress.
GET/sitemap/{jobId}/urlsPaginated discovered URLs.
GET/sitemapList your jobs.
DELETE/sitemap/{jobId}Cancel a job.

Submit a crawl

POST https://request.usestring.ai/v1/sitemap

Request body

FieldTypeDefaultDescription
urlstring (URL)Required. Starting URL. The crawl stays on this hostname.
maxPagesinteger10Maximum pages to crawl (1–10,000).
maxDepthinteger2Maximum link depth from the starting URL (1–100).
pathPrefixstringOnly crawl URLs whose path starts with this prefix.
budgetUsdnumberquoteSpend cap in USD (min 0.0001). Defaults to the quote itself, so every job is capped; the crawl stops with token_cap_exceeded before exceeding it.

Response — 202

The job is created in awaiting_approval; nothing is crawled or charged until approved. Quotes expire after one hour — an unapproved job is marked failed with errorMessage: "quote_expired".

{
  "jobId": "6f1c9f0a-8f3e-4a5d-9c2b-1e7d0a4b8c3d",
  "status": "awaiting_approval",
  "estimatedCostUsd": "0.0500000000",
  "estimatedPages": 500
}
StatusMeaning
202Quote produced; job awaiting approval.
400Validation error.
401Missing or invalid API key.
403Destination not enabled for your organization.
429Rate limit exceeded.
500Internal error.

Approve a job

POST https://request.usestring.ai/v1/sitemap/{jobId}/approve

Starts the crawl. The estimated cost is held against your balance and settled when the job finishes. Approve within an hour of submitting — expired quotes are failed and cannot be approved.

StatusMeaning
202Approved — { "jobId": "...", "status": "running" }. Re-approving a still-running job also returns 202.
200Job already in a terminal state — returns its current status (e.g. failed for an expired quote).
401Missing or invalid API key.
402Insufficient balance for estimatedCostUsd (error: "insufficient_funds"); the job is marked failed and cannot be re-approved after a top-up.
404Job not found.
409Approval handoff incomplete (status: "partial_state") — retry the approve call.
429Rate limit exceeded.
500Approval failed — also returned when approving a canceled or token_cap_exceeded job.

Get job status

GET https://request.usestring.ai/v1/sitemap/{jobId}

The response shape depends on the job's status:

statusAdditional fields
awaiting_approvalestimatedCostUsd
runningpending (queued URLs), processed (crawled so far)
completedpagesProcessed, plus urls (full results) shortly after completion or finishedAt
failederrorMessage, finishedAt
canceled / token_cap_exceededpending, processed
{
  "jobId": "6f1c9f0a-8f3e-4a5d-9c2b-1e7d0a4b8c3d",
  "status": "running",
  "pending": 42,
  "processed": 458
}
StatusMeaning
200Status returned.
401Missing or invalid API key.
404Job not found or expired.
409Approval handoff incomplete (partial_state) — retry the approve call.

Get discovered URLs

GET https://request.usestring.ai/v1/sitemap/{jobId}/urls?limit=1000&offset=0
Query paramDefaultDescription
limit1000Page size (max 5,000).
offset0Number of entries to skip.

Response — 200

{
  "jobId": "6f1c9f0a-8f3e-4a5d-9c2b-1e7d0a4b8c3d",
  "total": 500,
  "urls": [
    {
      "url": "https://example.com/blog/post-1",
      "statusCode": 200,
      "discoveredUrls": 12,
      "depth": 2,
      "isSitemap": false,
      "parentUrl": "https://example.com/blog",
      "sourceType": "html_link"
    }
  ]
}
FieldTypeDescription
urlstringThe discovered URL.
statusCodeintegerHTTP status from fetching the URL; 0 when the fetch failed or the code wasn't retained.
discoveredUrlsintegerNumber of new URLs found on this page. Omitted once results are served from durable storage.
depthintegerLink depth from the starting URL (0 = seed).
isSitemapbooleanWhether this URL is a sitemap file rather than a page.
errorstringPresent when fetching this URL failed.
parentUrlstring | nullURL this one was discovered on.
sourceTypestringHow it was discovered: seed, sitemap_index, sitemap_urlset, or html_link.

While the job's results are live — including mid-crawl — the endpoint returns the URLs discovered so far, each with its discoveredUrls count, and total grows as the crawl progresses (check job status to know when the set is complete). Once results move to durable storage they remain available indefinitely, but discoveredUrls is no longer retained and is omitted from each entry.

StatusMeaning
200Results page returned.
401Missing or invalid API key.
404Job not found or expired.

List jobs

GET https://request.usestring.ai/v1/sitemap?limit=20&offset=0

Returns your organization's jobs, most recent first. limit defaults to 20 (max 100).

{
  "jobs": [
    {
      "jobId": "6f1c9f0a-8f3e-4a5d-9c2b-1e7d0a4b8c3d",
      "domain": "example.com",
      "startUrl": "https://example.com",
      "status": "completed",
      "pagesProcessed": 500,
      "maxDepth": 3,
      "maxPages": 500,
      "estimatedCostUsd": "0.0500000000",
      "createdAt": "2026-07-07T12:00:00.000Z",
      "finishedAt": "2026-07-07T12:04:30.000Z",
      "errorMessage": null
    }
  ]
}

Cancel a job

DELETE https://request.usestring.ai/v1/sitemap/{jobId}
StatusMeaning
200Canceled — { "jobId": "...", "status": "canceled" }.
401Missing or invalid API key.
404Job not found.
409Job already finished, failed, or canceled (returns current status).