# New York Business Entity Scraper (`muhammadafzal/ny-business-entity-scraper`) Actor

Search active New York business entity records by name or DOS ID through official NY Open Data. Return entity type, jurisdiction, county, service address, agent data, and source links. $0.01 per entity.

- **URL**: https://apify.com/muhammadafzal/ny-business-entity-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 ny business entity returneds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## New York Business Entity Scraper

Search active New York business entities by name or Department of State (DOS) ID through the official [New York Open Data active-entity dataset](https://data.ny.gov/Economic-Development/Active-Corporations-Beginning-1800/n9v6-gdp6). The actor returns one compact, structured record per unique entity with identity, type, jurisdiction, county, service-of-process, agent, and physical-location fields.

The browser-based Public Inquiry page is useful for human verification, but it can present an automated-browser challenge. This actor uses the state’s published API dataset as its primary transport for predictable, agent-friendly runs.

### What it extracts

| Group | Fields |
| --- | --- |
| Identity | `entityName`, `dosId`, `entityType`, `entityStatus` |
| Formation | `dateOfInitialDosFiling`, `jurisdiction`, `county` |
| Service and contact | `serviceOfProcessName`, `serviceOfProcessAddress`, `chiefExecutiveOfficerName`, `chiefExecutiveOfficerAddress`, `registeredAgentName`, `registeredAgentAddress` |
| Location | `entityPrimaryLocationName`, `entityPrimaryLocationAddress`, `principalExecutiveOfficeAddress` |
| Provenance | `sourceUrl`, `searchQuery`, search settings, `scrapedAt`, `warnings[]` |

The official active-entity dataset does not provide every field displayed in the interactive Public Inquiry detail page. Fields not published in Open Data are explicit `null`. `filingLinks[]` contains the official active-dataset source link; the actor does not download certified documents or filing history.

### When to use it

Use this actor for public New York entity research, DOS-ID resolution, vendor due diligence, company-name lookups, service-of-process research, and compact structured inputs for AI agents.

Do not use it as a final name-availability opinion, a certificate-of-status provider, an ownership/EIN lookup, a private beneficial-owner source, a county-clerk assumed-name search, or a substitute for legal advice. The Department of State warns that public-record completeness and accuracy are not guaranteed.

### Input

```json
{
  "searchBy": "entityName",
  "query": "IBM",
  "searchFunctionality": "beginsWith",
  "entityStatus": "active",
  "entityTypes": ["corporation", "limitedLiabilityCompany", "limitedPartnership", "limitedLiabilityPartnership"],
  "maxResults": 50,
  "requestDelayMs": 400
}
```

For a direct DOS ID lookup:

```json
{ "searchBy": "dosId", "query": "1234567", "maxResults": 1 }
```

Name matching supports `beginsWith`, `contains`, and `exactMatch`. Entity types are filtered defensively after the API response. `entityStatus="active"` is the supported source scope; `inactive` exits with a warning because the active dataset cannot truthfully return inactive-only records.

### Output example

```json
{
  "recordType": "ny-business-entity",
  "entityName": "IBM",
  "dosId": "1234567",
  "entityType": "DOMESTIC BUSINESS CORPORATION",
  "entityStatus": "ACTIVE",
  "dateOfInitialDosFiling": "01/01/1900",
  "county": "New York",
  "jurisdiction": "New York",
  "serviceOfProcessName": "IBM",
  "serviceOfProcessAddress": "1 MADISON AVENUE, NEW YORK, NY, 10010",
  "registeredAgentName": null,
  "registeredAgentAddress": null,
  "filingLinks": [
    { "linkType": "other", "label": "Active entities dataset", "url": "https://data.ny.gov/Economic-Development/Active-Corporations-Beginning-1800/n9v6-gdp6" }
  ],
  "sourceUrl": "https://data.ny.gov/resource/n9v6-gdp6.json?...",
  "warnings": ["The official Open Data active-entity dataset is the source for this record; inactive-only records are outside this actor’s source scope."]
}
```

The `OUTPUT` key-value record contains status, result and charge counts, the normalized search input, official source links, and warnings. A valid query with no matches is a successful empty result. HTTP, timeout, or API failures are reported as runtime failures rather than silently converted into an empty dataset.

### Pricing

| Event | Price |
| --- | ---: |
| Actor start | $0.00005 per run |
| `entity-record` | $0.01 per stored entity |

The actor prints the maximum result-event cost before querying and stops at `maxResults` or an Apify event-charge limit. A one-result run costs up to $0.01005 in actor events before compute or usage charges.

### Official sources

- [New York Corporation and Business Entity Search Database](https://dos.ny.gov/corporation-and-business-entity-search-database)
- [Active Corporations: Beginning 1800](https://data.ny.gov/Economic-Development/Active-Corporations-Beginning-1800/n9v6-gdp6)
- [NY Open Data API endpoint](https://data.ny.gov/resource/n9v6-gdp6.json)

# Actor input Schema

## `searchBy` (type: `string`):

Use this when choosing whether the query is a New York entity name or a Department of State identification number. Accepted values are entityName or dosId; entityName is the default. This is not a filing-document number or tax ID selector.

## `query` (type: `string`):

Use this when specifying the New York business name or DOS ID to search. Enter a name such as IBM or a digits-only DOS ID such as 1234567. Defaults to IBM for the Apify health test. This is not a street address or county filter.

## `searchFunctionality` (type: `string`):

Use this when controlling how a name query matches New York active records. Choose beginsWith, contains, or exactMatch; beginsWith is the default. This option is ignored for DOS ID searches.

## `entityStatus` (type: `string`):

Use this when declaring the status scope needed for the search. The actor's official NY Open Data source currently contains active entities; active is the default and inactive exits with an actionable warning. This is not a legal good-standing opinion.

## `entityTypes` (type: `array`):

Use this when limiting the active New York records to entity categories. Select any of corporation, limitedLiabilityCompany, limitedPartnership, or limitedLiabilityPartnership; all four are used by default. This is a client-side filter over the official active-entity dataset.

## `maxResults` (type: `integer`):

Use this when capping the number of unique active entity records returned and charged. Enter an integer from 1 to 500; the default is 50. This is a result cap, not a page count or API request limit.

## `requestDelayMs` (type: `integer`):

Use this when pacing requests to the official New York Open Data API. Enter 100 to 5000 milliseconds; the default is 400. Use a larger value for repeated runs, not as a substitute for a valid query.

## Actor input object example

```json
{
  "searchBy": "entityName",
  "query": "IBM",
  "searchFunctionality": "beginsWith",
  "entityStatus": "active",
  "entityTypes": [
    "corporation",
    "limitedLiabilityCompany"
  ],
  "maxResults": 25,
  "requestDelayMs": 800
}
```

# Actor output Schema

## `dataset` (type: `string`):

Structured entity records are stored in the default dataset.

## `summary` (type: `string`):

The OUTPUT key-value record contains run status, counts, source URLs, and warnings.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "IBM"
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/ny-business-entity-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "IBM" }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/ny-business-entity-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "IBM"
}' |
apify call muhammadafzal/ny-business-entity-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/ny-business-entity-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5YpDpXzpCeQTJQEJK/builds/ESRVisXgB3BtZ5uVk/openapi.json
