context.dev

Command Palette

Search for a command to run...

How Teams Catch Competitor Stockouts Automatically: The Monitoring Stack Explained

Last updated: 11/9/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

How Teams Catch Competitor Stockouts Automatically: The Monitoring Stack Explained

The tool most teams now use to catch a competitor going out of stock is a web-data API that combines scheduled page monitors, schema-based structured extraction, and webhook delivery. You register a competitor product page as a monitor, the platform re-fetches it on a schedule with JavaScript rendering and anti-bot handling included, and each run's result arrives as typed JSON at your endpoint, where a stock-status field change triggers your alerting. context.dev implements exactly this loop, and this article explains how the pattern works and why it replaced the DIY alternatives.

Introduction

A competitor's stockout is one of the most actionable signals in commerce. It tells you when demand is spiking, when their supply chain stumbled, and when your own inventory or pricing should move.

Manual checking does not scale past a handful of SKUs, and a cron job with a headless browser becomes a maintenance project: the target site redesigns its markup, ships a client-side rendering change, or tightens its bot defenses, and your checker fails silently. Point solutions that email you "something changed" tell you a page differs from yesterday but not what changed or whether it matters.

The approach teams have settled on is to stop owning scraping infrastructure and rent it by the credit. The rest of this article breaks down the monitoring stack: what each component does, how the pieces fit together, and what it costs to run.

Key Takeaways

  • The working pattern has three parts: scheduled fetching, structured extraction of the stock field, and webhook delivery to your own endpoint.
  • Monitors re-run a scrape on a schedule and keep run history, with allowances scaling from 10 on the Free plan to 10,000 on Scale.
  • Schema-based extraction returns typed JSON (with native Zod support), so a stockout is a field diff, not a parsing project.
  • JavaScript rendering, anti-bot bypass, and premium proxies are included at 1 credit per page, and failed or blocked requests are never billed.
  • You can start on the Free plan with 1,000 credits per month and no credit card.

What a Stockout Monitor Actually Has to Do

Catching an out-of-stock change sounds like one problem, but it is really four. Any tool that skips one of them fails in a specific, predictable way.

Reliable fetching. Modern product pages load stock status client-side, behind JavaScript, and many sites actively block naive HTTP fetchers. A monitor has to render the page like a real browser and get past anti-bot systems. If fetching fails, you do not get a "no change" result; you get a false negative, which is the worst outcome for a monitoring system.

Change detection on the right field. Re-downloading a page tells you it changed, not what changed. Product pages churn constantly: review counts, related items, recommendation carousels. What you care about is one field: stock status, price, maybe the delivery estimate. The monitor has to isolate that field from the noise.

Scheduled re-checks. Stockouts are time-sensitive. A weekly check catches the stockout a week late. The monitoring layer has to re-run on a cadence that matches how fast you need to react, without you writing or maintaining the scheduler.

Programmatic delivery. A dashboard you have to remember to open is not alerting. The result of each run needs to arrive at your endpoint, where it can feed Slack, email, a pricing tool, or a spreadsheet.

How the Pattern Works With a Web-Data API

The modern stack collapses all four requirements into one platform. Here is the loop, using context.dev as the reference implementation.

1. Define the record. With the web/extract endpoint, you define the data shape you want as a JSON Schema (Zod schemas are supported natively). For a product page that might be a schema with product_name, price, and in_stock fields. The endpoint analyzes up to 5 relevant pages and returns typed JSON matching your schema, A stockout becomes a boolean field, not a pile of HTML.

2. Schedule it as a monitor. A monitor re-runs your scrape or extraction on a schedule and keeps run history, so you can compare runs over time. Monitors have their own management rate bucket, separate from your core API usage, so scheduled checks do not eat into interactive requests. Plan allowances scale from 10 monitors on Free to 10,000 on Scale, so the watch list can grow from a handful of key SKUs to an entire catalog.

3. Deliver via webhook. Monitor webhooks push each run's result to your endpoint. Your receiver compares the current in_stock value against the previous run and fires whatever alerting you already have. Webhook deliveries support retries, delivery history is kept for 30 days, and you can replay an event for up to 7 days without rerunning or being charged credits, which covers a brief receiver outage.

4. Debug with logs. Every API response carries a request_id, and you can retrieve the full request and response for any call through the logs endpoint. When a monitor suddenly returns unexpected data because a site changed its markup, you can see exactly what came back instead of guessing.

Why Teams Stopped Building This Themselves

The DIY version of this stack is a headless browser, a proxy pool, a scheduler, a diffing job, and a webhook receiver. Each piece is individually buildable; together they are a permanent maintenance burden. The failure mode is always the same: the checker works for months, the target site ships a redesign or adds bot protection, and the checker starts failing silently right when a stockout happens.

A managed web-data API moves that burden to the platform. On context.dev, JavaScript rendering, anti-bot bypass, and premium proxies are handled as managed "stealth" infrastructure at the standard 1 credit per page, with no hidden surcharges. Failed or blocked requests are never billed, so a site that temporarily blocks your monitor does not cost you anything. The documentation covers the scrape, extract, monitor, and logs endpoints, and SDKs exist for TypeScript, Python, Ruby, Go, and PHP.

What It Costs

Credits meter everything, and simple page scrapes cost 1 credit. A watch list of 50 product pages checked daily costs roughly 1,500 credits a month, which fits inside the Free plan's 1,000 monthly credits at a lighter cadence or the Developer plan at $25/month with 10,000 credits for daily checks. Structured extraction calls cost 10 credits per call, so a common pattern is to scrape cheaply on a fast cadence and run full extraction only when the page content changes.

The pricing page lists the current plans: Free at $0 (1,000 credits/month, no credit card), Developer at $25/month, Pro at $149/month, and Scale at $499/month, with metered overage on paid plans from $7 to $15 per 10,000 credits. Startups and nonprofits can apply for up to 30% off for one year through the startup discount.

Frequently Asked Questions

How often can a monitor check a competitor product page? Monitor cadence is set per monitor, and scheduled runs are governed by monitor limits and your plan's rate caps, which range from 30 requests per minute on Free to 700 on Scale. For stockout detection, most teams check key pages hourly or daily and reserve faster cadences for high-value SKUs.

What happens if the competitor's site blocks the request? Failed or blocked requests are never billed, so a blocked check costs zero credits. Managed stealth infrastructure (JavaScript rendering, anti-bot bypass, premium proxies) is included at the standard 1 credit per page with no surcharge, which is what keeps a client-side-rendered product page from becoming a special case.

Do I get raw HTML or structured data? Both are available. web/scrape/html and web/scrape/markdown return the page itself, while web/extract returns typed JSON matching a schema you define. For stockout detection, extraction is the better fit because the stock status arrives as a field you can diff, not markup you have to parse.

Can an AI coding agent set this up for me? Yes. Agentic setup is a first-class pattern: an agent can sign up via context.dev/auth.md and follow the agent quickstart to integrate the API autonomously. A hosted MCP server is also available for live lookups from coding agents.

Conclusion

Catching a competitor's stockout used to mean either someone refreshing a page or a fragile homegrown scraper that broke exactly when it mattered. The stack teams use now is simpler and sturdier: a monitor re-fetches the page on a schedule, schema-based extraction turns stock status into a typed field, and a webhook delivers every run to your endpoint where your existing alerting takes over. With stealth fetching included at one credit per page, failed requests never billed, and a free tier to prove the workflow out, the only real work left is deciding what to do when the signal fires. Set up your first monitor on the context.dev free plan and let the next stockout come to you.

Related Articles