-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathindex.html
438 lines (387 loc) · 13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>NAICS API by Code for America</title>
<link rel="stylesheet" href="http://www.openstreetmap.us/~migurski/style.css" />
<style type="text/css">
<!--
h2 a, h3 a
{
font-weight: normal;
text-decoration: none;
opacity: 0.35;
}
dd
{
margin-left: 1em;
}
table
{
width: 90%;
}
td
{
vertical-align: top;
min-width: 320px;
}
td.example
{
white-space: pre;
font-family: monospace;
font-size: 85%;
}
td.example h4
{
font-size: 100%;
margin: 0;
padding: 0;
display: inline;
}
-->
</style>
</head>
<body>
<h1>NAICS API</h1>
<p>
The <a href="http://www.census.gov/eos/www/naics/">North American Industry Classification System</a>
(NAICS) is used by the U.S. Federal Government to organize different types of
businesses economic analysis purposes, and while there are different types of
numbering systems out there that do this, a lot of local municipalities have
also started adopting it for their own business classification purposes. The
NAICS codes and descriptions are revised every five years (latest: 2012;
next: 2017), and while information is freely provided as PDFs or Excel
spreadsheets and hosted by the U.S. Census Bureau, no machine-readable API
exists for retrieving this data that can be easily used in applications.
</p>
<p>
Until now.
</p>
<p>
With the NAICS API, you can:
</p>
<ul>
<li><a href="#one-code">Look up a single NAICS code.</a></li>
<li><a href="#searching">Search for a NAICS industry code.</a></li>
<li><a href="#all-data">Get all NAICS information for a year.</a></li>
<li><a href="#parents">Look up parent</a> and <a href="#descendants">descendant codes</a>.</li>
</ul>
<p>
<a href="http://www.codeforamerica.org"><img src="http://codeforamerica.org/wp-content/uploads/2011/12/CfA_logo-300x120.png" width="150" height="60"></a>
</p>
<p>
NAICS API is a product of Code for America’s
<a href="http://www.codeforamerica.org/2013-partners/las-vegas/">2013 Team Las Vegas</a>,
<a href="http://www.codeforamerica.org/2013-fellows/#Lou">Lou Huang</a>
and <a href="http://www.codeforamerica.org/2013-fellows/#Ryan%20Closner">Ryan Closner</a>,
with <a href="http://www.codeforamerica.org/who-we-are/">Michal Migurski</a>,
<a href="http://www.codeforamerica.org/2013-fellows/#Richa">Richa Agarwal</a>
and <a href="http://www.codeforamerica.org/2013-fellows/#Shaunak">Shaunak Kashyap</a>.
<a href="https://github.com/codeforamerica/naics-api">Source code on Github</a>.
</p>
<table>
<tr>
<td colspan="2">
<h2>One NAICS Code <a id="one-code" href="#one-code">¶</a></h2>
</td>
</tr>
<tr>
<td>
<p>
Retrieve available data for a single NAICS code from a given year,
including title, description, cross references, and index text.
</p>
<h3>Endpoint</h3>
<p>/v0/q</p>
<h3>Arguments</h3>
<dl>
<dt>year</dt>
<dd>The NAICS dataset year to request. Currently <samp>2007</samp> and <samp>2012</samp> are available.</dd>
<dt>code</dt>
<dd>The NAICS code to retrieve.</dd>
</dl>
<h3>Response Dictionary <a id="response-dict" href="#response-dict">¶</a></h3>
<dl>
<dt>code</dt><dd>2-6 digit NAICS code.</dd>
<dt>title</dt><dd>Name of the NAICS code.</dd>
<dt>seq_no</dt><dd>Sequence number. Appears to be used as a primary key in databases by some agencies.</dd>
<dt>change_indicator (2012 NAICS only)</dt><dd>If present, indicates whether this code changed from the previous (2007) NAICS.<br>1 = title changed from 2007 NAICS, but no content has changed.<br>2 = new code in 2012 NAICS.<br>3 = content changed from 2007 NAICS, and title may or may not have changed.</dd>
<dt>trilateral (2012 NAICS only)</dt><dd>If present, indicates that there is a trilateral agreement between Canada, Mexico, and the United States to use a comparable definition of this industry for this code.</dd>
<dt>description</dt><dd>If present, a text description in an array of paragraph strings.</dd>
<dt>description_code</dt><dd>If present, refers to another NAICS code description. If present, ignore the given description.</dd>
<dt>examples</dt><dd>If present, an array of illustrative examples.</dd>
<dt>crossrefs</dt><dd>If present, an array of cross-references to other NAICS codes that should be used to fine-tune a business classification. Both the text description of a cross-reference and its reference NAICS code is provided.</dd>
<dt>index (2012 6-digit codes only)</dt><dd> If present, an array of other titles that belong under this NAICS code. Useful as a keyword search to determine where specific businesses should be classified.<br><em>NOTE: Index entries exist for 2007 but are not currently available in NAICS API.</em></dd>
</dl>
</td>
<td class="example">
<h4>Definition</h4>
http://host:port/v0/q?year={year}&code={code}
<h4>Example Request</h4>
<a href="http://host:port/v0/q?year=2012&code=519120">http://host:port/v0/q?year=2012&code=519120</a>
<h4>Response</h4>
{
"code": 519120,
"title": "Libraries and Archives",
"seq_no": 1475,
"description": [
"This industry comprises establishments primarily
engaged in providing library or archive services.
These establishments are engaged in maintaining
collections and facilitating the use of such documents
as are required to meet the informational, research,
educational, or recreational needs of their user."
],
"crossrefs": [
{
"code": "512199",
"text": "Providing stock footage to the media,
multimedia, and advertising industries
--are classified in U.S. Industry 512199,
Other Motion Picture and Video Industries;"
},
...
],
"index": [
"Archives",
"Bookmobiles",
"Centers for documentation (i.e., archives)",
...
]
}
</td>
</tr>
<tr>
<td colspan="2">
<h2>Searching for a NAICS code <a id="searching" href="#searching">¶</a></h2>
</td>
</tr>
<tr>
<td>
<p>
Search for NAICS codes by term, get a list of matching codes in
approximate order of relevance.
</p>
<h3>Endpoint</h3>
<p>/v0/s</p>
<h3>Arguments</h3>
<dl>
<dt>year</dt>
<dd>The NAICS dataset year to request. Currently <samp>2007</samp> and <samp>2012</samp> are available.</dd>
<dt>code</dt>
<dd>The NAICS code to retrieve descendant codes for.</dd>
<dt>terms</dt>
<dd>Words to use when searching. Single words or pairs of words are best here, such as “software” or “software publishing”.</dd>
</dl>
<h3>Response</h3>
<p>
List of matching <a href="#response-dict">NAICS codes</a>.
</p>
</td>
<td class="example">
<h4>Definition</h4>
http://host:port/v0/s?year={year}&terms={search terms}
<h4>Example Request</h4>
<a href="http://host:port/v0/s?year=2012&terms=Internet">http://host:port/v0/s?year=2012&terms=Internet</a>
<h4>Response</h4>
[
{
"code": 511,
"title": "Publishing Industries (except Internet)",
"description": [
"Industries in the Publishing Industries (except Internet)
subsector group establishments engaged in the publishing
of newspapers, magazines, other periodicals, and books,
as well as directory and mailing list and software
publishing.",
...
],
...
},
{
"code": 515,
"title": "Broadcasting (except Internet)",
...
},
{
"code": 519130,
"title": "Internet Publishing and Broadcasting
and Web Search Portals",
...
},
...
]
</td>
</tr>
<tr>
<td colspan="2">
<h2>All NAICS information for a year <a id="all-data" href="#all-data">¶</a></h2>
</td>
</tr>
<tr>
<td>
<p>
Complete information for a single year is available in one API
request. The returned data will be large, up to 2.5MB for 2012 data.
</p>
<h3>Endpoint</h3>
<p>/v0/q</p>
<h3>Arguments</h3>
<dl>
<dt>year</dt>
<dd>The NAICS dataset year to request. Currently <samp>2007</samp> and <samp>2012</samp> are available.</dd>
</dl>
<h3>Response</h3>
<p>
List of <a href="#response-dict">NAICS codes</a> for a year.
</p>
</td>
<td class="example">
<h4>Definition</h4>
http://host:port/v0/q?year={year}
<h4>Example Request</h4>
<a href="http://host:port/v0/q?year=2012">http://host:port/v0/q?year=2012</a>
<h4>Response</h4>
[
{
"code": 11,
"title": "Agriculture, Forestry, Fishing and Hunting",
"description":
[
"The Sector as a Whole",
"The Agriculture, Forestry, Fishing and Hunting
sector comprises establishments primarily engaged
in growing crops, raising animals, harvesting timber,
and harvesting fish and other animals from a farm,
ranch, or their natural habitats."
],
...
},
{
"code": 21,
"title": "Mining, Quarrying, and Oil and Gas Extraction",
"description": [ "The Sector as a Whole", ... ],
...
},
...
]
</td>
</tr>
<tr>
<td colspan="2">
<h2>Parent Codes <a id="parents" href="#parents">¶</a></h2>
</td>
</tr>
<tr>
<td>
<p>
NAICS is a nested and hierarchical data set. For example, libraries
and archives are a subcategory to information services. Retrieve a
complete list of parent codes for a given code.
</p>
<h3>Endpoint</h3>
<p>/v0/q</p>
<h3>Arguments</h3>
<dl>
<dt>year</dt>
<dd>The NAICS dataset year to request. Currently <samp>2007</samp> and <samp>2012</samp> are available.</dd>
<dt>code</dt>
<dd>The NAICS code to retrieve parent codes for.</dd>
<dt>above</dt>
<dd><samp>1</samp> to include parent codes.</dd>
</dl>
<h3>Response</h3>
<p>
List of parent <a href="#response-dict">NAICS codes</a>.
</p>
</td>
<td class="example">
<h4>Definition</h4>
http://host:port/v0/q?year={year}&code={code}&above=1
<h4>Example Request</h4>
<a href="http://host:port/v0/q?year=2012&code=5191&above=1">http://host:port/v0/q?year=2012&code=5191&above=1</a>
<h4>Response</h4>
[
{
"code": 51,
"title": "Information",
"description": [
"The Sector as a Whole",
"The Information sector comprises establishments engaged...",
...
],
...
},
{
"code": 519,
"title": "Other Information Services",
"description": [
"Industries in the Other Information Services subsector...",
...
],
...
}
]
</td>
</tr>
<tr>
<td colspan="2">
<h2>Descendant Codes <a id="descendants" href="#descendants">¶</a></h2>
</td>
</tr>
<tr>
<td>
<p>
NAICS is a nested and hierarchical data set. For example, information
services include news syndicates as a subcategory. Retrieve a
complete list of descendant codes for a given code.
</p>
<h3>Endpoint</h3>
<p>/v0/q</p>
<h3>Arguments</h3>
<dl>
<dt>year</dt>
<dd>The NAICS dataset year to request. Currently <samp>2007</samp> and <samp>2012</samp> are available.</dd>
<dt>code</dt>
<dd>The NAICS code to retrieve descendant codes for.</dd>
<dt>below</dt>
<dd><samp>1</samp> to include descendant codes.</dd>
</dl>
<h3>Response</h3>
<p>
List of descendant <a href="#response-dict">NAICS codes</a>.
</p>
</td>
<td class="example">
<h4>Definition</h4>
http://host:port/v0/q?year={year}&code={code}&below=1
<h4>Example Request</h4>
<a href="http://host:port/v0/q?year=2012&code=5191&below=1">http://host:port/v0/q?year=2012&code=5191&below=1</a>
<h4>Response</h4>
[
{
"code": 51911,
"title": "News Syndicates",
"description": [
"See industry description for 519110."
],
"description_code": "519110",
...
},
{
"code": 519110,
"title": "News Syndicates",
"description": [
"This industry comprises establishments primarily engaged
in supplying information, such as news reports, articles,
pictures, and features, to the news media."
],
...
},
...
]
</td>
</tr>
</table>
</body>
</html>