{
  "openapi": "3.0.1",
  "info": {
    "title": "City Business License Leads — New Business Lead Feed API",
    "description": "New business-license lead feed across Chicago, LA, SF, NYC and Seattle. Normalizes municipal open data into one schema with new-vs-renewal and active-vs-dead licence flags, owner mailing address, NAICS, phone where published, plus per-city coverage and freshness on every row.",
    "version": "1.1",
    "x-build-id": "o9wJokNbwICMdAok3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~city-business-license-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-city-business-license-leads",
        "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/malonestar~city-business-license-leads/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-city-business-license-leads",
        "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/malonestar~city-business-license-leads/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-city-business-license-leads",
        "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": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City slugs to pull business licenses from. Live and wired: chicago, los-angeles, san-francisco, new-york, seattle. Any other slug produces an explicit unknown_city / not_wired row rather than being silently dropped. Leave empty to query all live cities.",
            "default": [
              "chicago",
              "los-angeles",
              "san-francisco",
              "new-york",
              "seattle"
            ],
            "items": {
              "type": "string"
            }
          },
          "since": {
            "title": "New since date (YYYY-MM-DD)",
            "pattern": "^$|^\\d{4}-\\d{1,2}-\\d{1,2}$",
            "type": "string",
            "description": "Only return licenses issued/started after this date, per each city's issue-date column. MUST be YYYY-MM-DD (e.g. 2025-01-15) - any other format is rejected and the run fails without billing, rather than silently returning every licence in the city as a new lead. Leave empty for the most recent records overall."
          },
          "name": {
            "title": "Business name contains",
            "type": "string",
            "description": "Optional. Case-insensitive fragment matched against each city's business-name column (e.g. 'salon', 'LLC', a specific company)."
          },
          "licenseType": {
            "title": "License type / category contains",
            "type": "string",
            "description": "Optional. Case-insensitive fragment matched against the per-city license-type column (e.g. 'restaurant', 'pawnbroker', 'peddler'). Skipped for cities that do not expose a type column."
          },
          "naics": {
            "title": "NAICS code prefix",
            "type": "string",
            "description": "Optional. NAICS code prefix to filter by industry (e.g. '72' = accommodation & food services, '5419' = professional services). Applied only in cities that expose NAICS (Los Angeles, Seattle)."
          },
          "onlyNewLicenses": {
            "title": "New licences only (exclude renewals)",
            "type": "boolean",
            "description": "On by default, so the feed matches what this Actor is sold as. Chicago publishes an application type and 76.1% of its 1.2M records are RENEW - existing businesses renewing, not new ones. With this on, Chicago is filtered server-side to ISSUE and C_LOC (a genuine new site) so you are not billed for renewals at all. Cities that publish no new-vs-renewal signal are NEVER dropped by this - their rows come back tagged record_kind \"unknown\". Turn it off to get every record.",
            "default": true
          },
          "onlyActiveLicenses": {
            "title": "Currently-valid licences only",
            "type": "boolean",
            "description": "On by default. Only 62.4% of the New York dataset is Active - the rest is Expired, Surrendered, Revoked, Voided, Suspended or explicitly Out of Business, and Chicago carries 78,619 cancelled plus 1,461 revoked licences. With this on those are excluded server-side. Cities that publish no status (LA, SF, Seattle) are NEVER dropped by this - their rows come back with is_active_license null. Turn it off to get every record.",
            "default": true
          },
          "maxResults": {
            "title": "Max results (whole run, all cities)",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum number of rows for the WHOLE run, across all selected cities (each row is one billed result). Divided fairly between cities: a city with fewer matching licences than its share hands the rest to the others, and every city gets at least one row (a city that answers with nothing still emits one status row). Until build 1.1.7 this was a per-city cap, so an empty call across all 5 cities emitted 4,001 rows. Must be at least the number of cities selected.",
            "default": 1000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free Socrata app token to raise API rate limits for large pulls across many cities."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}