{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Lead AI",
    "description": "Google Maps scraper with AI lead classification. Extract business name, phone, website, address, rating and reviews from Google Maps searches, then classify each place into your own custom labels using AI (Groq). Ideal for lead generation, prospecting and market research.",
    "version": "0.1",
    "x-build-id": "UyvQbHiQIUGBh48Oh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rodrigo_pacelli~google-maps-lead-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rodrigo_pacelli-google-maps-lead-ai",
        "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/rodrigo_pacelli~google-maps-lead-ai/runs": {
      "post": {
        "operationId": "runs-sync-rodrigo_pacelli-google-maps-lead-ai",
        "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/rodrigo_pacelli~google-maps-lead-ai/run-sync": {
      "post": {
        "operationId": "run-sync-rodrigo_pacelli-google-maps-lead-ai",
        "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": [
          "searchTerms",
          "locations"
        ],
        "properties": {
          "searchTerms": {
            "title": "Search Terms",
            "type": "array",
            "description": "Business categories or keywords to search for (e.g. 'lawyer', 'dentist', 'real estate agency').",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Cities or regions to search in. Each search term is combined with each location.",
            "items": {
              "type": "string"
            }
          },
          "maxPlacesPerSearch": {
            "title": "Max Places per Search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of places to collect per search (term x location combination).",
            "default": 100
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Google Maps interface language (hl parameter), e.g. 'pt-BR', 'en', 'es'.",
            "default": "pt-BR"
          },
          "includeReviewsSample": {
            "title": "Include Reviews Sample",
            "type": "boolean",
            "description": "Extract a sample of up to 5 review texts per place (improves AI classification quality).",
            "default": true
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy (residential)",
            "type": "boolean",
            "description": "Use Apify residential proxy. Strongly recommended — Google Maps blocks datacenter IPs at scale.",
            "default": true
          },
          "classifyWithAI": {
            "title": "Enable AI Classification",
            "type": "boolean",
            "description": "Classify each place into your custom labels using Groq AI (requires Groq API key).",
            "default": false
          },
          "groqApiKey": {
            "title": "Groq API Key",
            "type": "string",
            "description": "Your Groq API key for AI classification, from https://console.groq.com. Only needed if 'Enable AI Classification' is ON."
          },
          "groqModel": {
            "title": "Groq AI Model",
            "enum": [
              "llama-3.3-70b-versatile",
              "llama-3.1-8b-instant",
              "moonshotai/kimi-k2-instruct",
              "openai/gpt-oss-120b",
              "openai/gpt-oss-20b"
            ],
            "type": "string",
            "description": "The Groq model to use for AI classification.",
            "default": "llama-3.3-70b-versatile"
          },
          "labels": {
            "title": "Classification Labels (strict list)",
            "type": "array",
            "description": "Optional closed list for a strict 'fit' classification (e.g. 'LAW_FIRM', 'SOLO_LAWYER', 'NOT_A_FIT'). The AI assigns 1-3 of these per place, returned in the 'labels' field. If both this and the instruction are empty, defaults to LEAD / NOT_A_FIT.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "classificationInstruction": {
            "title": "Classification Instruction (free text)",
            "type": "string",
            "description": "Describe in your own words how the AI should classify each place. It returns a 'tags' object grouping findings by characteristic. Example: 'Classify law firms by practice area (labor, civil, family, criminal) and by review reputation (good reviews / complaints), with separated tags.'",
            "default": ""
          },
          "onlyNewPlaces": {
            "title": "Only New Places (incremental)",
            "type": "boolean",
            "description": "Remember places across runs and skip ones already collected before. Ideal for scheduled runs: only NEW places are visited, classified and charged — the expensive detail visits for known places are skipped. State is kept in a persistent store on the actor.",
            "default": false
          },
          "debug": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Verbose logging.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}