Product-price extraction
A product page in. Fields your app can use out.
Collect the title, displayed price, and availability from a public product page. Start with a known example, verify the fields, then adapt the selectors to a website you are permitted to access.
Useful for: Developers and agencies building catalog checks, merchandising reports, or price-monitoring workflows.
{
"title": "A Light in the Attic",
"price": "£51.77",
"availability": "In stock (22 available)"
}Example data.extract fields from Books to Scrape; stock can change
From the first request to a repeatable workflow
- 01
Run the included product example
In the workbench, select Collect product prices and then Run scrape. The request uses the public Books to Scrape test catalog and explicit selectors for the book title, price, and availability.
- 02
Read the fields before using them
Compare the extracted values with the source page. CSS fields are returned in data.extract. Product output resolves the primary product from JSON-LD or scoped microdata, with Open Graph and labelled-attribute fallbacks. Missing or ambiguous products return null; uncertain prices are omitted. Check diagnostics.warnings before using a record.
- 03
Adapt to your target website
Replace the URL and update Structured extract in Advanced controls. Selectors belong to a website’s layout, so the book example’s selectors are not universal. Check variants, currency, sale prices, and whether the value includes tax or shipping.
- 04
Repeat only the work you need
Use Batch for a known list of products or create a single-page monitor to detect field changes. Start with a small sample and verify records before expanding. Missing values and failed pages need review rather than guessed replacements.
Make the API request
Create a key in Account and set it as FETCHRELAY_API_KEY in your environment. Keep it out of client-side code and source control.
curl --fail-with-body https://fetchrelay.com/api/scrape \
-H "Authorization: Bearer $FETCHRELAY_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
"formats": [
"product",
"markdown"
],
"extract": {
"title": "h1",
"price": ".price_color",
"availability": ".availability"
},
"maxAge": 0
}'This is a live request and uses account credits. See the OpenAPI reference for the complete response schema.
Check before you ship
- The title identifies the intended product and variant.
- The price matches the displayed price and its currency.
- An error or maintenance page is not accepted as a product record.
Know the limits
There is no universal retailer adapter or guaranteed access to protected shopping sites. Some sites send an error page to cloud servers even when the same URL opens in your browser. A paid plan does not bypass that restriction. CSS extraction needs selectors maintained for the target layout.
Common questions
Why does Product sometimes return null?
The target may not expose supported product markup. If the actual page content was retrieved, use explicit CSS fields and validate them. Null is not a fabricated price.
Can it extract prices from every shopping website?
No. Bot protection, location, login requirements, page structure, and variants affect results. Test the exact websites and fields you need before subscribing.
Can I track a price over time?
Yes. Create a single-page monitor with the relevant fields. Its first successful check establishes a baseline; later checks record differences. Scheduled checks have a minimum interval of 60 minutes.
Try it on a page you actually need.
Inspect the output before committing to an integration. Create an account for 1,000 free monthly credits, saved jobs, monitors, and API keys. No credit card required.