# Product Image Checker & Approved Replacement CSV (`byznys-s-jarvisem/my-actor`) Actor

Check product-feed images below 500 x 500 px and export approved replacement URLs matched to exact variant IDs. CSV reports and resumable jobs.

- **URL**: https://apify.com/byznys-s-jarvisem/my-actor.md
- **Developed by:** [Byznys s Jarvisem](https://apify.com/byznys-s-jarvisem) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 audited products

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/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

Check product-feed images below **500 × 500 px** and export approved replacement links matched to exact product variant IDs. Paste your CSV text and the alternative image URLs you have already approved; get a dimension audit and a replacement CSV you can review and merge into your feed.

### Product image checks for CSV feeds

- Inspect PNG, JPEG and WebP image dimensions from your product CSV.
- Keep variant IDs as text, including leading zeros such as `00120`.
- Check the alternative links you provide and match each one to its exact variant ID.
- Download `image-audit.csv` and `proposed-image-links.csv`; the replacement file uses `id,image_link`.
- Resume the same job with its original input while the job records remain available. Already confirmed results are preserved without charging those same items again.

Try **Embedded demo** for eight synthetic rows with zero item event charges. For your own audit, provide the feed, approved alternatives if needed, and the allowed public HTTPS image hostnames.

### Run an audit

1. Run **Embedded demo** to see eight synthetic product rows and the two downloadable CSVs. The demo has zero item charges.
2. Select **Your CSV with HTTPS images** and paste your product CSV with columns `id,image_link`.
3. For replacement suggestions, paste your approved alternatives with columns `id,approved_image_link`. Use one approved link per exact variant ID.
4. Enter the allowed public HTTPS hostnames, including any hosts used by redirects. The Actor checks PNG, JPEG and WebP images.

For your first own-data audit, start with at most **20 product rows**, matching the default `maxItems: 20`. For a larger new audit, increase `maxItems` before starting; the schema allows up to 1,000 rows. Image-request and time limits can prevent some images from being checked, and the spending limit can leave rows unprocessed. Review the row statuses, `limits_triggered`, `billing.job_complete`, `unprocessed_rows` and `billing.stop_reason` before treating the batch as finished.

For example, product `00120` with a 320 × 320 image qualifies for a replacement when its supplied, approved alternative is 1200 × 900. Product `00121` with a 500 × 500 image is marked `keep`. Both dimensions are checked. Duplicate IDs go to review.

### Open available outputs and download audit files

- **Dataset** contains the audit rows, including the original image dimensions, the result and its reason.
- **Audit CSV files** lists `image-audit.csv`, the audit report. Open the listed record to download it. This file list is empty for a closure-only run.
- **Replacement CSV files** lists `proposed-image-links.csv`, with exact product IDs and replacement URLs. Open the listed record to download it. This file list is empty for a closure-only run. Review proposed links before applying them to your feed.
- **`OUTPUT`** summarizes processed rows, replacements and billing. The two CSV files and the summary are also available in the run's default key-value store.

Live audit CSVs also include `billing_status`, `confirmed_charged_event_count` and `charge_run_id`; the embedded demo illustrates audit outcomes without charging items.

### Per-item pricing and resuming

In live mode, each eligible `keep`, `proposed_replacement` or `no_replacement` result can generate one `item-evaluated` event. Audit rows with `status: needs_review` or `status: technical_error` are not billable. See **Pricing** for the rate and `OUTPUT` for confirmed events.

Set **Maximum cost per run** in Apify. A saved result with `complete: true` does not necessarily mean the whole audit finished. Check `billing.job_complete`, `unprocessed_rows` and `billing.stop_reason`. A spending limit can leave rows unprocessed. `billing.confirmed_charged_items_this_run` shows the number of events confirmed for that run.

A separate `billing_status: requires_review` means that a payment outcome is uncertain and may already include a debit. Stop and reconcile it; do not assume the charge is zero or use a fresh job ID to bypass it. To resume confirmed work while job records remain available, keep the original input and `billing.job_id`. Use a fresh job ID only for a genuinely separate audit.

### Close a job before deleting its data

Select **Close a job**, supply the original job ID and leave both CSV inputs empty. Closing records a permanent stop for that job ID in a separate closure registry; it does not delete the stored input or results. A later run with the same ID stops without image downloads or new item charges while that registry is preserved. Closing is not a way to resume an audit. This mode returns the `OUTPUT` summary; the two CSV file lists contain records for audit runs and are empty for closure-only runs. Storage cleanup is a separate authorized operation.

### Preserve the original input when resuming

Resume with the original field set and values and `billing.job_id` from `OUTPUT`. Adding the job ID itself is supported. Reordering JSON object keys is harmless, but changing the CSV text or line breaks, adding an originally omitted option such as `maxItems: 20`, or changing any other input value changes the job fingerprint. Even an explicit value equal to a code default is a different input. Keep the original payload; do not create a fresh job ID to bypass a resume conflict or an uncertain charge.

The legacy `demo: true` switch does not override a non-empty feed CSV or `mode: https_csv`; that combination is rejected. Use `mode: demo` with empty CSV inputs for the embedded demo. CSV limits are measured in UTF-8 bytes, so multibyte text can reach the 2,000,000-byte limit before reaching the same number of characters.

### Stored data and cleanup

Apify holds the submitted run input, including the CSV text, image hosts, limits and any job ID. The Actor writes audit rows and exports to the run dataset and default key-value store. These results include product IDs, image links, dimensions and billing references. The Actor downloads images for inspection; it does not intentionally save the downloaded image binaries as output records.

In live mode, a resumable job also creates a named request queue and key-value store in the customer's Apify account. Their names start with `jarvis-image-` and are derived from the Actor, customer and job IDs. They retain the input binding, audit results and billing intents or receipts. The request queue includes the audit rows and image links; deleting only the output CSVs does not remove those copies. Use the same job ID and original input for a technical resume while these records remain intact.

A separate `jarvis-image-closed-` key-value store is shared by the jobs of the same customer and Actor. Each closure marker contains a hashed job key, the `closed` state and a UTC timestamp. The marker itself contains no raw CSV, product ID or image URL. It remains linked to a job through that key and is not a claim of anonymous storage.

**No automatic 30-day deletion is implemented.** This version has no scheduled cleanup or Actor-defined expiry for the named job records or closure markers. Storage remains subject to the account owner's actions and Apify's applicable retention rules. No fixed deletion deadline is offered by this Actor version.

For an authorized manual cleanup, prevent new runs and wait for active runs of that job to finish or stop before closing it. Verify the saved closure, export any files you need, then remove the relevant run input and outputs and the job's named billing queue and key-value store. Closing alone does not delete those records and does not cancel an audit already running. Keep the separate closure marker if the old job ID must remain blocked. Deleting that marker removes this Actor's persistent protection against reopening that ID; a new job ID represents a separate audit.

Cleanup of Actor records does not establish deletion of Apify's platform logs, account records or backups. Consult the platform's applicable rules for those records. This Actor does not run an automatic deletion service. [Apify storage documentation](https://docs.apify.com/storage)

### Input troubleshooting

#### Before changing an input

The corrections below are for preparing a **new audit**, before work starts. If a job already exists, first preserve its exact original input and `billing.job_id`. Changing CSV bytes, options or line breaks changes the input fingerprint. Do not rename a job or modify its input to bypass a resume conflict or an uncertain `billing_status: requires_review`. Reconcile that existing job first.

The Actor rejects these inputs before it starts image downloads or item charges. A failed platform run can still consume platform resources; zero item events does not mean that the whole run is free. Hostname validation alone does not verify DNS, image access, or redirect availability.

The actual `INPUT` record is the source to keep for a resume. Switching between JSON and Form in Apify Console can add optional fields, such as the legacy `demo: false` flag; compare the field set before starting a technical resume.

#### Fix a new input

| Symptom | Exact source error | What to do |
|---|---|---|
| CSV column names | `feedCsv: expected header id,image_link` | Use the exact header `id,image_link` in that order. Keep IDs as text so leading zeros survive. |
| CSV delimiter | `feedCsv: expected header id,image_link` | Export comma-separated CSV, not semicolon-separated CSV. |
| Extra CSV field | `feedCsv: a record has the wrong number of fields` | Each data row must contain exactly two fields. Quote a field containing a comma instead of adding a third column. |
| Unclosed CSV quote | `feedCsv: malformed CSV` | Repair unclosed quotes or export the CSV again with a CSV-aware editor. |
| Header without products | `feedCsv must contain at least one data row` | Add at least one product data row below the header. |
| Host supplied as URL | `allowedHosts must contain 1 to 20 bare public domain names` | Supply bare public domain names such as `images.example.com`, without `https://`, a path, a port or a wildcard. Include allowed redirect hosts too; this check does not resolve DNS or prove reachability. |
| Legacy demo switch | `demo: true requires demo mode` | For a new customer CSV audit, select `https_csv` and remove the legacy `demo` field or set it to `false`. For an embedded demo, use `demo` mode and empty CSV fields. |
| Maximum rows below input size | `feedCsv: too many rows; increase maxItems or use a smaller CSV` | Before starting a new audit, set `maxItems` to at least the number of input rows within the schema limit, or split the new input into separate audits. The Actor rejects extra rows; it does not silently truncate the CSV. |
| Invalid job identifier | `jobId must contain 1 to 64 ASCII letters, digits, underscores or hyphens` | For a genuinely new audit choose an ID of 1–64 ASCII letters, digits, underscores or hyphens. For a closure or resume, copy the exact original `billing.job_id`; do not invent a replacement ID.  |
| Approved CSV header | `approvedImagesCsv: expected header id,approved_image_link` | The alternatives CSV uses the exact header `id,approved_image_link`, unlike the product feed. Match the variant ID exactly. |

#### When to stop and investigate the existing job

- `OUTPUT.complete: true` confirms output publication, not necessarily `billing.job_complete`. Also inspect `unprocessed_rows` and `billing.stop_reason`.
- `billing_status: requires_review` is an uncertain payment result. Preserve the original job ID and input; do not assume no debit occurred.
- `needs_review` and `technical_error` are audit outcomes, not instructions to apply a replacement. Review the row reason before changing the product feed.
- `job_closed` is a persistent stop while the closure registry is preserved. Closing does not erase data or stop another run already in progress. A closed ID is not resumable.

When reporting an issue in Apify, include the run ID, build and exact error. Redact private CSV content and API tokens. Keep the original input and output in your account for investigation. This Actor has no automatic deletion service.

### Product feed image audit FAQ

#### Does this create or find new product photos?

The Actor checks image dimensions and the approved alternative URLs you supply. It does not generate images or search the web for replacement photos.

#### Can I apply the replacement CSV directly to my store?

Review `proposed-image-links.csv` and merge it into your feed by the exact product variant ID. It contains `id,image_link` columns. The Actor does not sign in to your store or publish changes to your catalog.

#### What happens when an image is large enough?

An image whose width and height are each at least 500 px is marked `keep`. A smaller image gets a checked replacement suggestion when its supplied approved alternative qualifies; otherwise it is reported without a replacement.

#### Can I audit an updated catalog every month?

You can submit each updated catalog as a genuinely new audit, subject to its configured limits and the price shown in Pricing. A new audit is billable. Resuming an existing job is a different operation: preserve that job's exact original input and ID.

#### Does this certify image quality or marketplace compliance?

The current checks concern dimensions, supported image decoding and supplied alternatives. They do not certify sharpness, exposure, copyright or compliance with every marketplace image policy.

### Recover an API result without starting another audit

The generated Python example in the API tab assumes that the call returned a run. With the Python client 3.5, place the following check after that existing call and before reading the dataset. It uses the returned run object; it is not a standalone script and does not submit a run.

```python
## Insert after the original call returns, before reading its dataset.
## This block does not start or retry an Actor run.
if run is None:
    raise RuntimeError(
        "No run was returned. Inspect the original run in Apify Console; "
        "do not submit a replacement audit."
    )

if getattr(run, "status", None) != "SUCCEEDED":
    raise RuntimeError(
        f"Inspect original run {getattr(run, 'id', 'unknown')} before continuing. "
        "Do not start another audit to recover this result."
    )

dataset_id = getattr(run, "default_dataset_id", None)
if not dataset_id:
    raise RuntimeError("No dataset ID returned. Inspect the original run.")

for item in client.dataset(dataset_id).iterate_items():
    print(item)
```

If the call raises an exception or times out before returning a run, this check is not reached. Find that original attempt in your account's Runs page and preserve its run ID, actual `INPUT`, any available `OUTPUT`, and `billing.job_id`. A timeout or missing return value does not establish that no run started or no item was charged. Do not recover by repeating the start call, changing the input, or creating a new job ID.

A `SUCCEEDED` platform status only permits inspecting the saved result. Before treating the audit as complete or merging a replacement CSV, also inspect `OUTPUT.unprocessed_rows`, `billing.job_complete`, `billing.stop_reason`, and any uncertain `billing_status: requires_review`. `OUTPUT.complete` alone is not proof of billing completion. Read the existing run and its available outputs first; a technical resume, where supported, must use that same job ID and exact original input. A closed job cannot be resumed while its closure marker is preserved.

For support, share the run ID, build and error only. Do not paste an API token or private product CSV into a public Issue. This recovery check is not an automatic refund, deletion, or resume service.

# Actor input Schema

## `mode` (type: `string`):

Demo shows eight embedded sample rows. If mode is omitted, non-empty feedCsv selects https_csv; otherwise the effective mode is demo. Close job requires jobId and empty CSV inputs. It marks that job closed; it does not delete stored data.

## `feedCsv` (type: `string`):

Paste UTF-8 CSV text, not a file path or CSV URL. Required header: id,image_link. IDs stay exact text, including leading zeros. Maximum 2,000,000 UTF-8 bytes. Keep the original CSV text and line breaks when resuming.

## `approvedImagesCsv` (type: `string`):

Optional CSV text with header id,approved_image_link. Supply one approved link per exact variant ID. Maximum 4,000 rows and 2,000,000 UTF-8 bytes. Leave empty or omit for audit only. Preserve the original value or omission when resuming.

## `allowedHosts` (type: `array`):

For Your CSV, enter 1–20 exact public DNS hosts, such as placehold.co. No protocol, path, wildcard, port, or IP address. Redirect hosts must also appear here.

## `maxItems` (type: `integer`):

Reject a larger CSV before downloading. The code uses 20 when omitted; it never silently truncates the feed.

## `maxImageRequests` (type: `integer`):

Bounds fetch attempts and actual HTTP header sends, including redirects and transport retries. Default 40.

## `maxTotalImageMiB` (type: `integer`):

Application image bytes read, not a precise platform transfer-cost meter. Default 32 MiB. Each image also has a 16 MB and 16 million pixel limit.

## `maxDurationSeconds` (type: `integer`):

Internal image-fetching deadline. Default 45 seconds. Set the platform run timeout higher to leave time for startup and saving the result.

## `demo` (type: `boolean`):

Legacy compatibility only: true is accepted only when the effective mode is demo. It does not override non-empty feedCsv or mode=https_csv. Omit this field for normal use.

## `jobId` (type: `string`):

Omit for a new audit identified by its Apify run ID. To resume, use billing.job_id from OUTPUT and preserve all other original fields and CSV text. Adding an omitted default changes the input fingerprint. Close job requires this ID and empty CSVs. Use a fresh ID only for a genuinely separate audit.

## Actor input object example

```json
{
  "mode": "demo",
  "feedCsv": "id,image_link\n00120,https://placehold.co/320x320/png\n00121,https://placehold.co/500x500/png\n",
  "approvedImagesCsv": "id,approved_image_link\n00120,https://placehold.co/1200x900/png\n",
  "allowedHosts": [
    "placehold.co"
  ],
  "maxItems": 20,
  "maxImageRequests": 40,
  "maxTotalImageMiB": 32,
  "maxDurationSeconds": 45
}
```

# Actor output Schema

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

Audit rows. Empty for closure-only runs.

## `auditCsv` (type: `string`):

List of available image-audit.csv records; empty for closure-only runs. Open the returned recordPublicUrl to download an existing record.

## `replacementsCsv` (type: `string`):

List of available proposed-image-links.csv records; empty for closure-only runs. Open the returned recordPublicUrl to download an existing record.

## `summary` (type: `string`):

Read OUTPUT.billing.job_complete, unprocessed_rows and stop_reason; complete is the publication flag. A requires_review payment outcome may already include a debit.

# 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 = {
    "mode": "demo",
    "maxItems": 20,
    "maxImageRequests": 40,
    "maxTotalImageMiB": 32,
    "maxDurationSeconds": 45
};

// Run the Actor and wait for it to finish
const run = await client.actor("byznys-s-jarvisem/my-actor").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 = {
    "mode": "demo",
    "maxItems": 20,
    "maxImageRequests": 40,
    "maxTotalImageMiB": 32,
    "maxDurationSeconds": 45,
}

# Run the Actor and wait for it to finish
run = client.actor("byznys-s-jarvisem/my-actor").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 '{
  "mode": "demo",
  "maxItems": 20,
  "maxImageRequests": 40,
  "maxTotalImageMiB": 32,
  "maxDurationSeconds": 45
}' |
apify call byznys-s-jarvisem/my-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,byznys-s-jarvisem/my-actor"
        }
    }
}
```

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/lAgwO0qjsEZ0pt2gM/builds/a565EhBkSxf2fNRdM/openapi.json
