{
  "openapi": "3.0.1",
  "info": {
    "title": "Lawyer Leads Scraper — Law Firm Emails & Phones",
    "description": "Build law firm lead lists from Google Maps by practice area and city: phone, website, email, practice areas and social links. USD 25 per 1,000 leads.",
    "version": "1.0",
    "x-build-id": "jr41q2rStpeTA2a6R"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~lawyer-lead-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-lawyer-lead-scraper",
        "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/muhammadafzal~lawyer-lead-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-lawyer-lead-scraper",
        "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/muhammadafzal~lawyer-lead-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-lawyer-lead-scraper",
        "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": [
          "businessType"
        ],
        "properties": {
          "businessType": {
            "title": "Business Type",
            "enum": [
              "Personal Injury Lawyer",
              "Criminal Defense Attorney",
              "Family Lawyer",
              "Immigration Lawyer",
              "Bankruptcy Attorney",
              "Estate Planning Attorney",
              "Corporate Lawyer",
              "Employment Lawyer",
              "Divorce Attorney",
              "DUI Attorney",
              "Real Estate Attorney",
              "Custom"
            ],
            "type": "string",
            "description": "Use this field to select the type of legal professional to find on Google Maps. The actor automatically constructs the search query — for example, selecting 'Personal Injury Lawyer' with location 'Los Angeles, CA' finds personal injury attorneys in that city. Select 'Criminal Defense Attorney' to build a DUI or felony defense law firm list. Choose 'Custom' to write your own search query via the searchQuery field instead.",
            "default": "Personal Injury Lawyer"
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Use this field to specify the city, state, or region to search for law firms in. Use 'City, ST' format for US locations — for example, 'Los Angeles, CA' for personal injury attorneys or 'Houston, TX' for immigration lawyers. You can also use ZIP codes, neighborhoods, or broader regions like 'Downtown Manhattan'. Required unless you fill Multiple Locations or Start URLs."
          },
          "locations": {
            "title": "Multiple Locations (Batch Mode)",
            "type": "array",
            "description": "Use this field when you want to search multiple cities or regions in a single run. Each location is searched separately and results are combined. Example: ['Chicago, IL', 'Houston, TX', 'Miami, FL']. Leave empty to use the single 'location' field instead. Great for building multi-city attorney lead lists in one run.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Custom Search Query",
            "type": "string",
            "description": "A raw Google Maps search query, used ONLY when Business Type is set to 'Custom'. For all other types, the search is built automatically from Business Type + Location. Write queries the same way you would type them into Google Maps — for example: 'workers compensation lawyers in Phoenix AZ', 'employment attorney Manhattan', or 'real estate attorney 90210'."
          },
          "startUrls": {
            "title": "Start URLs (Google Maps search or place URLs)",
            "type": "array",
            "description": "Use this field when you already have Google Maps URLs. A search URL such as https://www.google.com/maps/search/estate+planning+attorney+boise+id/ is opened as a results page; a place URL (https://www.google.com/maps/place/...) becomes one lead. When Start URLs are given, Business Type and Location are ignored.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum number of law firm leads to return across all locations (1-2000). Start with 3-5 to check quality. Each location search stops scrolling once about 15 firms are found, so add locations for larger lists. Enrichment takes about 30 seconds per lead, so raise the run timeout (default 300 s) for more than about 8 leads; the run stops cleanly about 45 seconds before its timeout and keeps every saved lead.",
            "default": 50
          },
          "enrichEmails": {
            "title": "Find Email Addresses",
            "type": "boolean",
            "description": "When enabled, the actor visits each law firm website and scans contact pages, footers, and about pages to extract email addresses. Disable this option if you only need phone numbers and addresses, or want faster results without website crawling.",
            "default": true
          },
          "verifyEmails": {
            "title": "Verify Email Deliverability",
            "type": "boolean",
            "description": "When enabled, the domain of each extracted email is checked for mail (MX) records. 'deliverable' means the domain has a mail server, 'undeliverable' means it has none or the address is malformed, and 'unknown' means the lookup failed. No email is sent and individual mailboxes are not tested. Only applies when emails are extracted.",
            "default": true
          },
          "enrichSocials": {
            "title": "Find Social Media Links",
            "type": "boolean",
            "description": "When enabled, the actor scans each firm website for links to social media profiles including Facebook, Instagram, LinkedIn, and Twitter/X. These links are included in the output and are useful for multi-channel outreach and account-based marketing.",
            "default": true
          },
          "extractAttorneyNames": {
            "title": "Extract Attorney Names & Titles",
            "type": "boolean",
            "description": "When enabled, the actor scans firm website 'About', 'Team', and 'Attorneys' pages to extract individual attorney names and titles (e.g., 'Managing Partner', 'Associate'). Adds attorney_name and attorney_title fields to each lead.",
            "default": true
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "full",
              "hubspot",
              "salesforce"
            ],
            "type": "string",
            "description": "Controls the structure of the output dataset. 'full' returns all available fields. 'hubspot' reformats the data to match HubSpot's CSV import column names for direct upload. 'salesforce' reformats for Salesforce data import. All formats are available in Apify's dataset export (CSV, JSON, Excel).",
            "default": "full"
          },
          "deduplicateResults": {
            "title": "Deduplicate Results",
            "type": "boolean",
            "description": "When enabled, a law firm whose name (case-insensitive) was already returned in this run is skipped. Useful when searching several overlapping locations. Recommended for batch mode.",
            "default": true
          },
          "maxWebsitePages": {
            "title": "Max Website Pages to Crawl",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Number of pages to read on each law firm website (home, contact, about, team, attorneys, in that order). Values above 5 have no extra effect. Lower values make runs faster.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}