# Shopify Green Claims Evidence Review (`practical_ai_lab_jp/pal-shopify-sustainability-claims-evidence-review`) Actor

Ranks vague eco-friendly, recycled and carbon-neutral product claims on a Shopify store and flags new ones across runs.

- **URL**: https://apify.com/practical_ai_lab_jp/pal-shopify-sustainability-claims-evidence-review.md
- **Developed by:** [Practical AI Lab](https://apify.com/practical_ai_lab_jp) (community)
- **Categories:** E-commerce, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 review completeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Shopify Green Claims Evidence Review

Review the public product listings of one Shopify store for environmental claims such as "eco-friendly", "recycled", "carbon neutral" or "biodegradable", and see which ones come with visible evidence and which ones do not. The Actor builds a ranked review queue with the exact quote for each claim, remembers what it found, and on later runs tells you which claims are new or have lost their supporting evidence.

It is built for retail compliance, sustainability and brand teams who need to know where to look first in a catalog that is too large to read by hand.

> This Actor prioritises wording for human review. It is **not legal advice** and does not decide whether any claim is compliant.

### Start with one URL

The only required input is the store address.

```json
{
  "storeUrl": "https://www.allbirds.com"
}
```

Replace the example with a store you are permitted to review. Only the domain is used; paths and query strings are ignored.

**First run.** The Actor reads the store's public product feed, detects claims, ranks them, and saves a baseline for that domain. The dataset starts with a `BASELINE_CREATED` record that states this explicitly, followed by the ranked review queue, repeated-wording clusters and hotspots. Nothing can be called "new" yet because there is nothing to compare against.

**Later runs.** The Actor compares the current listings with the saved baseline. The dataset then holds a `RUN_SUMMARY`, one `CLAIM_CHANGE` record per change, a short sample of the top-ranked queue items, clusters and hotspots. The complete queue is always available as `REVIEW_QUEUE_JSON` and `REVIEW_QUEUE_CSV` in the run's key-value store.

#### Scheduling repeat runs

The Actor does not schedule itself and does not send alerts. To compare the store regularly, create an Apify Schedule for this Actor (Console, Schedules, add a new schedule, select this Actor) with the same input, for example weekly. Until you create a schedule, nothing runs automatically. If you want notifications, add an Apify integration or webhook to the Actor or schedule yourself; none is configured here.

Each run needs the same `stateStoreName` (default `pal-green-claims-review-state`) so the baseline can be found. The baseline lives in a named key-value store in your Apify account, one record per store domain, because a run's default key-value store is not shared between runs.

### Four buyer outcomes in one run

All outputs are joined by product and claim, and every row carries a severity so the same ordering applies everywhere.

1. **Ranked review queue** (`REVIEW_QUEUE_ITEM`): every detected claim with its quote, evidence status, severity score, a product-level risk score and a suggested next step. Also exported as JSON and CSV.
2. **Change alerts across runs** (`CLAIM_CHANGE`): `NEW_VAGUE_CLAIM`, `NEW_CLAIM_WITH_EVIDENCE`, `EVIDENCE_LOST`, `EVIDENCE_ADDED` and `CLAIM_REMOVED`, ordered by priority.
3. **Repeated-wording clusters** (`WORDING_CLUSTER`): the same sentence reused across several products, so one template or supplier-data fix can clear many rows.
4. **Hotspots** (`HOTSPOT`): vendors, product types and claim categories with the most flagged claims, each with a sample-size note when the group is small.

### How claims are judged

Claims are grouped into categories: generic eco-friendly wording, sustainability wording, recycled content, end-of-life (recyclable, biodegradable, compostable), carbon and climate, waste and plastic, and organic or sourcing. You can add your own phrases with `extraClaimTerms`.

For each claim the Actor looks in the same sentence and the adjacent sentences for evidence:

| Evidence status | Meaning |
| --- | --- |
| `NAMED_CERTIFICATION` | A recognised scheme relevant to that claim type is named next to the claim. |
| `QUANTIFIED` | A percentage or amount is stated next to the claim. |
| `EVIDENCE_ELSEWHERE` | A relevant scheme is named elsewhere in the listing but not next to the claim. |
| `UNSUPPORTED` | No named scheme or figure was found. |

Severity is a 0-100 score. Generic and carbon claims start higher than specific ones, claims in the product title score higher, absolute wording such as "100%" or "zero" without support raises the score, and evidence lowers it. Bands: HIGH 65 and above, MEDIUM 40 and above, LOW 20 and above, otherwise INFO. You can add your own certification or report names with `extraEvidenceTerms`.

### Illustrative output

The following shows the shape of the records. The values are made up for illustration and are not results from a real store.

```json
{
  "recordType": "REVIEW_QUEUE_ITEM",
  "rank": 1,
  "severity": "HIGH",
  "severityScore": 78,
  "changeStatus": "BASELINE",
  "productTitle": "Carbon Neutral Water Bottle",
  "claimCategory": "CARBON_CLIMATE",
  "claimPhrase": "carbon neutral",
  "evidenceStatus": "UNSUPPORTED",
  "quote": "Carbon Neutral Water Bottle",
  "recommendedAction": "No certification or specific figure was found near this claim. ..."
}
```

### Input

| Field | Default | Purpose |
| --- | --- | --- |
| `storeUrl` | required | One HTTPS storefront URL. |
| `maxProducts` | 1000 | Products reviewed per run (maximum 5000). |
| `maxPages` | 8 | Feed pages of 250 products requested per run (maximum 20). |
| `minReportSeverity` | LOW | Lowest severity included in the queue. |
| `maxQueueItems` | 200 | Cap on exported queue items. |
| `sampleQueueSize` | 10 | Queue items in the dataset on repeat runs. |
| `extraClaimTerms` | none | Your own claim phrases. |
| `extraEvidenceTerms` | none | Your own evidence names. |
| `resetBaseline` | false | Discard the saved baseline and start again. |
| `requestDelaySecs` | 1 | Minimum pause between requests. |
| `requestTimeoutSecs` | 20 | Timeout per request. |
| `stateStoreName` | pal-green-claims-review-state | Named key-value store holding baselines. |

### Safety and access rules

- Only the public `/products.json` feed of the store you enter is requested.
- `robots.txt` is fetched and checked for this Actor's user agent before every request to a host, including after redirects. A missing `robots.txt` (404 or 410) is treated as no restrictions. A disallow rule, an authorisation error, a server error or an unreadable file stops the run.
- Only HTTPS on port 443 is accepted. IP addresses, internal host names and URLs with credentials are rejected. Every resolved address must be public, redirects are re-validated, and connections are made to the validated address.
- Requests are bounded by page count, product count, response size, timeouts, a run-time budget and a delay (a longer `Crawl-delay` is honoured up to 10 seconds).
- No login, no proxies, no contact details or personal data are collected.

### Limitations and sample-size caveats

- Only the product title, description, tags, vendor and type from the public feed are read. Images, linked documents, certificate pages, metafields and theme-only text are not inspected, and unpublished products are invisible.
- Detection is English-only phrase matching. Paraphrases and translations are missed, and some matches are false positives (for example "organic" used in another sense).
- `QUANTIFIED` means a number appears near the claim, not that the number is correct. `NAMED_CERTIFICATION` means a scheme is named, not that a valid certificate exists. Always check supplier documents.
- Stores can disable or restrict the feed or use password protection; the run then fails with a clear error.
- If the catalog is larger than your limits, products are read in feed order and the run reports `LIMIT_REACHED`. Counts describe only the reviewed subset. A run that stops on an error reports `PARTIAL_ERROR`.
- Results from small catalogs are indicative only. The summary adds a note when fewer than 30 products are reviewed or fewer than five claims are found, and hotspot rows with fewer than five products are labelled.
- Change detection needs at least two runs. It compares product IDs and claim wording; a product that is unpublished appears as `CLAIM_REMOVED` with reason `PRODUCT_NOT_IN_FEED`. If the previous baseline covered only part of the catalog, products first seen now are marked `productNewlySeen`.
- The stored baseline holds at most 5000 claims and 5000 product IDs per domain.

### Billing

The Actor reports one `review-completed` event only after a run has read the feed and saved its baseline. Blocked, failed, partial or unsaved runs never report it. Pricing itself is set by the publisher in the Apify Console and is not part of this code.

### Development

The tests run offline with the standard library:

```
python -m unittest discover -s tests -t .
```

Source layout: `src/safety.py` (URL and address checks), `src/robots.py`, `src/fetcher.py` (bounded requests), `src/feed.py` (feed pages and products), `src/claims.py` (detection and evidence), `src/state.py` and `src/diff.py` (baseline and changes), `src/outputs.py` (queue, clusters, hotspots, CSV), `src/review.py` (pipeline) and `src/runner.py` (Actor flow).

# Actor input Schema

## `storeUrl` (type: `string`):

One HTTPS storefront URL, for example https://your-store.com. Only the domain is used; the public /products.json feed is read if the store's robots.txt allows it. Review only stores you are permitted to analyse.

## `maxProducts` (type: `integer`):

Upper bound on products reviewed per run. Larger catalogs are read in feed order and reported as LIMIT_REACHED.

## `maxPages` (type: `integer`):

Upper bound on feed pages (250 products each) requested per run.

## `minReportSeverity` (type: `string`):

Claims below this level are still counted in the summary but left out of the queue.

## `maxQueueItems` (type: `integer`):

Cap on ranked claims exported to the dataset (first run), the JSON and the CSV.

## `sampleQueueSize` (type: `integer`):

On repeat runs the dataset holds the changes plus this many top-ranked queue items. The full queue is always saved as REVIEW_QUEUE_JSON and REVIEW_QUEUE_CSV.

## `extraClaimTerms` (type: `array`):

Your own wording to treat as an environmental claim, for example 'planet first'. Up to 20 phrases.

## `extraEvidenceTerms` (type: `array`):

Certification or report names to count as evidence when they appear near a claim, for example 'Acme Eco Audit'. Up to 20 names.

## `resetBaseline` (type: `boolean`):

Discard the saved baseline for this store and create a new one from this run.

## `requestDelaySecs` (type: `number`):

Minimum pause between requests to the store. A longer Crawl-delay in robots.txt is honoured up to 10 seconds.

## `requestTimeoutSecs` (type: `integer`):

Timeout for each request.

## `stateStoreName` (type: `string`):

Name of the key-value store that keeps one baseline per store domain. Keep the default unless you need separate baselines.

## Actor input object example

```json
{
  "storeUrl": "https://www.allbirds.com",
  "maxProducts": 1000,
  "maxPages": 8,
  "minReportSeverity": "LOW",
  "maxQueueItems": 200,
  "sampleQueueSize": 10,
  "resetBaseline": false,
  "requestDelaySecs": 1,
  "requestTimeoutSecs": 20,
  "stateStoreName": "pal-green-claims-review-state"
}
```

# Actor output Schema

## `results` (type: `string`):

Download rows from the latest run in JSON/CSV.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "storeUrl": "https://www.allbirds.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("practical_ai_lab_jp/pal-shopify-sustainability-claims-evidence-review").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "storeUrl": "https://www.allbirds.com" }

# Run the Actor and wait for it to finish
run = client.actor("practical_ai_lab_jp/pal-shopify-sustainability-claims-evidence-review").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "storeUrl": "https://www.allbirds.com"
}' |
apify call practical_ai_lab_jp/pal-shopify-sustainability-claims-evidence-review --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,practical_ai_lab_jp/pal-shopify-sustainability-claims-evidence-review"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BTLu3E5b9yU1ol7f6/builds/pxHwPC9rsE3bK3eiq/openapi.json
