{
  "openapi": "3.0.1",
  "info": {
    "title": "NC SOS Business Search & Entity Enricher",
    "description": "Bulk search North Carolina Secretary of State business records. Export structured NC entity status, SOS ID, registered agent, addresses, filings, source URLs, and annual-report phone data when available.",
    "version": "0.1",
    "x-build-id": "8tid4p3rK9wvPDitH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/monty15~north-carolina-sos-business-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-monty15-north-carolina-sos-business-search",
        "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/monty15~north-carolina-sos-business-search/runs": {
      "post": {
        "operationId": "runs-sync-monty15-north-carolina-sos-business-search",
        "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/monty15~north-carolina-sos-business-search/run-sync": {
      "post": {
        "operationId": "run-sync-monty15-north-carolina-sos-business-search",
        "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",
        "required": [
          "searchTerms"
        ],
        "properties": {
          "searchTerms": {
            "title": "Business names to search",
            "minItems": 1,
            "type": "array",
            "description": "One or more company/entity names. The Actor searches each term against NC SOS Business Registration records.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "Max results per search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of matching NC SOS records to save for each search term.",
            "default": 10
          },
          "includeProfiles": {
            "title": "Include profile details",
            "type": "boolean",
            "description": "Fetch each matched profile page to include principal office and registered agent fields when available.",
            "default": true
          },
          "includeFilings": {
            "title": "Include filing metadata",
            "type": "boolean",
            "description": "Fetch filing-list metadata for each matched entity. Does not download PDFs.",
            "default": false
          },
          "includePhones": {
            "title": "Extract phone from latest annual report PDF",
            "type": "boolean",
            "description": "Fetch the latest NC SOS annual-report PDF for each matched entity, OCR page 1, and extract the principal office phone number when present.",
            "default": true
          },
          "enableAffiliateResolver": {
            "title": "Try owner/affiliate resolver when direct search misses",
            "type": "boolean",
            "description": "When an exact legal-name search returns no NC SOS records, retry with conservative brand/owner tokens such as 'Brennan' from 'Brennan Investment Group' or 'Royal Oak' from 'Royal Oak Realty Trust'. Results are labeled as possible_affiliate instead of direct_legal_name.",
            "default": true
          },
          "managedBrowser": {
            "title": "Use managed browser session",
            "type": "boolean",
            "description": "Use the managed browser session for NC SOS requests. This is the recommended cloud setting.",
            "default": true
          },
          "managedBrowserHeadless": {
            "title": "Run managed browser headless",
            "type": "boolean",
            "description": "Run the managed browser without a visible window. Keep enabled for Apify cloud runs.",
            "default": true
          },
          "managedBrowserTimeoutSeconds": {
            "title": "Managed browser startup timeout",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum seconds to wait for the managed browser session to reach the NC SOS search page before failing.",
            "default": 240
          },
          "requestDelaySeconds": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Polite delay between NC SOS requests for the fallback HTTP transport. The managed browser has its own pacing.",
            "default": 1.5
          },
          "sessionJson": {
            "title": "Optional pre-cleared session JSON",
            "type": "string",
            "description": "Fallback only. JSON with cookies, antiforgery_token, and user_agent from an already initialized NC SOS session. Used when managedBrowser=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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}