{
  "openapi": "3.0.1",
  "info": {
    "title": "Lead Scoring Engine — ICP Score Leads 0-100",
    "description": "Score leads 0-100 against your Ideal Customer Profile across 6 weighted dimensions: industry, company size, services, contact presence, intent signals, and data completeness. Returns A-F grades + per-dimension notes. No API calls. $0.03/lead.",
    "version": "1.0",
    "x-build-id": "DtGBvEnFh4whsjL2H"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~lead-scoring-engine/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-lead-scoring-engine",
        "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/ryanclinton~lead-scoring-engine/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-lead-scoring-engine",
        "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/ryanclinton~lead-scoring-engine/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-lead-scoring-engine",
        "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": {
          "leads": {
            "title": "Leads (inline)",
            "type": "array",
            "description": "Array of lead objects to score. Each object should have fields like domain, companyName, industry, services, emails, contacts, etc. Use this OR datasetId — not both.",
            "default": [
              {
                "domain": "brightedge.com",
                "companyName": "BrightEdge",
                "industry": "Marketing Agency",
                "services": [
                  "SEO",
                  "Content Marketing",
                  "Analytics"
                ],
                "companySize": "51-200",
                "emails": [
                  "hello@brightedge.com"
                ],
                "contacts": [
                  {
                    "name": "Sarah Chen",
                    "title": "Head of SEO",
                    "email": "s.chen@brightedge.com"
                  }
                ],
                "phones": [
                  "+1 415-555-0182"
                ],
                "address": "1 Market St, San Francisco, CA",
                "rating": 4.7,
                "reviewCount": 143,
                "hasChatWidget": true,
                "hasContactForm": true,
                "techStack": [
                  "HubSpot",
                  "Google Analytics",
                  "Salesforce"
                ],
                "foundedYear": 2011,
                "description": "Enterprise SEO and content performance platform for B2B companies."
              }
            ]
          },
          "datasetId": {
            "title": "Dataset ID (from upstream actor)",
            "type": "string",
            "description": "Apify dataset ID to load leads from. Use this instead of inline leads when chaining with another actor in a pipeline."
          },
          "targetIndustries": {
            "title": "Target Industries",
            "type": "array",
            "description": "Industries that match your Ideal Customer Profile. Examples: 'Marketing Agency', 'SEO', 'Web Design', 'SaaS', 'Ecommerce'. Fuzzy matching and synonyms are applied automatically.",
            "default": [
              "Marketing Agency",
              "Digital Agency"
            ],
            "items": {
              "type": "string"
            }
          },
          "targetCompanySizes": {
            "title": "Target Company Sizes",
            "type": "array",
            "description": "Employee count bands that match your ICP. Use standard bands: '1-10', '11-50', '51-200', '201-500', '501-1000', '1001-5000'. Aliases like 'small', 'mid-market', 'enterprise' are also accepted.",
            "default": [
              "11-50",
              "51-200"
            ],
            "items": {
              "type": "string"
            }
          },
          "targetServices": {
            "title": "Target Services",
            "type": "array",
            "description": "Services your ideal clients offer or use. Examples: 'SEO', 'PPC', 'Web Design', 'Content Marketing'. Used to check lead.services field.",
            "default": [
              "SEO",
              "Content Marketing"
            ],
            "items": {
              "type": "string"
            }
          },
          "targetTechStack": {
            "title": "Target Tech Stack",
            "type": "array",
            "description": "Technologies your ideal clients use. Examples: 'HubSpot', 'Shopify', 'WordPress', 'Salesforce'. Used to check lead.techStack field.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "weightIndustry": {
            "title": "Weight: Industry Match",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Points allocated to the Industry Match dimension. Defaults to 25. All 6 weights must sum to 100 — if they don't, they are normalised automatically.",
            "default": 25
          },
          "weightCompanySize": {
            "title": "Weight: Company Size Match",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Points allocated to the Company Size Match dimension. Default: 20.",
            "default": 20
          },
          "weightServices": {
            "title": "Weight: Services Match",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Points allocated to the Services Match dimension. Default: 20.",
            "default": 20
          },
          "weightContactPresence": {
            "title": "Weight: Contact Presence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Points allocated to the Contact Presence dimension (emails, phones, named contacts). Default: 15.",
            "default": 15
          },
          "weightIntentSignals": {
            "title": "Weight: Intent Signals",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Points allocated to the Intent Signals dimension (reviews, hiring, chat widget). Default: 10.",
            "default": 10
          },
          "weightDataCompleteness": {
            "title": "Weight: Data Completeness",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Points allocated to the Data Completeness dimension (how many fields are populated). Default: 10.",
            "default": 10
          },
          "minScoreToInclude": {
            "title": "Minimum Score to Include",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Leads with an ICP score below this threshold are excluded from the output dataset. Set to 0 to keep all leads. Set to 65 to keep only B+ leads.",
            "default": 0
          },
          "outputSortedByScore": {
            "title": "Sort Output by Score (Highest First)",
            "type": "boolean",
            "description": "When enabled, the output dataset is sorted by icpScore descending so the best leads appear first.",
            "default": true
          },
          "maxLeads": {
            "title": "Maximum Leads to Score",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety cap on the total number of leads processed. Prevents runaway costs when datasetId points to a very large dataset. Default: 10000.",
            "default": 10000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}