{
  "openapi": "3.0.1",
  "info": {
    "title": "SBA Loan Recipient Leads — Funded US Business Prospects API",
    "description": "Real SBA-backed loan recipients from the official 7(a) & 504 FOIA data — funded US businesses with borrower name, address, loan amount, approval date, lender, NAICS industry, jobs supported & loan status. Filter by state, fiscal year, amount or industry. Optional Notion/Supabase delivery.",
    "version": "0.0",
    "x-build-id": "UXUKxcWaYchWXGEhc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nexgendata~sba-loan-recipients-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nexgendata-sba-loan-recipients-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/nexgendata~sba-loan-recipients-leads/runs": {
      "post": {
        "operationId": "runs-sync-nexgendata-sba-loan-recipients-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/nexgendata~sba-loan-recipients-leads/run-sync": {
      "post": {
        "operationId": "run-sync-nexgendata-sba-loan-recipients-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": {
          "loanProgram": {
            "title": "Loan program",
            "enum": [
              "7a",
              "504"
            ],
            "type": "string",
            "description": "Which SBA program to pull. 7(a) = general small-business loans (largest dataset). 504 = CDC/504 fixed-asset loans (real estate & equipment).",
            "default": "7a"
          },
          "period": {
            "title": "Time period (file)",
            "enum": [
              "2020-present",
              "2010-2019",
              "2000-2009",
              "1991-1999",
              "2010-present",
              "1991-2009"
            ],
            "type": "string",
            "description": "SBA segments the data into files by era. 'Recent' (FY2020-Present for 7a / FY2010-Present for 504) is best for current leads. Older files are large and historical.",
            "default": "2020-present"
          },
          "states": {
            "title": "States (borrower)",
            "type": "array",
            "description": "Two-letter state codes to filter borrowers by (e.g. ['CA','TX']). Empty = all states. Narrowing by state makes runs much faster and cheaper.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fiscalYears": {
            "title": "Approval fiscal years",
            "type": "array",
            "description": "Filter by SBA approval fiscal year (e.g. ['2024','2025']). Empty = all years in the selected file.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minGrossApproval": {
            "title": "Min loan amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only loans with gross approval at or above this amount."
          },
          "maxGrossApproval": {
            "title": "Max loan amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only loans with gross approval at or below this amount."
          },
          "naicsPrefixes": {
            "title": "NAICS code prefixes",
            "type": "array",
            "description": "Filter by industry using NAICS code prefixes (e.g. ['72'] for accommodation & food services, ['23'] for construction). Matches codes that start with any prefix. Empty = all industries.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lenderName": {
            "title": "Lender name contains",
            "type": "string",
            "description": "Only loans where the lender (bank / CDC) name contains this text (case-insensitive). Empty = all lenders."
          },
          "businessType": {
            "title": "Business type contains",
            "type": "string",
            "description": "Filter by business type text (e.g. 'Corporation', 'Individual', 'Partnership'). Case-insensitive substring. Empty = all."
          },
          "minJobsSupported": {
            "title": "Min jobs supported",
            "minimum": 0,
            "type": "integer",
            "description": "Only loans reporting at least this many jobs supported."
          },
          "max_results": {
            "title": "Max leads",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum loan-recipient leads to return per run. Loans come newest approval first (the SBA file is read from its most recent end), and the Actor stops as soon as this many matches are found. Default when omitted: 1000.",
            "default": 1000
          },
          "include_raw": {
            "title": "Include raw record",
            "type": "boolean",
            "description": "Attach the raw SBA CSV row to each lead.",
            "default": false
          },
          "notionConnector": {
            "title": "Deliver to Notion (optional)",
            "type": "string",
            "description": "Optional. Connect your Notion workspace and the leads are also written as a Notion page in the same run. Paste your Notion MCP connector ID. The Actor never sees your Notion credentials."
          },
          "notionParentId": {
            "title": "Notion parent page ID (optional)",
            "type": "string",
            "description": "Optional. The Notion page ID to create the results page under. If blank, Notion creates it at the workspace root."
          },
          "supabaseConnector": {
            "title": "Deliver to Supabase (optional)",
            "type": "string",
            "description": "Optional. Connect your own Supabase project and results are also inserted as JSONB rows. Paste your Supabase MCP connector ID (write + project scoped)."
          },
          "supabaseTable": {
            "title": "Supabase table name (optional)",
            "type": "string",
            "description": "Target table in the public schema (created if missing, with id, a jsonb data column, and scraped_at)."
          },
          "supabaseProjectId": {
            "title": "Supabase project ID (optional)",
            "type": "string",
            "description": "Your Supabase project reference (e.g. abcdefghijklmnop). Required unless your connector is already project-scoped."
          },
          "deliveryDedup": {
            "title": "Deduplicate deliveries across runs",
            "type": "boolean",
            "description": "When on (default), records already delivered to Notion/Supabase in a previous run are not delivered again.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. SBA open data is public US-government data; a proxy is not required. Leave default.",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}