{
  "openapi": "3.0.1",
  "info": {
    "title": "Agency Directory Scraper & Lead Finder",
    "description": "Scrapes marketing, design, and tech agencies from Google Maps, SuperbCompanies.com, and TheManifest.com into one deduplicated dataset. Extracts name, website, phone, address, services, team size, and rating. $0.05/agency.",
    "version": "2.0",
    "x-build-id": "PG4fBPTCJVz63zEHp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~agency-directory-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-agency-directory-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/ryanclinton~agency-directory-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-agency-directory-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/ryanclinton~agency-directory-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-agency-directory-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": [
          "sources"
        ],
        "properties": {
          "services": {
            "title": "Agency type / keyword",
            "type": "string",
            "description": "Agency type to search for. Used as the Google Maps query keyword (e.g. 'marketing agency', 'SEO agency', 'web design agency'). Combined with Location for best targeting.",
            "default": "marketing agency"
          },
          "location": {
            "title": "Location (city, country, or region)",
            "type": "string",
            "description": "Location for Google Maps searches, e.g. 'New York', 'London', 'United States'. Leave blank for global results on SuperbCompanies / TheManifest.",
            "default": "New York"
          },
          "sources": {
            "title": "Data sources",
            "maxItems": 3,
            "type": "array",
            "description": "Which directories to scrape. 'google-maps' calls our Google Maps sub-actor (fastest, richest for a city). 'superbcompanies' crawls SuperbCompanies.com (8K+ open profiles). 'themanifest' crawls TheManifest.com (Clutch sister site).",
            "items": {
              "type": "string"
            },
            "default": [
              "google-maps",
              "superbcompanies"
            ]
          },
          "maxAgenciesPerSource": {
            "title": "Max agencies per source",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of agencies to collect from each enabled source. With 2 sources enabled this gives up to 2× this number of total records.",
            "default": 50
          },
          "preset": {
            "title": "Preset workflow",
            "enum": [
              "none",
              "high_intent",
              "easy_wins",
              "enterprise_targets",
              "fresh_leads"
            ],
            "type": "string",
            "description": "One-click workflow that sets mode + strategy + post-filter for a common use case. 'none' (default) means use the mode/strategy fields below. If you set a preset AND individual fields, the individual fields win.",
            "default": "none"
          },
          "mode": {
            "title": "Filter mode",
            "enum": [
              "list-builder",
              "outreach-ready",
              "pipeline-builder"
            ],
            "type": "string",
            "description": "How aggressively to filter the results. 'list-builder' (default) = every agency found. 'outreach-ready' = drops records with no email AND no phone. 'pipeline-builder' = drops records with icpFitScore below 40 (requires Target profile below).",
            "default": "list-builder"
          },
          "strategy": {
            "title": "Sort strategy",
            "enum": [
              "balanced",
              "high-opportunity",
              "high-authority"
            ],
            "type": "string",
            "description": "How to rank and sort the output. 'balanced' (default) = by overall leadScore. 'high-opportunity' = by opportunityScore (momentum + contactability gaps + underexposure). 'high-authority' = by the authority component (rating + review volume).",
            "default": "balanced"
          },
          "outputMode": {
            "title": "Output shape",
            "enum": [
              "raw",
              "decision-ready"
            ],
            "type": "string",
            "description": "Controls the shape of the pushed records. 'raw' (default) = full record with every scoring field. 'decision-ready' = slim record with contactPriority, leadType, outreachAngle, recommendedAction — ideal for non-technical users, Zapier/Slack/webhooks, and AI agent tool calls.",
            "default": "raw"
          },
          "targetProfile": {
            "title": "Target profile (Ideal Customer Profile)",
            "type": "object",
            "description": "Optional ICP used to compute icpFitScore (0–100) on every record. Pipeline Builder mode filters by this score. Leave blank for a plain unfiltered crawl. Example: { \"services\": [\"SEO\", \"PPC\"], \"minEmployees\": 10, \"maxEmployees\": 100, \"minRating\": 4.0, \"requireEmail\": true }",
            "default": {}
          },
          "includeEmails": {
            "title": "Include email enrichment (slower, extra cost)",
            "type": "boolean",
            "description": "When enabled, visits each Google Maps business website to extract emails, phones, and social links. Adds 3–5 minutes of runtime and additional sub-actor charges (~$0.10/agency). Leave OFF for a fast directory dump — you can always run email enrichment separately.",
            "default": false
          },
          "previousDatasetId": {
            "title": "Previous dataset ID (optional, for cross-run dedup)",
            "type": "string",
            "description": "Paste a dataset ID from a past run to skip agencies you've already collected and flag only new ones. Useful for weekly scheduled runs. Leave blank to use the built-in auto-tracking (reads from this actor's key-value store).",
            "default": ""
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings for SuperbCompanies and TheManifest scraping. Standard Apify proxy is usually sufficient — these sites do not use Cloudflare.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}