forked from codeforamerica/naics-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
247 lines (231 loc) · 8.53 KB
/
apiary.apib
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
HOST: http://api.naics.us/v0/
--- NAICS API ---
---
The [North American Industry Classification System](http://www.census.gov/eos/www/naics/) (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. Until now.
---
--
Retrieving NAICS codes
How to get codes, and information related to that code
#### Data Schema
* __code__ This is the 2-6 digit NAICS code.
* __title__ This is the name of the NAICS code.
* __seq_no__ This is a sequence number provided by NAICS and appears to be used as a primary key in databases by some agencies. Do not use this except for backwards-compatibility with other software.
* __change_indicator (2012 NAICS only)__ If present, indicates whether this code changed from the previous (2007) NAICS.
* __1 = title changed__ from 2007 NAICS, but no content has changed.
* __2 = new code__ in 2012 NAICS.
* __3 = content changed__ from 2007 NAICS, and title may or may not have changed.
* __trilateral (2012 NAICS only)__ 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.
* __description__ If present, this is the text description of this NAICS Code provided by the NAICS Definition File.
* __description_code__ If present, this refers to another NAICS Code description. This will never be present if __description__ for this code is present.
* __examples__ If present, this is an array of illustrative examples provided by the NAICS Definition File.
* __crossrefs__ If present, this is an array of cross-references to other NAICS codes that should be used to fine-tune a business classification, provided by the NAICS Definition File. Both the text description of a cross-reference and its reference NAICS code is provided.
* __index__ (2012 6-digit codes only) If present, this is an array of other titles that belong under this NAICS code, provided by the NAICS Index File. Very useful as a keyword search to determine where specific businesses should be classified. NOTE: Index entries exist for 2007 but are not currently available in NAICS API.
--
Get all NAICS codes for a given year (only 2007 and 2012 are available right now.)
GET /q{?year}
> Accept: application/json
< 200
< Content-Type: application/json
{
"name": "2012 NAICS Codes",
"year": 2012,
"items": [
{
"seq_no": 1,
"code": 11,
"title": "Agriculture, Forestry, Fishing and Hunting",
"trilateral": 1
},
{ ... }
]
}
Get a single NAICS code.
GET /q{?year,code}
> Accept: application/json
< 200
< Content-Type: application/json
{
"seq_no": 1663,
"code": 541430,
"title": "Graphic Design Services",
"index": [
"Art services, commercial",
"Art services, graphic",
"Art studios, commercial",
"Artists, independent commercial",
"Artists, independent graphic",
"Artists, independent medical",
"Commercial art services",
"Commercial artists, independent",
"Commercial illustration services",
"Commercial illustrators, independent",
"Communication design services, visual",
"Corporate identification (i.e., logo) design services",
"Graphic art and related design services",
"Graphic artists, independent",
"Graphic design services",
"Illustrators, independent commercial",
"Medical art services",
"Medical artists, independent",
"Medical illustration services",
"Medical illustrators, independent",
"Silk screen design services",
"Studios, commercial art"
]
}
Get all NAICS codes above in the hierarchy of the requested code.
GET /q{?year,code,above}
> Accept: application/json
< 200
< Content-Type: application/json
[
{
"seq_no": 1402,
"code": 51,
"title": "Information",
"trilateral": 1
},
{
"seq_no": 1470,
"code": 519,
"title": "Other Information Services",
"trilateral": 1
},
{
"seq_no": 1471,
"code": 5191,
"title": "Other Information Services",
"trilateral": 1
},
{
"seq_no": 1474,
"code": 51912,
"title": "Libraries and Archives",
"trilateral": 1
}
]
Get all NAICS codes below in the hierarchy of the requested code.
GET /q{?year,code,below}
> Accept: application/json
< 200
< Content-Type: application/json
[
{
"seq_no": 1403,
"code": 511,
"title": "Publishing Industries (except Internet)",
"trilateral": 1
},
{
"seq_no": 1404,
"code": 5111,
"title": "Newspaper, Periodical, Book, and Directory Publishers",
"trilateral": 1
},
{
"seq_no": 1405,
"code": 51111,
"title": "Newspaper Publishers",
"trilateral": 1
},
{
"seq_no": 1406,
"code": 511110,
"title": "Newspaper Publishers",
},
{
"seq_no": 1407,
"code": 51112,
"title": "Periodical Publishers",
"trilateral": 1
},
{
"seq_no": 1408,
"code": 511120,
"title": "Periodical Publishers",
},
{ ... }
]
--
Searching for a NAICS code
Find the NAICS code for the business type
--
Returns an array of all the NAICS codes that contain search terms in the title or index listing.
Currently, this does not search description, illustrative examples, or cross references because we don't have this information yet.
Example shows search term for "libraries"
GET /s{?year,terms}
> Accept: application/json
< 200
< Content-Type: application/json
[
{
"seq_no": 1474,
"code": 51912,
"title": "Libraries and Archives",
"trilateral": 1
},
{
"seq_no": 1475,
"code": 519120,
"title": "Libraries and Archives",
"index": [
"Archives",
"Bookmobiles",
"Centers for documentation (i.e., archives)",
"Circulating libraries",
"Film archives",
"Lending libraries",
"Libraries (except motion picture stock footage, motion picture commercial distribution)",
"Motion picture film libraries, archives",
"Music archives",
"Reference libraries"
]
},
{
"seq_no": 1424,
"code": 512120,
"title": "Motion Picture and Video Distribution",
"index": [
"Animated cartoon distribution",
"Film distribution agencies",
"Film distribution, motion picture and video",
"Film libraries, commercial distribution",
"Motion picture distribution exclusive of production",
"Motion picture film distributors",
"Motion picture film libraries",
"Tape distribution for television",
"Television show syndicators"
]
},
{
"seq_no": 1430,
"code": 512199,
"title": "Other Motion Picture and Video Industries",
"index": [
"Booking agencies, motion picture",
"Booking agencies, motion picture or video productions",
"Film libraries, motion picture or video, stock footage",
"Film processing laboratories, motion picture",
"Film restoration services",
"Laboratory services, motion picture",
"Libraries, motion picture stock footage film",
"Libraries, videotape, stock footage",
"Motion picture booking agencies",
"Motion picture film laboratories",
"Motion picture film libraries, stock footage",
"Motion picture film reproduction for theatrical distribution",
"Motion picture laboratories",
"Reproduction of motion picture films for theatrical distribution",
"Stock footage film libraries",
"Videotape libraries, stock footage"
]
}
]
--
Conversions between NAICS years and other code systems
For instance, SIP or NIGP. (this is a placeholder for a potential future feature.)
--