# Product Stock Monitor (`yearly_register/product-stock-monitor`) Actor

Check product URLs for current availability and stock-status changes, producing structured records for reliable scheduled monitoring.

- **URL**: https://apify.com/yearly\_register/product-stock-monitor.md
- **Developed by:** [Automation Tech](https://apify.com/yearly_register) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 product checkeds

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Product Stock Monitor

Product Stock Monitor extracts conservative availability snapshots from public product pages using structured product data when available or explicit CSS selectors when a source needs custom targeting. It is built for recurring stock checks where a stable dataset is more useful than repeatedly inspecting pages by hand.

### What it does

The Actor crawls configured product URLs, resolves supported availability information, normalizes the result, and writes a structured snapshot to the default Apify dataset. Structured product metadata is preferred where possible, while selector-based extraction provides a controlled fallback for sites that do not expose reliable availability markup.

Typical use cases include:

- monitoring when selected products return to stock;
- tracking public availability across retailers;
- feeding stock status into alerts or dashboards;
- recording availability snapshots over time;
- scheduling recurring checks in Apify.

### Quick start

1. Add one or more public product URLs to the Actor input.
2. Run a small test using conservative request and result limits.
3. Inspect the dataset and verify that the reported availability matches the page.
4. If structured data is not sufficient, configure the supported selector options for that target.
5. Once the source is verified, schedule recurring runs or call the Actor through the Apify API.

The Input tab also includes common crawler settings such as retries, request limits, concurrency, timeouts, and proxy configuration.

### Output

Each dataset item represents a normalized stock/availability snapshot together with source and scrape metadata. The exact field contract is defined by the Actor's dataset schema. Results can be exported as JSON, CSV, or Excel or consumed through the Apify dataset API.

### Scheduling and integrations

Use an Apify schedule for periodic stock checks and connect the resulting dataset to webhooks, Make, Zapier, notification services, databases, or other Actors. Choose a schedule that is reasonable for the retailer and the urgency of the monitoring task.

### Limitations

Availability displayed on product pages can depend on location, product variant, store selection, account state, cookies, or delivery method. Structured markup may also be stale, and CSS selectors can break after a site redesign. This Actor monitors public page data and should not be treated as a guaranteed inventory reservation system.

### Pricing

The active pricing model and current rates are shown in the Actor's Apify Store **Pricing** tab. Platform cost depends on page count, frequency, retries, proxy use, and target complexity. Test a small representative set before enabling frequent recurring runs.

# Actor input Schema

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

List of URLs to start scraping from

## `maxResults` (type: `integer`):

Maximum number of results to scrape

## `maxRequests` (type: `integer`):

Maximum number of requests to process

## `maxConcurrency` (type: `integer`):

Maximum number of concurrent requests

## `maxRequestRetries` (type: `integer`):

Maximum number of retries for failed requests

## `maxRequestsPerMinute` (type: `integer`):

Maximum requests per minute

## `requestTimeoutSecs` (type: `integer`):

Request timeout in seconds

## `proxyConfiguration` (type: `object`):

Proxy configuration for requests

## `debug` (type: `boolean`):

Enable debug logging

## `productNameSelector` (type: `string`):

Optional CSS selector override. Maximum 500 characters.

## `availabilitySelector` (type: `string`):

Optional CSS selector override. Maximum 500 characters.

## `inStockPatterns` (type: `array`):

Case-insensitive phrases applied only to the selected availability value. 1–25 unique phrases, at most 100 characters each; no duplicates across lists.

## `outOfStockPatterns` (type: `array`):

Case-insensitive phrases applied only to the selected availability value. 1–25 unique phrases, at most 100 characters each; no duplicates across lists.

## `limitedStockPatterns` (type: `array`):

Case-insensitive phrases applied only to the selected availability value. 1–25 unique phrases, at most 100 characters each; no duplicates across lists.

## `backorderPatterns` (type: `array`):

Case-insensitive phrases applied only to the selected availability value. 1–25 unique phrases, at most 100 characters each; no duplicates across lists.

## `preorderPatterns` (type: `array`):

Case-insensitive phrases applied only to the selected availability value. 1–25 unique phrases, at most 100 characters each; no duplicates across lists.

## Actor input object example

```json
{
  "startUrls": [],
  "maxResults": 1000,
  "maxRequests": 10000,
  "maxConcurrency": 10,
  "maxRequestRetries": 3,
  "maxRequestsPerMinute": 60,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "debug": false,
  "productNameSelector": "",
  "availabilitySelector": "",
  "inStockPatterns": [
    "in stock",
    "available",
    "ships immediately"
  ],
  "outOfStockPatterns": [
    "out of stock",
    "sold out",
    "unavailable"
  ],
  "limitedStockPatterns": [
    "low stock",
    "limited stock",
    "only a few left"
  ],
  "backorderPatterns": [
    "backorder",
    "back order"
  ],
  "preorderPatterns": [
    "preorder",
    "pre-order"
  ]
}
```

# Actor output Schema

## `results` (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 = {
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yearly_register/product-stock-monitor").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 = { "proxyConfiguration": { "useApifyProxy": False } }

# Run the Actor and wait for it to finish
run = client.actor("yearly_register/product-stock-monitor").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 '{
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call yearly_register/product-stock-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yearly_register/product-stock-monitor"
        }
    }
}
```

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/WE8xmA7JIGh5mtAlz/builds/fxzywKDXMDpUQHV8X/openapi.json
