# Out Of Stock Page SEO Auditor (`junipr/out-of-stock-page-seo-auditor`) Actor

Audit out-of-stock and discontinued product pages for SEO-safe handling, alternatives, canonical status, schema availability, site links, messaging, and conversion recovery.

- **URL**: https://apify.com/junipr/out-of-stock-page-seo-auditor.md
- **Developed by:** [junipr](https://apify.com/junipr) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.50 / 1,000 product page scanneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Out Of Stock Page SEO Auditor

Audit out-of-stock and discontinued product pages for SEO-safe handling, alternatives, canonical status, schema availability, internal links, messaging, and conversion recovery.

### What it does

Audits public product pages for visible stock state, Product/Offer availability, canonical and robots directives, discontinued wording, alternative-product links, and restock capture.

The actor emits one product availability SEO row per checked page. Every dataset row uses the declared dataset schema, includes source provenance and a scan timestamp, and is written only after every applicable pay-per-event charge is accepted.

### Typical uses

- Audit out-of-stock product pages
- Find discontinued SEO risks
- Check product schema availability
- Export OOS recovery opportunities
- Review catalog availability handling

### Input

Use public HTTP(S) URLs or deterministic `htmlInputs`. URL fetching rejects localhost, loopback, link-local, and private-network destinations. `allowedDomains` can further constrain live fetches.

- `startUrls`
- `sitemapUrls`
- `htmlInputs`
- `allowedDomains`
- `maxPages`
- `maxDepth`
- `includeEvidence`
- `includeRawSnapshots`
- `requestDelayMs`
- `timeoutMs`
- `userAgentMode`
- `productUrls`
- `availabilityRules`
- `expectedHandling`
- `alternativeProductPatterns`
- `checkSchemaAvailability`
- `checkCanonical`
- `maxProductPages`
- `maxRules`
- `maxChargeUsd`
- `includeReport`

The safety caps named in `maxProductPages, maxDepth, maxRules, timeoutMs` are enforced in addition to `maxChargeUsd`. A value of `0` for `maxChargeUsd` is a hard zero budget: the actor exits before the first paid operation.

#### Minimal deterministic example

```json
{
  "htmlInputs": [
    {
      "sourceUrl": "https://shop.example/public-page",
      "html": "<html><head><title>Public page</title></head><body><h1>Public evidence</h1></body></html>"
    }
  ],
  "includeEvidence": true,
  "includeReport": true,
  "maxChargeUsd": 15
}
```

The prefilled input remains deliberately small so Apify automated quality runs finish quickly. For production use, replace the example source with public pages you are authorized to access.

### Dataset output

- `sourceUrl`
- `sourceType`
- `pageTitle`
- `recordType`
- `recordName`
- `issueCode`
- `severity`
- `evidenceSnippet`
- `recommendation`
- `canonicalUrl`
- `httpStatus`
- `scannedAt`
- `productUrl`
- `productName`
- `availabilityStatus`
- `discontinuedSignal`
- `schemaAvailability`
- `alternativeLinks`
- `restockMessageFound`
- `emailCaptureFound`
- `seoHandlingIssue`
- `recommendedAction`

Reports are also written to key-value storage:

- `out-of-stock-page-seo-auditor-summary-report.md`
- `out-of-stock-page-seo-auditor-records.csv`
- `out-of-stock-page-seo-auditor-issues.json`
- `out-of-stock-page-seo-auditor-evidence-samples.json`
- `out-of-stock-page-seo-auditor-run-metadata.json`

When `includeRawSnapshots` is true, bounded raw HTML snapshots are stored separately. Raw snapshots are off by default.

### Pay-per-event pricing

Platform-usage pass-through is **off**. Prices are the locked fixed-inclusive values for this actor.

| Event | Price | Meaning |
| --- | ---: | --- |
| `actor-start` | $0.01 | Actor Start |
| `product-page-scanned` | $0.0065 | Product Page Scanned |
| `availability-seo-finding-emitted` | $0.00295 | Availability SEO Finding Emitted |
| `record-extracted` | $0.00295 | Record Extracted |
| `audit-report-generated` | $0.08 | Audit Report Generated |

Charging rules:

- `actor-start` must be accepted before fetching or rendering begins.
- Page/target events are deduplicated per source.
- Record and finding events fire only when the corresponding output exists.
- Report output is written only after the report event is accepted.
- Partial charges and Apify charge-limit responses stop the run before additional paid output.
- Store discounts are tracked as a separate Console configuration requirement; this source does not claim they are already applied.

### Evidence and failure behavior

- Structured availability is compared with visible page copy.
- Discontinued and out-of-stock pages are checked for canonical and alternative-product recovery.
- The actor reports evidence; it does not change storefront content.

A fetch failure, browser failure, blocked page, missing record, or incomplete match produces a bounded diagnostic row when possible. It never invents a successful extraction. Evidence can be omitted with `includeEvidence: false`.

### Local verification

```bash
pnpm --filter @junipr/out-of-stock-page-seo-auditor build
pnpm --filter @junipr/out-of-stock-page-seo-auditor test
pnpm --filter @junipr/out-of-stock-page-seo-auditor smoke
```

The tests cover strong, weak, unavailable, comparison, and cap fixtures; schema equality; pricing metadata; accepted/partial/limited charges; zero budget; and report generation.

### Limitations

- Results reflect the public source at the scan time and may change later.
- Site markup changes can require selector/parser maintenance.
- The actor does not bypass authentication, CAPTCHAs, robots restrictions, or access controls.
- Legal, tax, pricing, SEO, merchandising, and marketplace decisions remain the user's responsibility.

# Actor input Schema

## `startUrls` (type: `array`):

startUrls for Out Of Stock Page SEO Auditor.

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

sitemapUrls for Out Of Stock Page SEO Auditor.

## `htmlInputs` (type: `array`):

htmlInputs for Out Of Stock Page SEO Auditor.

## `allowedDomains` (type: `array`):

allowedDomains for Out Of Stock Page SEO Auditor.

## `maxPages` (type: `integer`):

maxPages for Out Of Stock Page SEO Auditor.

## `maxDepth` (type: `integer`):

maxDepth for Out Of Stock Page SEO Auditor.

## `includeEvidence` (type: `boolean`):

includeEvidence for Out Of Stock Page SEO Auditor.

## `includeRawSnapshots` (type: `boolean`):

includeRawSnapshots for Out Of Stock Page SEO Auditor.

## `requestDelayMs` (type: `integer`):

requestDelayMs for Out Of Stock Page SEO Auditor.

## `timeoutMs` (type: `integer`):

timeoutMs for Out Of Stock Page SEO Auditor.

## `userAgentMode` (type: `string`):

userAgentMode for Out Of Stock Page SEO Auditor.

## `productUrls` (type: `array`):

productUrls for Out Of Stock Page SEO Auditor.

## `availabilityRules` (type: `array`):

availabilityRules for Out Of Stock Page SEO Auditor.

## `expectedHandling` (type: `string`):

expectedHandling for Out Of Stock Page SEO Auditor.

## `alternativeProductPatterns` (type: `array`):

alternativeProductPatterns for Out Of Stock Page SEO Auditor.

## `checkSchemaAvailability` (type: `boolean`):

checkSchemaAvailability for Out Of Stock Page SEO Auditor.

## `checkCanonical` (type: `boolean`):

checkCanonical for Out Of Stock Page SEO Auditor.

## `maxProductPages` (type: `integer`):

maxProductPages for Out Of Stock Page SEO Auditor.

## `maxRules` (type: `integer`):

maxRules for Out Of Stock Page SEO Auditor.

## `maxChargeUsd` (type: `number`):

maxChargeUsd for Out Of Stock Page SEO Auditor.

## `includeReport` (type: `boolean`):

includeReport for Out Of Stock Page SEO Auditor.

## Actor input object example

```json
{
  "startUrls": [],
  "sitemapUrls": [],
  "htmlInputs": [
    {
      "sourceId": "oos-1",
      "sourceUrl": "https://shop.example/products/camera",
      "title": "Atlas Camera",
      "httpStatus": 200,
      "html": "<html><head><title>Atlas Camera</title><meta name=\"description\" content=\"Availability\"><link rel=\"canonical\" href=\"https://shop.example/products/camera\"><script type=\"application/ld+json\">{\"@type\":\"Product\",\"name\":\"Atlas Camera\",\"offers\":{\"availability\":\"OutOfStock\"}}</script></head><body><h1>Atlas Camera</h1><p>Out of stock. Notify me when back in stock.</p><input type=\"email\"><a href=\"/products/new\">Alternative product</a></body></html>"
    }
  ],
  "allowedDomains": [],
  "maxPages": 5,
  "maxDepth": 5,
  "includeEvidence": true,
  "includeRawSnapshots": false,
  "requestDelayMs": 0,
  "timeoutMs": 15000,
  "userAgentMode": "standard",
  "productUrls": [],
  "availabilityRules": [],
  "expectedHandling": "",
  "alternativeProductPatterns": [],
  "checkSchemaAvailability": true,
  "checkCanonical": true,
  "maxProductPages": 3,
  "maxRules": 10,
  "maxChargeUsd": 15,
  "includeReport": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `report` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("junipr/out-of-stock-page-seo-auditor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("junipr/out-of-stock-page-seo-auditor").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 '{}' |
apify call junipr/out-of-stock-page-seo-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,junipr/out-of-stock-page-seo-auditor"
        }
    }
}

```

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/jMjkbjcHNv7iChDGA/builds/DPbmwOq4w5UL54ndD/openapi.json
