{
  "openapi": "3.0.1",
  "info": {
    "title": "Martindale Scraper - Attorney & Law Firm Leads",
    "description": "Scrape Martindale-Hubbell lawyer profiles: AV Preeminent Peer Review Rating, client reviews, practice areas, bar info, firm name, website & phone. Optional email enrichment & lead score. Search by city, practice area or URL. Export JSON, CSV, Excel.",
    "version": "0.1",
    "x-build-id": "e2qFfQn8fiPmaaTXp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~martindale-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-martindale-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/scrapesage~martindale-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-martindale-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/scrapesage~martindale-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-martindale-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",
        "properties": {
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Where to search, as <code>City, ST</code> (<code>Los Angeles, CA</code>, <code>Houston, TX</code>, <code>New York, NY</code>) or <code>City, State</code> (<code>Chicago, Illinois</code>). Each location is combined with every practice area below. Martindale results are city-scoped, so city-level locations give the best coverage. A bare state (<code>California</code>) is accepted best-effort.",
            "items": {
              "type": "string"
            }
          },
          "practiceAreas": {
            "title": "Practice areas",
            "type": "array",
            "description": "Practice areas to filter by, combined with every location. Use a friendly term (<code>personal injury</code>, <code>family law</code>, <code>criminal defense</code>, <code>bankruptcy</code>, <code>estate planning</code>, <code>business law</code>, <code>real estate</code>, <code>immigration</code>, <code>divorce</code>, <code>DUI</code>, <code>employment</code>, <code>medical malpractice</code>, <code>workers compensation</code>, <code>tax</code>, <code>intellectual property</code>) or the exact Martindale practice-area name. Leave empty for ALL attorneys in each location.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Direct Martindale URLs: attorney profiles (<code>https://www.martindale.com/attorney/jane-doe-esq-1234567/</code>) or a Martindale searchlight results page. Used in addition to the locations above.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max attorneys",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of attorney records to scrape across all locations and practice areas.",
            "default": 100
          },
          "includeProfileDetails": {
            "title": "Include full profile details",
            "type": "boolean",
            "description": "Fetch each attorney's profile page for the full record: firm website & socials, all phone numbers + fax, full address + map geo, practice areas, law school, price range, client/peer review aggregate, the Peer Review Rating label and bio. Turn off for a faster, lighter run that returns only the listing-level fields (name, firm, city, phone, peer-review stars, AV Preeminent badge, bio snippet).",
            "default": true
          },
          "enrichEmails": {
            "title": "Enrich emails from the firm website",
            "type": "boolean",
            "description": "For each attorney that has a firm website, crawl it (home + contact/about, up to 3 pages) to extract contact emails, phone numbers and extra social links. Martindale itself never exposes emails — this is the only way to get them. Requires profile details.",
            "default": false
          },
          "minPeerRating": {
            "title": "Minimum Peer Review Rating (0–5)",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep attorneys whose Martindale-Hubbell Peer Review star rating is at least this value (e.g. 4 for highly-rated). 0 = no minimum.",
            "default": 0
          },
          "avPreeminentOnly": {
            "title": "Only AV Preeminent attorneys",
            "type": "boolean",
            "description": "Keep only attorneys who carry the top Martindale-Hubbell AV Preeminent Peer Review Rating (the highest tier). Great for premium B2B targeting.",
            "default": false
          },
          "minReviews": {
            "title": "Minimum client reviews",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep attorneys with at least this many client reviews. 0 = no minimum. Requires profile details.",
            "default": 0
          },
          "withPhoneOnly": {
            "title": "Only attorneys with a phone number",
            "type": "boolean",
            "description": "Skip attorneys that have no phone number.",
            "default": false
          },
          "withWebsiteOnly": {
            "title": "Only attorneys with a firm website",
            "type": "boolean",
            "description": "Skip attorneys that have no firm website. Requires profile details.",
            "default": false
          },
          "monitorMode": {
            "title": "Monitor mode (only new attorneys)",
            "type": "boolean",
            "description": "Remember attorney IDs returned in previous runs (in a named key-value store) and emit only NEW attorneys on each run. Perfect with Apify Schedules for a steady new-lead feed — it does not conflict with scheduling: the schedule triggers the run, monitor mode deduplicates this run's records against everything earlier runs already returned.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Name of the key-value store that holds the seen-attorney memory for monitor mode. Use different names to track independent searches separately (lowercase letters, digits and hyphens only).",
            "default": "martindale-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages to fetch in parallel. 5 is a safe default for residential proxies; lower it if you hit rate-limits.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxies to use. A RESIDENTIAL US proxy is REQUIRED — Martindale's Cloudflare WAF blocks datacenter and direct requests but serves clean pages to residential US IPs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}