{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Website Lead Scorer",
    "description": "Post-process Google Maps Scraper datasets and local business lists. Extract visible emails, phones and social links, score each lead, and output CRM/n8n-ready records with offers, sales angles and next actions.",
    "version": "0.1",
    "x-build-id": "6o9B9P94aq5DrSPQr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/market_radar_tools~google-maps-website-lead-scorer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-market_radar_tools-google-maps-website-lead-scorer",
        "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/market_radar_tools~google-maps-website-lead-scorer/runs": {
      "post": {
        "operationId": "runs-sync-market_radar_tools-google-maps-website-lead-scorer",
        "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/market_radar_tools~google-maps-website-lead-scorer/run-sync": {
      "post": {
        "operationId": "run-sync-market_radar_tools-google-maps-website-lead-scorer",
        "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": {
          "urls": {
            "title": "Website URLs",
            "type": "array",
            "description": "Paste website URLs directly, one per line. Leave empty if using Business items or Apify Dataset ID. Use one input method: URLs, items, or datasetId.",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "title": "Business items (JSON)",
            "type": "array",
            "description": "Paste business objects as JSON — accepts Google Maps Scraper output directly. Field names are auto-detected (website, url, businessWebsite, name, title…). Items with a business name but no website produce a skipped record with workflow_action=find_website. Leave empty if using Website URLs or Apify Dataset ID."
          },
          "datasetId": {
            "title": "Apify Dataset ID",
            "type": "string",
            "description": "Dataset ID from a previous Apify run — typically the output of a Google Maps Scraper. Find it in the run's Output tab or Dataset page. Leave empty if using Website URLs or Business items."
          },
          "datasetWebsiteField": {
            "title": "Dataset website field name",
            "type": "string",
            "description": "Optional. Leave empty for auto-detection. Use only if your dataset stores the website URL in a non-standard field, e.g. 'homepage' or 'link'."
          },
          "datasetNameField": {
            "title": "Dataset business name field",
            "type": "string",
            "description": "Optional. Leave empty for auto-detection. Use only if your dataset stores the business name in a non-standard field, e.g. 'company' or 'firm_name'."
          },
          "maxItems": {
            "title": "Max items to process",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of items to process per run. Items without a website also count — they produce a skipped record. Useful for testing on a subset before running on your full list.",
            "default": 100
          },
          "timeoutPerItemSeconds": {
            "title": "Timeout per website (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "How long to wait for a single website to respond before marking it as unreachable. Increase for slow or international sites. Default 20s covers most business websites.",
            "default": 20
          },
          "totalTimeoutSeconds": {
            "title": "Total run timeout (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Approximate maximum duration for the entire run. Increase for large batches (500+ items). The Actor stops accepting new items once this limit is reached.",
            "default": 300
          },
          "concurrency": {
            "title": "Concurrent requests",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Number of websites fetched in parallel. Keep moderate (10–15) to avoid overloading shared hosting servers. Increase to 20–30 for faster runs on stable infrastructure.",
            "default": 10
          },
          "countryHint": {
            "title": "Country hint",
            "type": "string",
            "description": "Optional ISO country code, e.g. FR, US, GB. Used for context and future keyword tuning. Does not restrict which sites are analyzed."
          },
          "languageHint": {
            "title": "Language hint",
            "enum": [
              "en",
              "fr"
            ],
            "type": "string",
            "description": "Language for keyword detection: 'en' for English, 'fr' for French. Affects booking, CTA, and contact signal keywords. Both languages are always active — this setting prioritizes one for ambiguous detections.",
            "default": "en"
          },
          "categoryHint": {
            "title": "Business category",
            "enum": [
              "generic",
              "restaurant",
              "plumber",
              "contractor",
              "dentist",
              "clinic",
              "salon",
              "agency"
            ],
            "type": "string",
            "description": "Optional context for category-specific signals and sales angles. Use 'plumber' for plumbers, 'restaurant' for restaurants, etc. Use 'generic' for mixed or unknown industries.",
            "default": "generic"
          },
          "includeContactExtraction": {
            "title": "Extract emails and phone numbers",
            "type": "boolean",
            "description": "When enabled, scans the page HTML for visible email addresses and phone numbers. Disable only if you need scoring signals without contact data.",
            "default": true
          },
          "includeSocialLinks": {
            "title": "Extract social media links",
            "type": "boolean",
            "description": "When enabled, detects links to Facebook, Instagram, LinkedIn, YouTube, TikTok, and other social platforms. Results appear in 'social_links' and 'social_links_csv'.",
            "default": true
          },
          "includeContactPageCheck": {
            "title": "Follow contact page link",
            "type": "boolean",
            "description": "If enabled, the Actor follows one detected contact page per website. This can improve contact extraction (emails and phones not shown on the homepage) but may add one extra request per site, increasing run time by 20–40%.",
            "default": false
          },
          "minLeadPriorityScore": {
            "title": "Minimum lead priority score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Records below this score are not removed — they are flagged with passed_min_lead_priority_filter=false. Filter this field in your CRM or spreadsheet downstream. Set to 0 to include all records.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}