{
  "openapi": "3.0.1",
  "info": {
    "title": "🏷️ MAP Violation Detector - Reseller Price Enforcement",
    "description": "🏷️ Match retailer listings to your brand catalogue and flag Minimum Advertised Price (MAP) violations, with enforcement-ready evidence. ✅ Brand/model/size/pack hard disqualifiers block wrong-SKU matches. ⚠️ Low-confidence matches are reported unmatched, never accused.",
    "version": "1.0",
    "x-build-id": "DkQLOsyH2JdHBbiCO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/that_red_bird~map-violation-detector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-that_red_bird-map-violation-detector",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/that_red_bird~map-violation-detector/runs": {
      "post": {
        "operationId": "runs-sync-that_red_bird-map-violation-detector",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/that_red_bird~map-violation-detector/run-sync": {
      "post": {
        "operationId": "run-sync-that_red_bird-map-violation-detector",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "catalogue"
        ],
        "properties": {
          "catalogue": {
            "title": "Brand catalogue",
            "type": "array",
            "description": "Your product catalogue: one object per SKU with product identity fields (title/name, brand, model/mpn/sku, gtin/ean/upc/asin, size, packCount) and the MAP price under \"map\" (or \"mapPrice\"). Prices can be decimals — only this input schema's own numeric fields (thresholds, tolerances) are restricted to whole numbers, not your catalogue data. Keep all prices in one currency-unit convention (e.g. always dollars, or always cents) across catalogue and listings.",
            "default": [
              {
                "sku": "ACME-500",
                "title": "Acme Hydro Flask 500ml",
                "brand": "Acme",
                "size": "500ml",
                "map": 24.99,
                "currency": "USD"
              }
            ]
          },
          "catalogueDatasetId": {
            "title": "Catalogue dataset ID",
            "type": "string",
            "description": "Optional Apify dataset ID to load additional catalogue rows from, merged with \"catalogue\". Rows must have the same shape described above."
          },
          "listings": {
            "title": "Observed listings",
            "type": "array",
            "description": "Retailer listings to check: one object per listing with retailer, title, price (number, same currency-unit convention as the catalogue), url, and optionally currency and timestamp.",
            "default": [
              {
                "retailer": "discount-outlet.example",
                "title": "Acme Hydro Flask 500ml Bottle",
                "price": 17.99,
                "url": "https://discount-outlet.example/p/123",
                "currency": "USD"
              }
            ]
          },
          "listingsDatasetId": {
            "title": "Listings dataset ID",
            "type": "string",
            "description": "Optional Apify dataset ID to load additional observed listings from, merged with \"listings\". Rows must have the same shape described above."
          },
          "listingUrls": {
            "title": "Listing URLs to scrape",
            "type": "array",
            "description": "Optional: product page URLs to scrape directly (no selector needed — JSON-LD / microdata / common price containers / text-scan fallback detect the price and title). Each entry is a URL string, or an object { \"url\", \"retailer\" }. Scraped rows are merged with \"listings\" before matching."
          },
          "matchThreshold": {
            "title": "Match confidence threshold (0-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum match confidence (0-100) required to treat a listing as the same product as a catalogue item. Below this, the listing is reported as \"unmatched\" rather than ever being accused of a violation — a wrong-SKU match is a real legal risk, not just a bad row.",
            "default": 80
          },
          "toleranceAbsolute": {
            "title": "Absolute tolerance below MAP",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Amount below MAP that is still tolerated (not flagged as a violation), in the SAME currency-unit convention you used for catalogue/listing prices (e.g. both in whole dollars, or both in cents — pick one convention and use it everywhere, since this field must be a whole number). 0 disables the absolute tolerance.",
            "default": 0
          },
          "tolerancePercent": {
            "title": "Percent tolerance below MAP (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Percent below MAP that is still tolerated (not flagged as a violation), e.g. 2 means a listing up to 2% under MAP is not a violation. 0 disables the percent tolerance.",
            "default": 0
          },
          "toleranceMode": {
            "title": "How tolerances combine",
            "enum": [
              "either",
              "both"
            ],
            "type": "string",
            "description": "\"either\" (default): a listing is tolerated if it satisfies the absolute OR the percent tolerance (more lenient). \"both\": it must satisfy every tolerance that is configured (non-zero) to be tolerated (stricter).",
            "default": "either"
          },
          "requireSameCurrency": {
            "title": "Require matching currency",
            "type": "boolean",
            "description": "When true (default), a listing whose currency differs from its matched catalogue item's currency is reported as \"unmatched\" (reason: currency-mismatch) instead of compared — there is no live FX conversion, so comparing across currencies would silently produce a wrong verdict.",
            "default": true
          },
          "weights": {
            "title": "Matching field weights",
            "type": "object",
            "description": "Optional override of the matching engine's field weights, e.g. { \"brand\": 3, \"title\": 2, \"size\": 2, \"pack\": 1 }. Leave empty to use the defaults. Size and pack-count mismatches are hard disqualifiers regardless of these weights — see README."
          },
          "maxBlockSize": {
            "title": "Max candidates per blocking key",
            "minimum": 10,
            "maximum": 50000,
            "type": "integer",
            "description": "Safety cap: if more than this many catalogue items share one blocking key (same brand, for example), that block is skipped rather than compared exhaustively, to keep large catalogues fast.",
            "default": 1000
          },
          "concurrency": {
            "title": "Scrape concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many listing URLs (from \"listingUrls\") to fetch in parallel.",
            "default": 5
          },
          "includeCompliant": {
            "title": "Include compliant rows in output",
            "type": "boolean",
            "description": "Push a row for every listing found compliant with MAP, not just violations. Off by default so the dataset stays focused on what needs action.",
            "default": false
          },
          "includeUnmatched": {
            "title": "Include unmatched rows in output",
            "type": "boolean",
            "description": "Push a row for every listing that could not be matched to a catalogue item with enough confidence, so you can review near-misses. On by default — an unmatched listing might still be worth a human look.",
            "default": true
          },
          "trackRepeatOffenders": {
            "title": "Track repeat offenders across runs",
            "type": "boolean",
            "description": "When true, cumulative per-retailer violation counts are persisted in a named key-value store across runs (see \"Repeat offender store name\"), and each output row is enriched with the retailer's running totals.",
            "default": false
          },
          "repeatOffenderStoreName": {
            "title": "Repeat offender store name",
            "type": "string",
            "description": "Name of the Apify key-value store used to persist cumulative per-retailer violation counts when \"Track repeat offenders across runs\" is on. Use the same name across runs you want tracked together.",
            "default": "map-violation-detector-repeat-offenders"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional Apify proxy configuration used when scraping \"listingUrls\"."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}