{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Email Extractor",
    "description": "Scrapes Google Maps places and optionally enriches each business with website contact emails and social links.",
    "version": "0.1",
    "x-build-id": "AdsWf3BxCmM6kQoco"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kmiloaguilar~google-maps-email-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kmiloaguilar-google-maps-email-extractor",
        "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/kmiloaguilar~google-maps-email-extractor/runs": {
      "post": {
        "operationId": "runs-sync-kmiloaguilar-google-maps-email-extractor",
        "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/kmiloaguilar~google-maps-email-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-kmiloaguilar-google-maps-email-extractor",
        "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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Google Maps search terms, for example dentists, restaurants, or HVAC contractors.",
            "items": {
              "type": "string"
            }
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "City, region, postal code, or country appended to each search term.",
            "default": "Toronto, ON"
          },
          "startUrls": {
            "title": "Google Maps URLs",
            "type": "array",
            "description": "Google Maps search or place URLs to scrape instead of, or in addition to, search terms.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Maximum places",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum unique place records to save.",
            "default": 100
          },
          "maxResultsPerSearch": {
            "title": "Maximum places per search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum place URLs to process from each Google Maps search page.",
            "default": 100
          },
          "contactExtraction": {
            "title": "Contact extraction",
            "enum": [
              "none",
              "basic",
              "emails"
            ],
            "type": "string",
            "description": "Choose Maps-only output, basic website/social enrichment, or email extraction.",
            "default": "emails"
          },
          "emailVerification": {
            "title": "Email verification",
            "enum": [
              "none",
              "syntax",
              "dns"
            ],
            "type": "string",
            "description": "Verification mode for primary email. DNS checks are best-effort.",
            "default": "syntax"
          },
          "minReviewCount": {
            "title": "Minimum reviews",
            "minimum": 0,
            "type": "integer",
            "description": "Skip businesses with fewer Google reviews than this. Applied only when Google exposes the review count; businesses with an unknown review count are kept."
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Skip businesses with a lower Google rating than this. Applied only when Google exposes the rating; businesses with an unknown rating are kept."
          },
          "categories": {
            "title": "Include categories",
            "type": "array",
            "description": "Optional category allow-list applied after extraction.",
            "items": {
              "type": "string"
            }
          },
          "excludeCategories": {
            "title": "Exclude categories",
            "type": "array",
            "description": "Optional category deny-list applied after extraction.",
            "items": {
              "type": "string"
            }
          },
          "inferCategories": {
            "title": "Infer category filter",
            "type": "boolean",
            "description": "Automatically applies a conservative category allow-list for common query types such as law firms, dentists, and coffee shops.",
            "default": true
          },
          "requireEmail": {
            "title": "Require email",
            "type": "boolean",
            "description": "Save only records where at least one email was found.",
            "default": false
          },
          "requireWebsite": {
            "title": "Require website",
            "type": "boolean",
            "description": "Save only records where a website was found.",
            "default": false
          },
          "includeReviews": {
            "title": "Include reviews",
            "type": "boolean",
            "description": "Accepted for compatibility. Review text scraping is not enabled in this MVP.",
            "default": false
          },
          "scrapeDetailPages": {
            "title": "Scrape detail pages",
            "type": "boolean",
            "description": "Fetch Google Maps place pages for additional business fields before contact enrichment.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum HTTP connections used by the actor.",
            "default": 5
          },
          "requestRetries": {
            "title": "Request retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for failed page requests.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout seconds",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each HTTP request.",
            "default": 30
          },
          "requestDelayMillis": {
            "title": "Request delay milliseconds",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional delay between Google Maps search pages.",
            "default": 0
          },
          "proxyUrl": {
            "title": "Proxy URL",
            "type": "string",
            "description": "Optional explicit proxy URL."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy configuration. This MVP reads proxyUrl when provided."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}