{
  "openapi": "3.0.1",
  "info": {
    "title": "San Francisco Business Registry Search (DataSF open data)",
    "description": "Search San Francisco registered business locations from the Treasurer & Tax Collector: new businesses, restaurants, contractors, salons and more, by NAICS code, neighborhood, ZIP or start date. Businesses only; no personal names.",
    "version": "0.1",
    "x-build-id": "XxYDzc89HgJDcn8zY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pennant~sf-registered-businesses/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pennant-sf-registered-businesses",
        "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/pennant~sf-registered-businesses/runs": {
      "post": {
        "operationId": "runs-sync-pennant-sf-registered-businesses",
        "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/pennant~sf-registered-businesses/run-sync": {
      "post": {
        "operationId": "run-sync-pennant-sf-registered-businesses",
        "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": {
          "status": {
            "title": "Status",
            "enum": [
              "open",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "Open = no location or business end date and not administratively closed (no filing for 3 years).",
            "default": "open"
          },
          "naicsPrefixes": {
            "title": "NAICS code prefixes",
            "type": "array",
            "description": "2-6 digit NAICS prefixes, e.g. 7225 (restaurants), 2382 (building equipment contractors), 8121 (personal care), 5412 (accounting). Codes are self-reported by the business and not verified by the City.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City of the business location, case-insensitive, e.g. San Francisco, Oakland. Empty = all (out-of-town businesses that registered to work in San Francisco are included).",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIPs of the business location.",
            "items": {
              "type": "string"
            }
          },
          "neighborhoods": {
            "title": "Neighborhoods",
            "type": "array",
            "description": "San Francisco analysis neighborhoods, case-insensitive, e.g. Mission, South of Market, Financial District/South Beach, Tenderloin, Outer Richmond.",
            "items": {
              "type": "string"
            }
          },
          "supervisorDistricts": {
            "title": "Supervisor districts",
            "type": "array",
            "description": "1 to 11.",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Name contains",
            "type": "string",
            "description": "Case-insensitive substring of the business (ownership) name or DBA (at least 2 characters). Only matches names that are returned."
          },
          "accountNumbers": {
            "title": "Business account numbers",
            "type": "array",
            "description": "Treasurer & Tax Collector business account numbers (certificate numbers), e.g. 1190743.",
            "items": {
              "type": "string"
            }
          },
          "startedFrom": {
            "title": "Location started on or after",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive. Use with startedTo for a new-business feed."
          },
          "startedTo": {
            "title": "Location started on or before",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive."
          },
          "onlyParkingTax": {
            "title": "Only parking-tax registrants",
            "type": "boolean",
            "description": "Only locations registered for San Francisco parking tax (parking operators).",
            "default": false
          },
          "onlyHotelTax": {
            "title": "Only hotel-tax registrants",
            "type": "boolean",
            "description": "Only locations registered for transient occupancy (hotel) tax.",
            "default": false
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "newest",
              "oldest",
              "name",
              "accountNumber"
            ],
            "type": "string",
            "description": "Result order. Date sorts skip rows without a location start date.",
            "default": "newest"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on results (each result is one billable event).",
            "default": 100
          },
          "includeStreetAddress": {
            "title": "Include street address",
            "type": "boolean",
            "description": "If on, the street line of the business location is returned for business-named rows. Never returned for rows whose owner name is hidden. Mailing addresses are never returned.",
            "default": false
          },
          "includeCoordinates": {
            "title": "Include map coordinates",
            "type": "boolean",
            "description": "If on, the source's latitude/longitude is returned for business-named rows (same rule as street).",
            "default": false
          },
          "requestDelayMs": {
            "title": "Delay between pages (ms)",
            "minimum": 1000,
            "type": "integer",
            "description": "Politeness delay between API pages (robots.txt Crawl-delay: 1).",
            "default": 1100
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries on timeouts, HTTP 408/429/5xx with exponential backoff and Retry-After.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}