WORKFLOW SNAPSHOT
- Build a normalized observation for the same product across selected public sources.
- Suggested starting behavior: Per-request rotation
- Validate the real application and destination
A practical Price aggregation workflow
Build a normalized observation for the same product across selected public sources.
- Match identifiers, variants, condition, and seller.
- Record currency, tax display, shipping context, and timestamp.
- Keep stale, missing, and unavailable offers distinct from zero prices.
When should price observations use independent proxy assignments?
Use independent assignments for independent permitted source observations where needed. Keep a product page and related delivery or variant checks coherent. A new IP should not silently change currency, visitor state or the product variant being compared.
Which product, seller and price fields must match before aggregation scales?
A lowest displayed price may apply to a different variant or exclude costs. A proxy route cannot resolve a product-matching error.
Validate total displayed conditions and sample matches manually before publishing aggregate comparisons.
Verify the Price aggregation connection boundary
Record product and variant identifiers, seller, condition, currency, tax basis, shipping and timestamp. Distinguish a displayed item price from a verified landed total and keep unavailable offers explicit.
Capture an offer before normalizing its price
Fetches a single offer source and preserves the raw returned price and availability document before normalization or aggregation.
- 01Generate your endpoint
Choose HTTP / HTTPS and Every request for independent observations in Configure proxies.
- 02Set your proxy URL
Set
PS_PROXY_URLtohttp://USERNAME:PASSWORD@HOST:PORTusing your generated endpoint. For IP authentication, whitelist your machine and usehttp://HOST:PORT. Percent-encode special characters in credentials; these are proxy credentials, separate from your account password or API key. - 03Choose the destination
Set
Example URL · replace placeholders with your targetPS_TARGET_URLbefore running the code. Use one permitted public offer URL for a matched product, exact variant, seller and condition; record currency and displayed tax and shipping context alongside the URL.https://example.com/offers/matched-product-variantSet PS_EXPECT_TEXT to the stable product-and-variant identifier used by your offer matcher. This optional check inspects the returned text without running JavaScript.
Python 3.10+ · python -m pip install requests · python ps_price_aggregation.py# Fetches a single offer source and preserves the raw returned price and availability document before normalization or aggregation.
# Use one permitted public offer URL for a matched product, exact variant, seller and condition; record currency and displayed tax and shipping context alongside the URL.
import hashlib
import json
import os
import time
from pathlib import Path
from urllib.parse import urlsplit
import requests
class InspectSession(requests.Session):
# Leave redirect bodies streamed instead of preparing the next request.
def resolve_redirects(self, *args, **kwargs):
return iter(())
proxy = os.environ["PS_PROXY_URL"] # HTTP endpoint from ProxySight
target = os.environ["PS_TARGET_URL"] # https://example.com/offers/matched-product-variant
if urlsplit(proxy).scheme != "http":
raise ValueError("Use your generated HTTP proxy endpoint for this example.")
if urlsplit(target).scheme not in ("http", "https"):
raise ValueError("PS_TARGET_URL must be an HTTP or HTTPS URL.")
with InspectSession() as client:
client.trust_env = False # No ambient proxy, NO_PROXY or netrc overrides
started = time.monotonic()
with client.get(
target,
proxies={"http": proxy, "https": proxy},
headers={"Accept-Language": "en-US,en;q=0.9"},
timeout=(10, 20), allow_redirects=False, stream=True,
) as response:
body = bytearray()
for chunk in response.iter_content(16384):
body.extend(chunk)
if len(body) > 1048576:
raise RuntimeError("Response exceeds this example's 1 MiB limit.")
Path("price-offer-source.html").write_bytes(body)
print(json.dumps({
"workflow": "price-aggregation", "status": response.status_code,
"elapsed_ms": round((time.monotonic() - started) * 1000),
"bytes": len(body), "sha256": hashlib.sha256(body).hexdigest(),
"headers": {name: response.headers.get(name) for name in ['Content-Type', 'Content-Language', 'Location']},
}, indent=2))
expected = os.getenv("PS_EXPECT_TEXT", "")
if expected:
text = body.decode(response.encoding or "utf-8", errors="replace")
print("Expected text:", "found" if expected in text else "absent")
# A 200 status alone does not prove the intended page was returned.
# Inspect redirects, login prompts, 403 and 429 before another request.
Verify the product marker and document class, then inspect cache age and raw price wording before assigning freshness or availability. The GET does not compute a landed total or resolve product matches; keep missing shipping, tax and unavailable amounts as unknown rather than zero.
Response bodies are limited to 1 MiB for a small diagnostic. TLS verification stays enabled; redirects are left for you to inspect. Connection guide
Example: preserve total-price context and missing states
Normalize product identity before aggregating amounts. Keep seller, variant, condition, currency, displayed tax and shipping context, availability, and observation time with every offer.
Use explicit stale, missing, and unavailable states. Treating a missing amount as zero can create a false lowest-price result that looks convincing in a dashboard.
{
"product_key": "MATCHED_PRODUCT",
"seller": "RECORD_SELLER",
"currency": "RECORD_CURRENCY",
"offer_state": "RECORD_STATE",
"observed_at": "RECORD_TIMESTAMP"
}Price aggregation verification checklist
For this Price aggregation workflow, record product match, cost context and data state alongside the actual result. Use the evidence below to decide whether another observation is comparable before increasing the workload.
| Checkpoint | Hold constant or record | Expected evidence |
|---|---|---|
| Product match | Identifier, variant, condition | Equivalent item |
| Cost context | Currency and displayed costs | Comparable amount |
| Data state | Fresh, stale, missing, unavailable | No invented zero-price offer |
Troubleshoot Price aggregation results and connection errors
| Symptom | Check next | What the result tells you |
|---|---|---|
| Lowest price looks implausible | Check missing-state handling | An absent value may have become zero |
| Sources disagree | Compare variant and total context | Offers may not be equivalent |
| Duplicate offers | Check seller and record identity | Avoid inflated coverage |
Normalize comparable offers without losing the original price context
Build a small normalized sample while retaining raw price text and units. Verify that records refer to the same product and condition before comparing values. Treat missing shipping or tax as unknown, not zero, and review outliers against their source pages.
A LITTLE CLARITY
Common questions.
What makes a price record comparable?
Matched product identity, consistent cost context, and a known observation time are essential.
Why should unavailable offers stay in the dataset?
Their explicit state documents coverage and prevents unavailable data from becoming a misleading valid price.
Which product, seller and price fields must match before aggregation scales?
Record product and variant identifiers, seller, condition, currency, tax basis, shipping and timestamp. Distinguish a displayed item price from a verified landed total and keep unavailable offers explicit.