{
  "openapi": "3.0.1",
  "info": {
    "title": "PPP Loan Data Scraper - Small Business Leads & Firmographics",
    "description": "Scrape U.S. SBA PPP loan data: business name & address, NAICS industry, loan & forgiveness amount, jobs reported, lender, and owner demographics (woman/veteran/minority-owned). Filter by state, industry, size, and demographics. B2B leads at scale, no browser.",
    "version": "0.1",
    "x-build-id": "OI3aYMwUBJUjeGKFr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~ppp-loan-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-ppp-loan-data-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~ppp-loan-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-ppp-loan-data-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~ppp-loan-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-ppp-loan-data-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": {
          "states": {
            "title": "States",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter borrowers by U.S. state (2-letter USPS codes, e.g. CA, TX, NY). Leave empty for all states.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by borrower city (exact city names, e.g. \"Austin\", \"Miami\"). Leave empty for all cities.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by borrower ZIP. Full or prefix ZIPs (e.g. \"787\" matches all 787xx). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by project county name (e.g. \"Los Angeles\", \"Cook\"). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS industry codes",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by NAICS code prefix — 2 to 6 digits. Examples: 722 = restaurants/food service, 23 = construction, 621 = health care, 54 = professional services, 6212 = dentists, 8121 = personal care. Leave empty for all industries.",
            "items": {
              "type": "string"
            }
          },
          "businessNameQuery": {
            "title": "Business name contains",
            "type": "string",
            "description": "Only return borrowers whose business name contains this text (case-insensitive substring)."
          },
          "lenderNameQuery": {
            "title": "Lender name contains",
            "type": "string",
            "description": "Only return loans whose originating or servicing lender name contains this text (e.g. \"JPMorgan\", \"Cross River\", \"Kabbage\")."
          },
          "loanAmountMin": {
            "title": "Min loan amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum current approved loan amount. Loans of $150K+ are in the fast default file; for smaller loans enable \"Include loans under $150K\"."
          },
          "loanAmountMax": {
            "title": "Max loan amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum current approved loan amount. Setting this below 150000 automatically scans the \"up to $150K\" source files."
          },
          "approvalDateFrom": {
            "title": "Approved on/after",
            "type": "string",
            "description": "Only loans approved on/after this date (YYYY-MM-DD). PPP ran from 2020-04 to 2021-05."
          },
          "approvalDateTo": {
            "title": "Approved on/before",
            "type": "string",
            "description": "Only loans approved on/before this date (YYYY-MM-DD)."
          },
          "jobsMin": {
            "title": "Min jobs reported",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of jobs reported (a proxy for company size / employee count). E.g. 10 = skip sole proprietors and tiny businesses."
          },
          "jobsMax": {
            "title": "Max jobs reported",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of jobs reported. Combine with \"Min jobs reported\" to target a company-size band (e.g. 10–50 employees)."
          },
          "drawType": {
            "title": "Loan draw",
            "enum": [
              "any",
              "first",
              "second"
            ],
            "type": "string",
            "description": "First Draw (2020) vs Second Draw (2021). A Second Draw loan means the business survived into 2021 and was still operating — a stronger lead.",
            "default": "any"
          },
          "forgivenessStatus": {
            "title": "Forgiveness status",
            "enum": [
              "any",
              "forgiven",
              "notForgiven"
            ],
            "type": "string",
            "description": "Filter by whether the loan was forgiven (forgiveness = a legitimate, operating business that met payroll requirements).",
            "default": "any"
          },
          "businessTypes": {
            "title": "Business / entity types",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by entity type (exact PPP values, e.g. \"Corporation\", \"Limited Liability Company(LLC)\", \"Sole Proprietorship\", \"Subchapter S Corporation\", \"Partnership\", \"Non-Profit Organization\", \"Self-Employed Individuals\", \"Independent Contractors\"). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "loanStatuses": {
            "title": "Loan statuses",
            "uniqueItems": true,
            "type": "array",
            "description": "Normalized loan statuses to include: paidInFull, chargedOff, active, exemption4. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "franchisesOnly": {
            "title": "Franchises only",
            "type": "boolean",
            "description": "Only return loans to franchise businesses (a named franchise brand).",
            "default": false
          },
          "womanOwnedOnly": {
            "title": "Woman-owned only",
            "type": "boolean",
            "description": "Only return loans to women-owned businesses (Gender = Female Owned).",
            "default": false
          },
          "veteranOwnedOnly": {
            "title": "Veteran-owned only",
            "type": "boolean",
            "description": "Only return loans to veteran-owned businesses.",
            "default": false
          },
          "minorityOwnedOnly": {
            "title": "Minority-owned only",
            "type": "boolean",
            "description": "Only return loans where the owner's reported race is a minority group (or Hispanic/Latino ethnicity).",
            "default": false
          },
          "hispanicOwnedOnly": {
            "title": "Hispanic/Latino-owned only",
            "type": "boolean",
            "description": "Only return loans where the owner's reported ethnicity is Hispanic or Latino.",
            "default": false
          },
          "nonProfitFilter": {
            "title": "Non-profit filter",
            "enum": [
              "any",
              "nonProfitOnly",
              "forProfitOnly"
            ],
            "type": "string",
            "description": "Include all businesses, only non-profits, or only for-profits.",
            "default": "any"
          },
          "ruralUrban": {
            "title": "Rural / urban",
            "enum": [
              "any",
              "rural",
              "urban"
            ],
            "type": "string",
            "description": "Filter by SBA rural/urban classification of the business location.",
            "default": "any"
          },
          "hubzoneOnly": {
            "title": "HUBZone only",
            "type": "boolean",
            "description": "Only return businesses located in a HUBZone (Historically Underutilized Business Zone).",
            "default": false
          },
          "lowToModerateIncomeOnly": {
            "title": "Low-to-moderate income area only",
            "type": "boolean",
            "description": "Only return businesses located in a low-to-moderate income (LMI) area.",
            "default": false
          },
          "includeUnder150k": {
            "title": "Include loans under $150K",
            "type": "boolean",
            "description": "Off (default) = scan only the fast ~452 MB file of loans $150K+ (the largest businesses with real payroll = the best leads). On = also scan the twelve \"up to $150K\" files (~4.9 GB, ~10M smaller loans) — much more coverage but slower. For fastest results when on, set \"Sort newest first\" to false.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of loan records to return.",
            "default": 1000
          },
          "sortNewestFirst": {
            "title": "Sort newest first",
            "type": "boolean",
            "description": "Return the most recently approved loans first (Second Draw 2021 loans surface first). Note: sorting requires reading every selected file; set to false for the fastest early-stop on capped runs.",
            "default": true
          },
          "deduplicateResults": {
            "title": "Deduplicate results",
            "type": "boolean",
            "description": "Drop duplicate loan records within a run (by loan number).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new records)",
            "type": "boolean",
            "description": "Emit only loans not seen in previous runs of the same monitor key — ideal for incremental lead harvesting on a schedule. Works alongside Apify Schedules (it controls what is emitted, not when the run fires).",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "A label for this monitored watch (e.g. \"ca-restaurants\"). Use a distinct key per saved filter set so their seen-lists don't mix.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. SBA open data downloads cleanly without a proxy (this is the default). You can enable an Apify proxy if your network requires it.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}