{
  "openapi": "3.0.1",
  "info": {
    "title": "Service Area Mapper",
    "description": "Plan & optimize your service territories w/detailed ZIP code analysis. Understand population, income levels, & competitor saturation to make data-driven expansion decisions. Territory Planning, Franchise Mapping, Market Expansion, Competitor Analysis & Marketing Targeting",
    "version": "2.4",
    "x-build-id": "COzIIDObTMKhwjStu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alizarin_refrigerator-owner~service-area-mapper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alizarin_refrigerator-owner-service-area-mapper",
        "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/alizarin_refrigerator-owner~service-area-mapper/runs": {
      "post": {
        "operationId": "runs-sync-alizarin_refrigerator-owner-service-area-mapper",
        "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/alizarin_refrigerator-owner~service-area-mapper/run-sync": {
      "post": {
        "operationId": "run-sync-alizarin_refrigerator-owner-service-area-mapper",
        "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": {
          "centerPoint": {
            "title": "Center Point",
            "type": "string",
            "description": "The center of your service area: a US city and state, a street address, or \"lat,lon\" coordinates"
          },
          "radiusMiles": {
            "title": "Radius (Miles)",
            "minimum": 5,
            "maximum": 100,
            "type": "number",
            "description": "Maximum service area radius in miles",
            "default": 25
          },
          "industry": {
            "title": "Industry",
            "type": "string",
            "description": "Your industry or business type, for example \"plumbers\". Used as the Google Maps search term for competitor counts (unless Competitor Search Term is set) and to frame the optional AI market analysis."
          },
          "includeDemographics": {
            "title": "Include Demographics",
            "type": "boolean",
            "description": "Include Census ACS 5-year population, median household income, median age and per capita income per ZIP",
            "default": true
          },
          "includeHouseholds": {
            "title": "Include Household Data",
            "type": "boolean",
            "description": "Include Census ACS housing units, owner-occupied and renter-occupied homes, and the homeownership rate per ZIP",
            "default": true
          },
          "minPopulation": {
            "title": "Minimum Population",
            "type": "integer",
            "description": "Only include ZIP codes with at least this Census population (ZIPs without Census data are left out when this is set)",
            "default": 0
          },
          "minMedianIncome": {
            "title": "Minimum Median Income",
            "type": "integer",
            "description": "Only include ZIP codes with at least this Census median household income (ZIPs without Census data are left out when this is set)",
            "default": 0
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "json",
              "geojson",
              "csv"
            ],
            "type": "string",
            "description": "Primary output format",
            "default": "json"
          },
          "includeDriveTime": {
            "title": "Generate Drive-Time Estimates",
            "type": "boolean",
            "description": "Create drive-time estimate polygons. These are straight-line circles (minutes x an assumed average speed), not road-network isochrones.",
            "default": false
          },
          "driveTimeMinutes": {
            "title": "Drive Time Intervals (minutes)",
            "type": "array",
            "description": "Array of drive times to generate polygons for"
          },
          "trafficModel": {
            "title": "Traffic Model",
            "enum": [
              "optimistic",
              "best_guess",
              "pessimistic"
            ],
            "type": "string",
            "description": "Assumed average speed for drive-time estimates: optimistic 40 mph, best_guess 30 mph, pessimistic 20 mph",
            "default": "best_guess"
          },
          "generateHeatmap": {
            "title": "Generate Heatmap",
            "type": "boolean",
            "description": "Create a heatmap visualization of the selected metric",
            "default": false
          },
          "heatmapMetric": {
            "title": "Heatmap Metric",
            "enum": [
              "opportunity",
              "population",
              "income",
              "competition"
            ],
            "type": "string",
            "description": "Which metric to visualize in the heatmap. \"competition\" maps competitor counts and needs Include Competitor Counts turned on.",
            "default": "opportunity"
          },
          "heatmapResolution": {
            "title": "Heatmap Resolution",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "Resolution of the heatmap grid",
            "default": "medium"
          },
          "geoNamesUsername": {
            "title": "GeoNames Username (BYOK)",
            "type": "string",
            "description": "Optional. Your GeoNames username (free at geonames.org) to use GeoNames for ZIP discovery. Without it, ZIP codes come from the Census Bureau TIGERweb ZIP Code Tabulation Areas, which needs no key."
          },
          "includeCompetitors": {
            "title": "Include Competitor Counts",
            "type": "boolean",
            "description": "Count competing businesses in each ZIP from real Google Maps listings and use competitor density in the opportunity score. This starts one fast Google Maps search run (our Google Maps Scraper actor in list mode) on your Apify account, billed at that actor's prices: Actor start ($0.20, or $0.40 at 180 lookups or more) plus $0.02 per unique listing read, plus $0.01 per competitor counted here. In a 10 mile Dallas test (41 ZIPs, default budget of 820 lookups) competitors added about $6.10 (222 listings read, 124 counted) and the whole run took under 5 minutes. Off by default.",
            "default": false
          },
          "competitorKeyword": {
            "title": "Competitor Search Term",
            "type": "string",
            "description": "What to search for on Google Maps, for example \"plumber\" or \"roofing contractor\". Leave empty to use Industry."
          },
          "maxCompetitorLookups": {
            "title": "Max Competitor Lookups",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "Total unique Google Maps listings to read across the service area. Leave empty for the default: 20 per ZIP in the area, at most 1,000 (820 for a 41-ZIP area), which gives every ZIP its own search in areas of up to 50 ZIPs. One search is centered on each ZIP, nearest to the center first, at least 20 listings each; the Google Maps run stops at this many listings, so a smaller budget covers only the ZIPs nearest the center. Listings shared by overlapping searches are read and charged once. Each listing costs $0.02 in the Google Maps Scraper run, and each one counted in a returned ZIP costs $0.01 here."
          },
          "yourBusinessName": {
            "title": "Your Business Name",
            "type": "string",
            "description": "Optional. Your own business exactly as it is named on Google Maps. With Your Business Address (or Your Google Place ID) only your own listing is left out of the counts and not charged. With the name alone, a listing is left out only if it is the one listing with exactly that name."
          },
          "yourBusinessAddress": {
            "title": "Your Business Address",
            "type": "string",
            "description": "Optional. Your street address as on Google Maps, for example \"5610 Dyer St, Dallas, TX 75206\". Used with Your Business Name so only your own listing is left out (a branch with the same name at another address is still counted)."
          },
          "yourPlaceId": {
            "title": "Your Google Place ID",
            "type": "string",
            "description": "Optional. Your Google Place ID (ChIJ...), CID, or a Google Maps link to your listing. The exact way to leave your own business out of the counts."
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key (BYOK)",
            "type": "string",
            "description": "Your Anthropic API key to enable AI-powered market opportunity analysis. Claude AI analyzes your service area data and provides strategic insights, expansion recommendations, and market intelligence. Get your key at console.anthropic.com."
          },
          "enableAiAnalysis": {
            "title": "Enable AI Market Analysis",
            "type": "boolean",
            "description": "When enabled with an API key, Claude AI analyzes all ZIP codes and provides: market opportunity insights, expansion priorities, competitive gaps, demographic trends, and strategic recommendations for territory planning.",
            "default": true
          },
          "demoMode": {
            "title": "Demo Mode",
            "type": "boolean",
            "description": "Return one labeled sample record (free, nothing charged) instead of mapping a real area. Off by default.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "URL to POST results when scraping completes (Zapier, Make, n8n, custom endpoint)"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}