Site .audit
Crawl a whole site, yours or a rival’s, and rank every issue by how many pages it hits, each with an example and its fix.
- Price
- 1.5¢ per 100 pages
- Success rate
- 100% of 90 calls
- Freshness
- Fresh for 7 days
- Emits
Site.audited- Capability
- Web
POST https: //api.sb/ {your-domain}/ sites/ audit
Options and prices
Inputs
| Name | Type | Default | Meaning |
|---|---|---|---|
hostname | Hostname | Required | The site to crawl: yours or a rival’s. |
maxPages | number | 500 | Pages to crawl, at most 10,000. The crawl stops here and says complete:. |
mapOnly | boolean | false | List every URL with its status and no checks. |
render | 'none' | 'js' | 'none' | Run each page’s scripts before checking it, for sites built in the browser. |
maxCost | number | 0.50 | The most this crawl may spend, in USD. Over it, the call is refused before it spends, or stops early with what it has. |
Outputs
| Field | Type | What null means |
|---|---|---|
hostname | Hostname | Never null. |
pages | number, in pages crawled | Never null. |
complete | boolean | Never null: false when the crawl stopped at maxPages or maxCost. |
issues | { id: | Never null: most pages first; empty when every check passed. |
urls | { url: | Present with mapOnly; score: because a map runs no checks. |
(crawl) | Observed | The audit carries observedAt and method. |
cost | Cost, in USD | Never null. In try mode usd is 0 and maxUsd is what the call would have cost. |
Read the result
| Field | Value | What it means | What to do |
|---|---|---|---|
issues | The first row | The fix that helps the most pages at once. | Fix it site-wide in the template, not page by page. (the site-audit order) |
issues | thin-content on tag or location pages | Near-empty pages a search engine judges not worth indexing. | Merge or remove them; they drag the whole site’s crawl. (the index-state playbook) |
issues | orphan | No page links to them, so crawlers find them late or never. | Link each from 2 indexed pages, then check them with Domain.verify. (the index-state playbook) |
complete | false | The site is bigger than maxPages. | Run mapOnly first to count the URLs, then size maxPages to them. (the contract every data call keeps) |
Effects
- Action class
None: it reads, so no approval rule names it
- Modes
try: Crawls and returns the audit; nothing is saved and nothing is billed.send: Returns a pending Action at once;Site.auditedcarries the audit when the crawl ends.do: Waits for the crawl to end, which can take minutes, then returns the audit.
- Idempotency
The same
Idempotency-Keywith the same input replays the first audit at $0; with other input it returns 409.- Saved or shared
The audit is kept with your Site for 7 days; audits of other sites are yours alone.
- Emits
Site.auditedwith{ hostname,pages, complete, issues } - Performed by
- Price
About 1.5¢ per 100 pages. Free: pages past
maxPages, which are never crawled.maxCostdefaults to 50¢. A 500-page crawl: 500 × 0.015¢ a page is about 7.5¢.- Reliability
The first route succeeds 100% of 90 calls. If it fails, the call refuses with
sources-busyand nothing is spent.- Freshness
A reading younger than 7 days returns at $0. Readings about people are never shared across startups.
- Batch and pages
Up to 10,000 pages a crawl. Every crawl:
sendreturns a pending Action at once andSite.auditeddelivers the audit- Rate
The shared rate rules: 10 calls a second per key, and an array input counts as one call.
Refuses when
This call has no refusals of its own. Every data call can also meet the shared data-call refusals: filter-unsupported, input-missing, limit-exceeded, max-cost, rate-limited, sources-busy, venue-unsupported.
When it waits
| Fact | Value |
|---|---|
send returns | A pending Action, status:, with its $id. |
| Delivered by | Site.audited |
await $.Watch.create({
selector: 'Site.audited',
url: 'https://leaseline.app/hooks/audits' ,
})Example
Crawl leaseline.app and tell me which fix helps the most pages. Spend up
to 5¢.To retry, send the same Idempotency-Key: the retry returns the first answer for $0. A new key reads again.
Test values, and watching it
A sk_test_ key answers these the same way every time, at $0 (every test value).
| Test value | Always returns | What it is for |
|---|---|---|
maxCost: | Refuses with max-cost | Any priced call with a maxCost of 0.0001 is refused before it spends: the price is above the cap. |
rate-limited.test | Refuses with rate-limited | Any call naming this hostname answers 429 with Retry-After, so your retry logic runs. |
sources-busy.test | Refuses with sources-busy | Any call naming this hostname answers 503 as if every route were busy, and nothing is spent. |
Watch it on a schedule: a Monitor runs this call and records an Event only when the reading changes.
await $.Monitor.create({
verb: 'Site.audit',
input: { hostname: 'leaseline.app', maxPages: 200 },
change: 'new-issue',
every: '1w',
})Used by
- Jobs: Get indexed · Publish and post