{
  "openapi": "3.0.1",
  "info": {
    "title": "Map Compliance Monitor",
    "description": "Scrapes advertised prices from retailer product pages and detects Minimum Advertised Price (MAP) violations. Outputs a compliance report with violation details, retailer risk levels, and category breakdowns.",
    "version": "0.1",
    "x-build-id": "61tHuNBdWMUTjQ7lK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/e-commerce~map-compliance-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-e-commerce-map-compliance-monitor",
        "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/e-commerce~map-compliance-monitor/runs": {
      "post": {
        "operationId": "runs-sync-e-commerce-map-compliance-monitor",
        "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/e-commerce~map-compliance-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-e-commerce-map-compliance-monitor",
        "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": [
          "mapPolicy"
        ],
        "properties": {
          "brand": {
            "title": "Brand",
            "type": "string",
            "description": "Your brand name, shown in the Executive Summary of the compliance report (e.g. 'TechGear Electronics'). Optional but recommended for branded reports and emails.",
            "default": ""
          },
          "mapPolicy": {
            "title": "MAP Policy",
            "type": "array",
            "description": "Your brand's MAP policy as a JSON array of product entries. The actor reads each entry, visits the retailer URLs listed under it, scrapes the advertised price, and compares it against the MAP price. Each entry must include at minimum: sku, productName, mapPrice, and a retailers array with at least one {name, url} object pointing to the retailer product page. Example: [{\"sku\":\"TG-1001\",\"productName\":\"Pro Wireless Headphones\",\"mapPrice\":299.99,\"currency\":\"USD\",\"category\":\"Audio\",\"retailers\":[{\"name\":\"ElectroMart\",\"url\":\"https://electromart.com/product/tg1001\"}]}]. Accepts any retailer URL — the actor uses a universal price-extraction strategy that works across most e-commerce sites. Add as many SKUs and retailers as needed; the actor processes them concurrently."
          },
          "matchingStrategy": {
            "title": "Matching Strategy",
            "enum": [
              "SKU",
              "UPC",
              "EAN",
              "ASIN"
            ],
            "type": "string",
            "description": "The product identifier field used to match scraped pages back to MAP policy entries. The actor uses this field when logging and grouping violations — it does not affect which URLs are scraped (URLs are supplied directly in the mapPolicy). Choose the identifier your brand uses internally: SKU is most common for direct-to-retailer relationships, ASIN for Amazon, UPC/EAN for broader retail. Example: select SKU if your MAP policy file uses internal part numbers like TG-1001. Changing this field only affects how violations are keyed in the output; it has no impact on accuracy.",
            "default": "SKU"
          },
          "alertThreshold": {
            "title": "Alert Threshold (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "The minimum violation percentage required for a price to be reported as a MAP violation. The actor calculates violation% as (mapPrice − advertisedPrice) / mapPrice × 100. Only prices that fall below MAP by at least this percentage are included in the violations list. Example: set to 5 to ignore minor rounding differences and only flag prices that are 5% or more below MAP. Set to 0 (default) to catch every penny below MAP. Recommended: 0–3% for strict enforcement, 5% for high-volume monitoring where minor discounts are tolerated.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of retailer pages scraped simultaneously. The actor opens this many pages in parallel to speed up the run. Example: with 50 retailers and maxConcurrency 10, the actor processes ~10 pages at a time. Higher values finish faster but increase memory usage and the risk of triggering rate limits on retailer sites. Lower values are more polite and less likely to get blocked. Recommended: 5–10 for most brand monitoring use cases. Do not set above 20 unless you have residential proxies configured.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for scraping retailer pages. Using proxies reduces the chance of being blocked by retailers, especially for high-volume monitoring runs. Example: enable Apify Residential Proxies to rotate IPs automatically across requests. Without proxies the actor uses your server's IP directly, which works for low-volume runs but may get blocked on large catalogs or aggressive retailers. Recommended: enable residential proxies for production monitoring runs with more than 50 SKUs."
          },
          "resendApiKey": {
            "title": "Resend API key (optional)",
            "type": "string",
            "description": "Resend API key to email the HTML compliance report after each run (for weekly/monthly delivery). Leave empty to skip email — the report is always saved to the key-value store as MAP_COMPLIANCE_REPORT_HTML. Get a key at resend.com."
          },
          "recipientEmails": {
            "title": "Recipient emails (optional)",
            "type": "array",
            "description": "Email addresses to send the compliance report to. Requires a Resend API key. Leave empty to skip email.",
            "default": [],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}