business-name-check 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,7 +23,7 @@ It needs Node 20.12 or newer, has no dependencies, and runs with no API keys at
23
23
  | United Kingdom | Companies House | Companies and LLPs | Free API key | Needs key |
24
24
  | New Zealand | NZBN register | Companies, trusts, sole traders with an NZBN | Free subscription key | Needs key (not yet run against a live key) |
25
25
  | United States | SEC EDGAR company list | SEC registrants only | Your own User-Agent string | Needs a contact string |
26
- | United States | NY, CO, CT and OR open data | Business registers of those four states | None | Works with no key |
26
+ | United States | NY, CO, CT, OR, PA, DC and TX open data | Business registers of those states, plus DC trade names and Texas franchise-tax and sales-tax accounts | None | Works with no key |
27
27
  | All | Domain names (RDAP, WHOIS for .nz) | `.com`, plus `.com.au`, `.co.nz`, `.co.uk` for the countries you pick | None | Works with no key |
28
28
 
29
29
  ### What it does not cover
@@ -33,7 +33,7 @@ These registers have no open search API, so the tool prints a link for you to ch
33
33
  - **UK IPO trade marks.** The search site blocks automated access with a captcha, and there is no public API.
34
34
  - **IPONZ (NZ trade marks).** IPONZ does offer a trade mark search API (`POST /trademarksearch`), through the same MBIE developer portal as the NZBN. You subscribe with your RealMe login, and the endpoint definition is only visible once you are signed in, so it is not scripted here yet. Pull requests welcome if you have access.
35
35
  - **USPTO trade marks.** The USPTO's open APIs cover case status by serial number and bulk downloads, not name search. Its search website runs on an internal backend that is not a published API. Some third-party tools call that backend or run their own index. This tool does not, because those routes are unofficial and can change or disappear without notice. Search the USPTO by hand at the link the tool prints.
36
- - **Most US state registers.** There is no national US business register. The tool covers the four states that publish their register as open data (New York, Colorado, Connecticut, Oregon). Delaware, California, Texas, Florida and the rest have no free API and often use captchas, so you get a link to the NASS directory instead. OpenCorporates aggregates many state registers, but it is a paid API with internal-use licence terms, so it is not included.
36
+ - **Most US state registers.** There is no national US business register. The tool covers the states and districts that publish business data as free open data: New York, Colorado, Connecticut, Oregon, Pennsylvania, the District of Columbia and Texas. Two of those are partial. Pennsylvania lists active registrations only, and the Texas data comes from the Comptroller (franchise-tax and sales-tax accounts), so sole proprietors, most general partnerships and assumed names are missing, and the status codes are read as A active, R revoked and F forfeited. Delaware, California, Florida and the rest have no free name-search API (most sell bulk files, or use captchas), so you get links to check by hand instead: a pre-filled results page for Florida, landing pages for a dozen other large states, and the NASS directory for the rest. Many of those sites block scripts or show a captcha, which is why the tool does not open them for you. OpenCorporates aggregates many state registers, but it is a paid API with internal-use licence terms, so it is not included.
37
37
 
38
38
  Also not covered: common-law (unregistered) trade mark use, social handles, company names in countries other than the four above, and sound-alike or meaning-alike names.
39
39
 
@@ -150,8 +150,8 @@ The tool is a polite client: it waits at least 250 ms between requests to the sa
150
150
  | ABN Lookup | Fair use under the terms you accept when you register for the GUID. Do not hammer it. |
151
151
  | NZBN | Throttled per subscription. Retries on 429. |
152
152
  | IP Australia | 600 requests per minute on the base tier. Each run makes up to about 60 record fetches. |
153
- | RDAP and WHOIS (domains) | No published limits. A run makes about eight lookups across four registry servers. `.nz` WHOIS is for single queries only, so no bulk use. |
154
- | US state open data | Keyless requests are throttled per IP. Set `SOCRATA_APP_TOKEN` (free from each portal) if you hit limits. |
153
+ | RDAP and WHOIS (domains) | No published limits. A run makes about eight lookups across four registry servers. `.nz` WHOIS is for single queries only, so no bulk use. auDA (`.com.au`) rate-limits hard: repeated runs in a burst can get an IP blocked for hours, and the tool then reports that domain as "could not check". |
154
+ | US state open data | Keyless requests to the Socrata portals are throttled per IP. Set `SOCRATA_APP_TOKEN` (free from each portal) if you hit limits. DC's ArcGIS service publishes no limit, so requests go one at a time. |
155
155
  | data.gov.au (ASIC) | No published limit. The tool makes about four requests per run. |
156
156
 
157
157
  You are responsible for using each register within its terms. In particular, do not use results to build a bulk copy of any register.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "business-name-check",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Check whether a business or brand name is already taken on official business and trade mark registers (Australia, New Zealand, UK, US).",
5
5
  "type": "module",
6
6
  "bin": {
package/src/format.js CHANGED
@@ -11,7 +11,7 @@ const bold = (s) => c(1, s);
11
11
  const TAG = { exact: (s) => red(bold(s)), close: yellow, related: dim };
12
12
 
13
13
  function line(m, indent) {
14
- const bits = [m.status, m.type, m.id].filter(Boolean).join(' | ');
14
+ const bits = [m.details?.state, m.status, m.type, m.id].filter(Boolean).join(' | ');
15
15
  const label = m.match.toUpperCase() + (m.active === false ? ' (inactive)' : '');
16
16
  const out = [`${indent}${TAG[m.match](label.padEnd(7))} ${m.name}${bits ? dim(` (${bits})`) : ''}`];
17
17
  if (m.url) out.push(`${indent} ${dim(m.url)}`);
@@ -55,52 +55,127 @@ export const secEdgar = {
55
55
  },
56
56
  };
57
57
 
58
- // US states that publish their business register as open data (Socrata), no key needed.
59
- // Delaware, California, Texas, Florida and most others do not, so they are manual links.
60
- const STATES = [
58
+ // US states and cities that publish their business register as open data, no key needed.
59
+ // Delaware, California, Florida and most other states do not, so they are manual links.
60
+ const DC_BASE = 'https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Business_Licensing_and_Grants_WebMercator/FeatureServer';
61
+ const isoDate = (v) => (typeof v === 'number' ? new Date(v).toISOString().slice(0, 10) : v?.slice?.(0, 10));
62
+ const trim = (v) => (typeof v === 'string' ? v.trim() : v);
63
+ const TX_STATUS = { A: ['Active', true], R: ['Revoked', false], F: ['Forfeited', false] };
64
+
65
+ /** Upper-case alphanumeric words, safe to put inside a LIKE pattern. */
66
+ const likeWords = (name) => nameKey(name).split(' ').map((w) => w.toUpperCase().replace(/[^A-Z0-9]/g, '')).filter(Boolean);
67
+ const socrataQ = (host, dataset) => ({ q, limit }) => {
68
+ const url = new URL(`https://${host}/resource/${dataset}.json`);
69
+ url.searchParams.set('$q', q);
70
+ url.searchParams.set('$limit', String(Math.min(Math.max(limit, 5), 50)));
71
+ return url.toString();
72
+ };
73
+ const arcgis = (layer, field, outFields) => ({ words }) => {
74
+ const url = new URL(`${DC_BASE}/${layer}/query`);
75
+ url.searchParams.set('where', words.map((w) => `UPPER(${field}) LIKE '%${w}%'`).join(' AND '));
76
+ url.searchParams.set('outFields', outFields);
77
+ url.searchParams.set('returnGeometry', 'false');
78
+ url.searchParams.set('resultRecordCount', '100');
79
+ url.searchParams.set('f', 'json');
80
+ return url.toString();
81
+ };
82
+
83
+ const SOURCES = [
61
84
  {
62
- state: 'NY', host: 'data.ny.gov', dataset: 'n9v6-gdp6',
85
+ state: 'NY', url: socrataQ('data.ny.gov', 'n9v6-gdp6'),
63
86
  map: (r) => ({ name: r.current_entity_name, id: r.dos_id, type: r.entity_type, status: 'Active entity', active: true, filed: r.initial_dos_filing_date }),
64
87
  },
65
88
  {
66
- state: 'CO', host: 'data.colorado.gov', dataset: '4ykn-tg5h',
89
+ state: 'CO', url: socrataQ('data.colorado.gov', '4ykn-tg5h'),
67
90
  map: (r) => ({ name: r.entityname, id: r.entityid, type: r.entitytype, status: r.entitystatus, active: !/dissol|withdrawn|expired|cancel|revoked|merged|inactive/i.test(r.entitystatus ?? ''), filed: r.entityformdate }),
68
91
  },
69
92
  {
70
- state: 'CT', host: 'data.ct.gov', dataset: 'n7gp-d28j',
93
+ state: 'CT', url: socrataQ('data.ct.gov', 'n7gp-d28j'),
71
94
  map: (r) => ({ name: r.name, id: r.accountnumber, type: r.business_type, status: r.status, active: !/dissol|withdrawn|expired|cancel|revoked|merged|inactive|reservation/i.test(r.status ?? ''), filed: r.date_registration }),
72
95
  },
73
96
  {
74
- state: 'OR', host: 'data.oregon.gov', dataset: 'tckn-sxa6',
97
+ state: 'OR', url: socrataQ('data.oregon.gov', 'tckn-sxa6'),
75
98
  map: (r) => ({ name: r.business_name, id: r.registry_number, type: r.entity_type, status: 'Active business', active: true, filed: r.registry_date, url: r.business_details?.url }),
76
99
  },
100
+ {
101
+ // Active registrations only. $q would also match officer surnames, so filter on the business name.
102
+ state: 'PA',
103
+ url: ({ words, limit }) => {
104
+ const url = new URL('https://data.pa.gov/resource/xvd7-5r2c.json');
105
+ url.searchParams.set('$where', words.map((w) => `upper(business_name) like '%${w}%'`).join(' AND '));
106
+ url.searchParams.set('$select', 'distinct business_name,filing_number,typeofbusinessregistration,creationdate');
107
+ url.searchParams.set('$limit', String(Math.min(Math.max(limit, 5), 100)));
108
+ return url.toString();
109
+ },
110
+ map: (r) => ({ name: r.business_name, id: r.filing_number, type: r.typeofbusinessregistration, status: 'Active registration', active: true, filed: r.creationdate }),
111
+ },
112
+ {
113
+ state: 'DC', source: 'DC Department of Licensing and Consumer Protection',
114
+ url: arcgis(0, 'BUSINESS_NAME', 'FILE_NUMBER,BUSINESS_NAME,ENTITY_STATUS,MODELTYPE,EFFECTIVE_DATE'),
115
+ rows: (j) => j.features?.map((f) => f.attributes) ?? [],
116
+ map: (r) => ({ name: r.BUSINESS_NAME, id: r.FILE_NUMBER, type: r.MODELTYPE, status: r.ENTITY_STATUS, active: /^active/i.test(r.ENTITY_STATUS ?? ''), filed: isoDate(r.EFFECTIVE_DATE) }),
117
+ },
118
+ {
119
+ state: 'DC', source: 'DC trade names',
120
+ url: arcgis(1, 'TRADE_NAME', 'FILE_NUMBER,TRADE_NAME,TRADENAME_STATUS,EFFECTIVE_DATE,TRADENAME_EXPIRATIONDATE'),
121
+ rows: (j) => j.features?.map((f) => f.attributes) ?? [],
122
+ map: (r) => ({
123
+ name: r.TRADE_NAME, id: r.FILE_NUMBER, type: 'Trade name', status: r.TRADENAME_STATUS,
124
+ active: /^active/i.test(r.TRADENAME_STATUS ?? '') && !(r.TRADENAME_EXPIRATIONDATE && r.TRADENAME_EXPIRATIONDATE < Date.now()),
125
+ filed: isoDate(r.EFFECTIVE_DATE),
126
+ }),
127
+ },
128
+ {
129
+ // Entities with a Texas Comptroller franchise-tax account. Not the full Secretary of State register:
130
+ // sole proprietors, most general partnerships and assumed names are missing.
131
+ state: 'TX', source: 'Texas Comptroller franchise tax',
132
+ url: socrataQ('data.texas.gov', '9cir-efmm'),
133
+ map: (r) => {
134
+ const code = trim(r.sos_status_code);
135
+ const [label, active] = TX_STATUS[code] ?? [code ? `SOS status ${code}` : 'Status not given', null];
136
+ return { name: trim(r.taxpayer_name), id: trim(r.secretary_of_state_sos_or_coa_file_number), type: `Franchise tax account (${trim(r.taxpayer_organizational_type) ?? 'type not given'})`, status: label, active, filed: r.sos_charter_date };
137
+ },
138
+ },
139
+ {
140
+ // Retail outlets with a sales tax permit. Adds trade names, but only for businesses that sell taxable goods.
141
+ state: 'TX', source: 'Texas Comptroller sales tax permits',
142
+ url: socrataQ('data.texas.gov', 'jrea-zgmq'),
143
+ map: (r) => ({ name: trim(r.outlet_name) || trim(r.taxpayer_name), id: trim(r.taxpayer_number), type: 'Sales tax permit outlet', status: 'Active permit', active: true, filed: r.outlet_permit_issue_date }),
144
+ },
77
145
  ];
78
146
 
147
+ const STATE_LIST = [...new Set(SOURCES.map((s) => s.state))];
148
+
79
149
  export const usStateOpenData = {
80
150
  id: 'us-state-open-data',
81
151
  country: 'US',
82
152
  kind: 'business',
83
- label: 'US state open data (NY, CO, CT, OR only)',
153
+ label: `US state open data (${STATE_LIST.join(', ')})`,
84
154
  env: [],
85
- coverage: 'Four states that publish their business register as open data. Other states, including Delaware, California, Texas and Florida, are not covered.',
155
+ coverage: 'Seven US jurisdictions that publish business data as open data. Texas covers franchise-tax and sales-tax accounts only, not the full Secretary of State register. Delaware, California and Florida, among others, are not covered.',
86
156
  async search(name, env, { limit }) {
87
157
  const q = nameKey(name).split(' ').filter(Boolean).join(' ');
88
- const jobs = STATES.map(async (s) => {
89
- const url = new URL(`https://${s.host}/resource/${s.dataset}.json`);
90
- url.searchParams.set('$q', q);
91
- url.searchParams.set('$limit', String(Math.min(Math.max(limit, 5), 50)));
92
- const headers = env.SOCRATA_APP_TOKEN ? { 'X-App-Token': env.SOCRATA_APP_TOKEN } : {};
93
- const rows = (await request(url.toString(), { headers })).json();
158
+ const words = likeWords(name);
159
+ if (!words.length) return { total: 0, matches: [] };
160
+ const headers = env.SOCRATA_APP_TOKEN ? { 'X-App-Token': env.SOCRATA_APP_TOKEN } : {};
161
+ const jobs = SOURCES.map(async (s) => {
162
+ const res = await request(s.url({ q, words, limit }), { headers: s.state === 'DC' ? {} : headers });
163
+ const json = res.json();
164
+ if (json.error) throw new Error(json.error.message ?? 'Register returned an error');
165
+ const rows = s.rows ? s.rows(json) : json;
94
166
  return rows.map((r) => {
95
167
  const m = s.map(r);
96
- return { ...m, url: m.url ?? null, details: { state: s.state, filed: m.filed } };
168
+ return { ...m, url: m.url ?? null, details: { state: s.state, source: s.source, filed: m.filed } };
97
169
  });
98
170
  });
99
171
  const settled = await Promise.allSettled(jobs);
100
172
  if (settled.every((r) => r.status === 'rejected')) throw settled[0].reason;
101
- const matches = settled.flatMap((r) => (r.status === 'fulfilled' ? r.value : [])).filter((m) => m.name);
173
+ const seen = new Set();
174
+ const matches = settled.flatMap((r) => (r.status === 'fulfilled' ? r.value : []))
175
+ .filter((m) => m.name)
176
+ .filter((m) => { const k = `${m.details.state}|${m.details.source}|${m.id}|${m.name}`; return seen.has(k) ? false : seen.add(k); });
102
177
  matches.sort((a, b) => RANK[classify(name, a.name)] - RANK[classify(name, b.name)]);
103
- const failed = settled.map((r, i) => (r.status === 'rejected' ? STATES[i].state : null)).filter(Boolean);
178
+ const failed = [...new Set(settled.map((r, i) => (r.status === 'rejected' ? SOURCES[i].source ?? SOURCES[i].state : null)).filter(Boolean))];
104
179
  return {
105
180
  total: matches.length,
106
181
  matches,
@@ -109,8 +184,24 @@ export const usStateOpenData = {
109
184
  },
110
185
  };
111
186
 
187
+ // Hand-check links for states with no open API. Only Florida accepts a pre-filled name in the URL
188
+ // (checked in a browser); the rest are landing pages where you type the name yourself. Several of
189
+ // these sites sit behind bot protection or a captcha, so they are for people, not for scripts.
112
190
  export const usManual = [
113
191
  { label: 'USPTO trademark search (no open search API)', url: () => 'https://tmsearch.uspto.gov/search/search-information' },
114
- { label: 'Delaware entity name search (captcha-protected)', url: () => 'https://icis.corp.delaware.gov/ecorp/entitysearch/namesearch.aspx' },
115
- { label: 'State business register directory (NASS)', url: () => 'https://www.nass.org/business-services/corporate-registration' },
192
+ { label: 'Florida Sunbiz entity name search (results page)', url: (name) => `https://search.sunbiz.org/Inquiry/CorporationSearch/SearchResults/EntityName/${encodeURIComponent(String(name).trim())}/Page1` },
193
+ { label: 'California business search (type the name)', url: () => 'https://bizfileonline.sos.ca.gov/search/business' },
194
+ { label: 'Delaware entity name search (captcha, type the name)', url: () => 'https://icis.corp.delaware.gov/ecorp/entitysearch/namesearch.aspx' },
195
+ { label: 'Washington business search (type the name)', url: () => 'https://ccfs.sos.wa.gov/' },
196
+ { label: 'Arizona entity search (type the name)', url: () => 'https://arizonabusinesscenter.azcc.gov/EntitySearch/Index' },
197
+ { label: 'Nevada entity search (type the name)', url: () => 'https://esos.nv.gov/EntitySearch/OnlineEntitySearch' },
198
+ { label: 'Georgia business search (type the name)', url: () => 'https://ecorp.sos.ga.gov/BusinessSearch' },
199
+ { label: 'Illinois business entity search (type the name)', url: () => 'https://apps.ilsos.gov/businessentitysearch/' },
200
+ { label: 'North Carolina business search (type the name)', url: () => 'https://www.sosnc.gov/online_services/search/by_title/_Business_Registration' },
201
+ { label: 'Ohio business search (type the name)', url: () => 'https://businesssearch.ohiosos.gov/' },
202
+ { label: 'Michigan business search (type the name)', url: () => 'https://mibusinessregistry.lara.state.mi.us/search/business' },
203
+ { label: 'New Jersey business name search (type the name)', url: () => 'https://www.njportal.com/DOR/BusinessNameSearch/Search/BusinessName' },
204
+ { label: 'Massachusetts corporations search (type the name)', url: () => 'https://corp.sec.state.ma.us/corpweb/CorpSearch/CorpSearch.aspx' },
205
+ { label: 'Virginia entity search (type the name)', url: () => 'https://cis.scc.virginia.gov/EntitySearch/Index' },
206
+ { label: 'Other states: directory of every state register (NASS)', url: () => 'https://www.nass.org/business-services/corporate-registration' },
116
207
  ];