September 2, 2026

What Is a Price Monitoring API? How to Build One With the You.com Contents API

What Is a Price Monitoring API? How to Build One With the You.com Contents API

What Is a Price Monitoring API? How to Build One With the You.com Contents API

TLDR: A price monitoring API returns current prices for products you track, on a schedule, in structured form. Vendors sell it as a licensed feed with a fixed catalog. You can also build one: keep a list of product URLs, re-read them on a schedule, and diff what changed. The You.com Contents API fetches up to 10 URLs per request and returns clean Markdown, which is exactly the raw material a price watcher needs. This guide covers the buy-versus-build decision, the working code, and the failure modes that silently corrupt price data.

A price monitoring API answers one question on a loop: what does this product cost right now, and did that change since last check. Teams use the output to track competitors, enforce MAP agreements, time purchases, and feed pricing models. The first decision is not which vendor. It is whether you need a vendor at all.

What Can a Price Monitoring API Do for You?

It turns a manual check, opening tabs and reading prices, into a scheduled pipeline with history: a current price per product, a timestamped change log, and alerts when movement crosses a threshold. The inputs are the product URLs you choose to watch.

Three buying patterns dominate the category. Licensed feed vendors sell normalized catalogs with historical series. Scraping infrastructure vendors sell proxies and parsers, and you write the extraction logic. Public-source pipelines skip both: you read the product pages directly on your own cadence and parse only what you need.

Should You Buy a Feed or Build a Pipeline?

Buy when you need breadth. A tracking list of "every SKU in this category across twelve retailers" favors a licensed feed, because discovery and normalization are the expensive parts at that scale. A built pipeline pays off in the opposite regime: a bounded list of URLs you already know, freshness requirements the feed's cadence cannot meet, or fields the feed does not carry (stock status, bundle contents, review counts).

The tradeoff: a feed rents you breadth and costs you control of freshness and schema. A built pipeline costs you the engineering instead: scheduling, parsing, change detection, and the failure modes in the last section of this guide. One public fact makes the build viable without a parser per site: most large retailers emit product attributes in page markup, documented openly in the schema.org Product vocabulary.

How Do You Build a Price Monitor With the You.com Contents API?

The core loop is three steps: fetch the page, extract the price, compare against the last stored value. The You.com Contents API handles the first step: pass it up to 10 URLs in one request with the markdown format, and it returns page content with navigation, ads, and boilerplate stripped (You.com Contents API docs, 2026-09-04).

Two parameters matter for monitoring. First, formats: request markdown for text extraction, or metadata for structured page data. Second, max_age, the cache freshness control: cached content older than your threshold gets re-fetched, and max_age=0 always bypasses the cache. Set it explicitly, because a cache hit is indistinguishable from an unchanged price unless you record the fetch time.

Here is a working monitor loop in Python. It skips unchanged pages with a hash, extracts the price with a regex over schema.org markup, and stores a change log. A failed fetch or a missing price is logged and skipped, never silently treated as "no change."

import os
import hashlib
import re
import json
from datetime import datetime, timezone
from youdotcom import You
from youdotcom.models import ContentsFormats

TRACKED = {
    "https://store.example.com/widget-pro": "Widget Pro",
    "https://shop.example.net/widget-lite": "Widget Lite",
}

STATE_PATH = os.environ.get("PRICE_STATE", "price_state.json")

def load_state():
    try:
        with open(STATE_PATH) as f:
            return json.load(f)
    except (FileNotFoundError, json.JSONDecodeError):
        return {}

PRICE_RE = re.compile(
    r'"price"\s*:\s*"?([0-9]+(?:\.[0-9]+)?)"?'
)

def extract_price(markdown):
    match = PRICE_RE.search(markdown)
    if not match:
        return None
    return float(match.group(1))

def check_prices():
    state = load_state()
    changes = []
    urls = list(TRACKED)

    with You() as you:
        for i in range(0, len(urls), 10):
            batch = urls[i:i + 10]
            try:
                pages = you.contents(
                    urls=batch,
                    formats=[ContentsFormats.MARKDOWN],
                )
            except Exception as exc:
                print(f"batch failed, skipping: {exc}")
                continue

            for page in pages:
                url = page.url if hasattr(page, "url") else batch[0]
                markdown = getattr(page, "markdown", "") or ""
                digest = hashlib.sha256(markdown.encode()).hexdigest()
                prior = state.get(url, {})

                if prior.get("digest") == digest:
                    continue

                price = extract_price(markdown)
                if price is None:
                    print(
                        f"no price found for {url}, flagging for review"
                    )
                    continue

                if prior.get("price") != price:
                    changes.append({
                        "url": url,
                        "name": TRACKED.get(url, url),
                        "old": prior.get("price"),
                        "new": price,
                    })

                state[url] = {
                    "digest": digest,
                    "price": price,
                    "fetched_at": datetime.now(timezone.utc).isoformat(),
                }

    with open(STATE_PATH, "w") as f:
        json.dump(state, f, indent=2)
    return changes

if __name__ == "__main__":
    for change in check_prices():
        print(change)

How Do You Discover New Product Pages to Track?

A monitor is only as good as its URL list: when a competitor launches a product you do not know about, no scheduled fetch will find it. Discovery is a search problem rather than an extraction problem, and the You.com Web Search API covers it. Query the product category, pin the domains you care about with include_domains (up to 500 per request), and feed new URLs into the tracking list. Freshness filters keep launch detection on new pages rather than old reviews.

What Silently Corrupts a Price Monitor?

Four failure modes, each with a detection method.

The stale cache hit. A cached page reports yesterday's price and the monitor records "no change." This is the most common silent failure in the pattern. Detection: set max_age to your real freshness requirement (the default accepts cached content regardless of age), store the fetch timestamp with every value, and treat repeated identical reads on a volatile page as an alarm rather than reassurance.

The layout change. The retailer redesigns and your extraction returns nothing, or worse, the wrong number (a shipping cost, a strikethrough price). Detection: track extraction success rate per domain. A domain whose success rate collapses has changed, and a human should look before the data does.

The currency and locale switch. A geo-varied page returns a different currency with no label change. Detection: extract the currency field alongside the price, and alarm on currency changes too.

The dead URL. Products delist, and the URL starts returning a redirect or a soft-404 page. Detection: a digest that never changes for weeks while category peers change weekly is probably dead.

How Do You Keep Monitoring Costs Sane?

Two levers. The hash-skip pattern above keeps parsing and alerting rare by skipping unchanged pages. And batch width: the Contents API fetches up to 10 URLs per request, so batch to that width rather than fetching one URL per call. Usage rates are listed on the You.com pricing page. One caution before you scale the URL list: check each site's terms of service and its robots.txt rules for restrictions on automated access, because marketplaces in particular publish limits that differ from plain retailer sites.

For teams wiring monitoring into agent clients rather than raw HTTP, every You.com API is also reachable through the MCP endpoint at https://api.you.com/mcp, and Search is free to try at https://api.you.com/mcp?profile=free with no signup. The same pattern shows up in our news monitoring guide and the web content extraction walkthrough.

Next action: pick five product URLs you actually care about, run the loop above daily for one week, and read the change log. You will learn fast whether public pages carry the fields you need and how often your sources move. Both answers shape the buy-versus-build decision better than any vendor deck.

Frequently Asked Questions

A price monitoring API is an interface that returns current prices for a list of products you track, on a schedule, in structured form. The output is a current price per product, a timestamped change log, and alerts when movement crosses a threshold. Vendors sell it as a licensed feed with a fixed catalog, or you can build one on top of retrieval primitives.

Buy when you need breadth: tracking every SKU in a category across many retailers makes discovery and normalization the expensive parts, which is what licensed feeds sell. Build when you have a bounded URL list, freshness requirements the feed cadence cannot meet, or fields the feed does not carry. The build costs you scheduling, parsing, and change detection engineering.

Keep a list of product URLs, re-read them on a schedule, and diff what changed. The You.com Contents API fetches up to 10 URLs per request in parallel and returns clean Markdown, so extraction works off structured text rather than raw HTML. Set the max_age parameter explicitly: it controls cache freshness, and max_age set to 0 always bypasses the cache.

The stale cache hit: a cached page reports an old price and the monitor records no change. Detection is setting the cache freshness control to your real requirement, storing the fetch timestamp alongside every value, and treating repeated identical reads on a volatile page as an alarm rather than reassurance.

Scheduled fetches only cover URLs you already know. Discovery is a search problem: query the product category with the You.com Web Search API, pin the domains you care about with the include_domains parameter (up to 500 domains per request), and feed new URLs into the tracking list. Freshness filters keep results on new pages rather than old reviews.

    Share Article:

  1. LI Test

  2. LI Test

Related resources.

What Is the You.com Contents API? Clean Page Content From Any URL

September 2, 2026

Blog

What Is a Product Data API? A Practical Guide for Commerce Pipelines

What Is a Product Data API? A Practical Guide for Commerce Pipelines

September 1, 2026

Blog

What Is a Firmographic Data API? A Practical Guide for Pipeline Builders

What Is a Firmographic Data API? A Practical Guide for Pipeline Builders

September 1, 2026

Blog

What Is a Web Content Extraction API? How to Build a Pipeline With the You.com Contents API

What Is a Web Content Extraction API? How to Build a Pipeline With the You.com Contents API

August 31, 2026

Blog

What Is a Grounding API? Real-Time Information for AI Applications

What Is a Grounding API? Real-Time Information for AI Applications

August 21, 2026

Blog