Product Rating Extractor
Pricing
$3.00 / 1,000 results
Product Rating Extractor
Pricing
$3.00 / 1,000 results
Rating
0.0
(0)
Developer
Eichan Jolly
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
Features
Share
Read one public product-like HTML page and output the schema.org Product / ProductGroup aggregateRating published in its JSON-LD. One page per run; one dataset row. No storefront account, browser, paid APIs, or Apify SDK.
Who is it for?
Store owners, catalog-quality analysts, and SEO practitioners who need a machine-readable snapshot of declared structured rating data. This does not verify genuine reviews or infer ratings from stars, page copy, or review widgets.
Try the prefilled example
{"productUrl": "https://api.apify.com/v2/key-value-stores/DHMHtotPcN9CAKXYj/records/complete.html"}
This is a real, publicly accessible Apify-hosted HTML URL, checked reachable on 2026-11-01. Its publisher describes it as a synthetic demonstration page containing Product AggregateRating data with a fictitious 4.5 rating. Not a real retailer and not authentic customer reviews. Its availability/content is maintained by a third party and may change. The buyer should replace it with a permitted public merchant product page after trying the example.
The actual HTTP source HTML could not be fetched directly in the local Python container for this delivery. The public URL was checked through a web retrieval service and the publisher's description. The executable smoke evidence in tests/ uses a separately labelled local HTTP fixture, not the live URL. Its count must not be presented as the count on the hosted page.
Output example
Successful item from the included synthetic local fixture (illustrative, not the live URL's actual review count):
{"url": "https://api.apify.com/v2/key-value-stores/DHMHtotPcN9CAKXYj/records/complete.html","ratingValue": 4.5,"reviewCount": 12,"ratingCount": null,"bestRating": 5.0,"status": "ok","error": null}
Fields are stable: url is the supplied URL; ratingValue and bestRating are JSON numbers or null; reviewCount and ratingCount are nonnegative integers or null. bestRating remains null when unspecified: no assumed five-star scale. At least ratingValue and one of reviewCount or ratingCount must be present as clean numbers.
If the page lacks complete Product AggregateRating JSON-LD, the Actor still writes one plain-language error item instead of guessing:
{"url": "https://www.allbirds.com/products/mens-wool-runners","ratingValue": null,"reviewCount": null,"ratingCount": null,"bestRating": null,"status": "error","error": "No complete Product AggregateRating exists in the page JSON-LD (ratingValue and a count required)."}
The above error is an example of the error shape, not a statement about the currently published Allbirds page.
What it does (and does not do)
- Validates your one HTTPS URL and rejects private hosts, local services, nonstandard ports, redirects, Amazon and eBay.
- Retrieves at most 2 MB of publicly accessible static HTML with a 15-second request timeout.
- Examines
application/ld+jsonscript tags (up to 80), including@graphandProductGroup/Productobjects, for anaggregateRatingobject. - Writes one result to the Apify default dataset through the Apify REST API, or locally under
storage/datasets/default/.
It never reads visible stars/text, microdata, HTML ratings, comments, login-protected data, or JavaScript-rendered review widgets. Malformed JSON-LD blocks are skipped. Multiple products are not scraped in bulk. A page without AggregateRating is not necessarily defective. It doesn't test Google rich-result eligibility or review authenticity. Connection failures are plain-language run errors without tracebacks. DNS checks reduce SSRF risk but are not a full defense against DNS rebinding. No redirects are followed.
Run locally
Python 3.12+; no pip installation required.
cd product-rating-extractorexport ACTOR_INPUT_JSON='{"productUrl":"https://api.apify.com/v2/key-value-stores/DHMHtotPcN9CAKXYj/records/complete.html"}'python src/main.py
Or create storage/key_value_stores/default/INPUT.json with the input object and omit ACTOR_INPUT_JSON. The local Dataset item is written to storage/datasets/default/000000001.json (next unused number when running again).
On Apify, INPUT is read from default key-value storage and results are posted via the standard Dataset REST endpoint using APIFY_DEFAULT_DATASET_ID and APIFY_TOKEN provided by the runtime. No Apify SDK. Runtime storage permissions and network access are required.
Reproduce tests and script-mode smoke evidence
python -m unittest discover -s tests -p 'test_*.py' -vpython tests/smoke.py
tests/smoke.py executes python src/main.py in a subprocess, passes the valid prefilled input via ACTOR_INPUT_JSON, injects a deliberately local HTTP mock via tests/smoke_support/sitecustomize.py, and verifies the JSON Dataset files. This is not an import-only test. It writes tests/smoke_evidence.txt and tests/smoke_dataset.json. On some managed Python environments it uses /usr/bin/python3 via a temporary python PATH alias to ensure the test-only startup hook wins. There is no real external HTTP call in the smoke run.
Store metadata and suggested pricing
- Apify Store category:
ECOMMERCE(E-commerce). Suggested output-type tag: Reviews. - Suggested price: $3 per 1,000 successful rating results ($0.003 per successful result); no charge suggested for
status=erroritems. If configuring a built-in dataset-item event, carefully account for error rows when setting billing. - The suggestion is also recorded in
store_metadata.json. No billing is configured. No Store publishing or Apify run was performed.