{
  "openapi": "3.0.1",
  "info": {
    "title": "Business List Quality & Change Detection",
    "description": "Clean supplied JSON or CSV business lists, flag duplicate candidates and compare snapshots before CRM imports. Includes branch-aware matching and review reasons.",
    "version": "0.3",
    "x-build-id": "N8DjcUbhr5LAPC6SF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/emredurukan~business-list-quality/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-emredurukan-business-list-quality",
        "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/emredurukan~business-list-quality/runs": {
      "post": {
        "operationId": "runs-sync-emredurukan-business-list-quality",
        "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/emredurukan~business-list-quality/run-sync": {
      "post": {
        "operationId": "run-sync-emredurukan-business-list-quality",
        "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",
        "properties": {
          "currentRecords": {
            "title": "Current business records",
            "maxItems": 5000,
            "type": "array",
            "description": "JSON array of business objects. Use this OR currentCsv, never both. At most maxRecords rows, with a hard ceiling of 5,000. All supplied records, including duplicates and invalid rows, count toward input-record charges. An empty array produces no dataset rows but still incurs the completed-analysis fee and any previous-record charges."
          },
          "currentCsv": {
            "title": "Current business records as CSV",
            "type": "string",
            "description": "CSV text including a header row. Use this OR currentRecords. Match columns using fieldMap when their names differ from canonical fields. Parsed business records count toward input-record charges; headers and skipped blank lines do not."
          },
          "previousRecords": {
            "title": "Previous snapshot as JSON",
            "maxItems": 5000,
            "type": "array",
            "description": "Optional previous snapshot, supplied in the same format as currentRecords. Omit for a baseline check. [] means compare against an explicitly empty snapshot. Do not combine with previousCsv. Every supplied previous record counts toward input-record charges, including records absent from the current snapshot. Dataset results describe current rows only; absent previous rows are not reported as deleted."
          },
          "previousCsv": {
            "title": "Previous snapshot as CSV",
            "type": "string",
            "description": "Optional CSV snapshot including a header row. Do not combine with previousRecords. Each snapshot is limited by maxRecords; the combined hard ceiling is 10,000 rows. Parsed previous records count toward input-record charges even when absent from the current snapshot. Dataset results describe current rows only."
          },
          "fieldMap": {
            "title": "Map canonical fields to source columns",
            "type": "object",
            "description": "Canonical field to input column mapping, for example {\"id\":\"place_id\",\"name\":\"title\"}. Canonical fields: id, name, website, phone, country, address, city, postalCode, branchId. The same mapping applies to both snapshots. Unmapped fields use canonical column names."
          },
          "countryCode": {
            "title": "Default phone country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Optional supported two-letter phone-region code, for example TR or US, used for national phone-number parsing. This does not verify reachability or ownership."
          },
          "matchKey": {
            "title": "Snapshot matching key",
            "enum": [
              "id",
              "website",
              "phone"
            ],
            "type": "string",
            "description": "Canonical key used to match rows across snapshots. A stable unique id is recommended. Duplicate or missing keys are reported rather than silently matched.",
            "default": "id"
          },
          "compareFields": {
            "title": "Fields compared between snapshots",
            "uniqueItems": true,
            "type": "array",
            "description": "Canonical fields to compare after normalization. Contact values are still omitted from output unless includeContactDetails is true.",
            "items": {
              "type": "string",
              "enum": [
                "id",
                "name",
                "website",
                "phone",
                "country",
                "address",
                "city",
                "postalCode",
                "branchId"
              ]
            },
            "default": [
              "name",
              "website",
              "phone",
              "country",
              "address",
              "city",
              "postalCode",
              "branchId"
            ]
          },
          "includeContactDetails": {
            "title": "Include normalized contact details in output",
            "type": "boolean",
            "description": "Default false omits phone, street address and postal code values from output records. Names, business IDs, websites, cities and other allowed fields may still identify a business. Supplied contact fields are still sent over HTTPS to Cloudflare for analysis. This option filters output; it does not anonymize input or remove uploaded Actor input from Apify storage.",
            "default": false
          },
          "maxRecords": {
            "title": "Maximum rows per snapshot",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard validation limit for EACH snapshot, from 1 to 5,000. Oversized input fails before output writes; rows are never silently truncated.",
            "default": 5000
          },
          "deleteInputOnSuccess": {
            "title": "Request input deletion after output storage",
            "type": "boolean",
            "description": "Default false retains input under the platform's storage policy. True requests best-effort removal of the run's input record after a successful run. Check SUMMARY.privacy for the actual result. This does not erase datasets, platform copies, backups, logs or previous runs; failed or interrupted runs may retain input.",
            "default": false
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}