{
  "openapi": "3.0.1",
  "info": {
    "title": "New Zealand Charities Register & Nonprofit Financials API",
    "description": "Extract and verify 28,000+ New Zealand charities, trusts & grant-making foundations directly from NZ Charities Services official OData API with audited income, assets, grants paid, staff, certifying officers, websites, emails & NZBNs.",
    "version": "1.0",
    "x-build-id": "uuaKgee0ug0TSwheQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/churches2908~nz-charities-register/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-churches2908-nz-charities-register",
        "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/churches2908~nz-charities-register/runs": {
      "post": {
        "operationId": "runs-sync-churches2908-nz-charities-register",
        "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/churches2908~nz-charities-register/run-sync": {
      "post": {
        "operationId": "run-sync-churches2908-nz-charities-register",
        "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": {
          "mode": {
            "title": "Operation Mode",
            "enum": [
              "search",
              "bulk_verify"
            ],
            "type": "string",
            "description": "Use 'search' to discover NZ nonprofits & grantmakers with financial filters, or 'bulk_verify' to verify CC numbers / NZBNs.",
            "default": "search"
          },
          "query": {
            "title": "Charity Name or Purpose Keyword (Optional)",
            "type": "string",
            "description": "Search inside charity name (e.g., 'Foundation', 'Trust', 'Health', 'Education', 'Auckland')."
          },
          "city": {
            "title": "City / Region (Optional)",
            "type": "string",
            "description": "Filter by city (e.g., 'Auckland', 'Wellington', 'Christchurch', 'Hamilton', 'Tauranga', 'Dunedin')."
          },
          "sector": {
            "title": "Sector Keyword (Optional)",
            "type": "string",
            "description": "Filter by charitable sector (e.g., 'Education', 'Health', 'Community development', 'Sport', 'Environment', 'Social services', 'Religious')."
          },
          "registrationStatus": {
            "title": "Registration Status",
            "enum": [
              "Registered",
              "Deregistered",
              "ALL"
            ],
            "type": "string",
            "description": "Filter by official NZ Charities Services registration status.",
            "default": "Registered"
          },
          "reportingTier": {
            "title": "Financial Reporting Tier",
            "enum": [
              "ALL",
              "Tier1",
              "Tier2",
              "Tier3",
              "Tier4"
            ],
            "type": "string",
            "description": "NZ Charities reporting tiers: Tier1 (>$33M expenses), Tier2 ($5M-$33M), Tier3 (<$5M), Tier4 (<$140K cash basis).",
            "default": "ALL"
          },
          "minGrossIncomeNzd": {
            "title": "Minimum Annual Gross Income (NZD)",
            "minimum": 0,
            "type": "integer",
            "description": "Filter charities with latest annual gross income >= this amount in NZD (e.g., 500000 or 1000000). Set 0 for no minimum.",
            "default": 0
          },
          "minTotalAssetsNzd": {
            "title": "Minimum Total Assets (NZD)",
            "minimum": 0,
            "type": "integer",
            "description": "Filter charities with total balance-sheet assets >= this amount in NZD (0 = no minimum).",
            "default": 0
          },
          "minGrantsMadeNzd": {
            "title": "Minimum Grants & Donations Paid Out (NZD — Grantmaker Finder)",
            "minimum": 0,
            "type": "integer",
            "description": "Find active grant-making foundations by filtering charities that paid >= this amount in NZD grants in their latest return (e.g., 50000).",
            "default": 0
          },
          "minFulltimeEmployees": {
            "title": "Minimum Full-Time Employees",
            "minimum": 0,
            "type": "integer",
            "description": "Filter organizations employing at least N full-time staff (0 = no minimum).",
            "default": 0
          },
          "onlyWithWebsite": {
            "title": "Only Charities With Website",
            "type": "boolean",
            "description": "Return only organizations that have a listed website URL.",
            "default": false
          },
          "onlyWithEmail": {
            "title": "Only Charities With Public Email",
            "type": "boolean",
            "description": "Return only organizations with a valid public charity email address.",
            "default": false
          },
          "charityNumbers": {
            "title": "Charity Registration Numbers (for bulk_verify mode)",
            "type": "array",
            "description": "List of NZ Charity numbers to verify (e.g., ['CC48103', 'CC20001']).",
            "items": {
              "type": "string"
            }
          },
          "nzbns": {
            "title": "NZBN Numbers (for bulk_verify mode)",
            "type": "array",
            "description": "List of 13-digit New Zealand Business Numbers (NZBN) to verify (e.g., ['9429043197903']).",
            "items": {
              "type": "string"
            }
          },
          "includeContactFields": {
            "title": "Include Public Contact Fields (Email & Phone)",
            "type": "boolean",
            "description": "Include public charity email and telephone fields from the official register. Disable for anonymized analytics.",
            "default": true
          },
          "sortBy": {
            "title": "Sort Results By",
            "enum": [
              "TotalGrossIncome desc",
              "GrantsAndDonationsMade desc",
              "TotalAssets desc",
              "NumberOfFulltimeEmployees desc",
              "DateRegistered desc"
            ],
            "type": "string",
            "description": "Ordering applied directly in the NZ Charities OData API.",
            "default": "TotalGrossIncome desc"
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of NZ charities to extract (1 to 10,000).",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}