naics-api

Basic API to return NAICS codes and information

Subscribe to updates I use naics-api


Statistics on naics-api

Number of watchers on Github 40
Number of open issues 10
Average time to close an issue 20 days
Main language Python
Average time to merge a PR 1 day
Open pull requests 0+
Closed pull requests 3+
Last commit over 4 years ago
Repo Created about 5 years ago
Repo Last Updated 3 months ago
Size 12.1 MB
Organization / Authorcodeforamerica
Contributors4
Page Updated
Do you use naics-api? Leave a review!
View open issues (10)
View naics-api activity
View on github
Latest Open Source Launches
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating naics-api for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

NAICS-API

NAICS (North American Industry Classification System) is maintained by the United States Bureau of Labor Statistics to classify business types. It is used for aggregating, presenting, and analyzing data and trends in the US economy.

The classification system is currently hosted by the Census Bureau and provided in various Excel and PDF documents, with some rudimentary HTML output and a not-so-great search tool. Our goal is to improve on the Census Bureau's offerings by providing an API to make information machine-readable, with better search functionality, to assist with developing applications that depend on understanding or collecting information about businesses.

The Product

NAICS API is currently a Node.js server that returns NAICS data in a JSON format. Information stored on the server has been scraped or collected from files on the Census.gov web site. Most of the information for 2007 and 2012 has now been scraped thanks to the addition of a python scraper by Mike Migurski (see ./data/scrape-examples-xrefs).

API documentation

Latest API documentation is hosted at Apiary.io.

API example requests

Example request

http://api.naics.us/v0/q?year=2012&code=519120

To get NAICS codes above a given code

http://api.naics.us/v0/q?year=2012&code=519120&above=1

To get NAICS codes below a given code

http://api.naics.us/v0/q?year=2012&code=51&below=1

To get all NAICS codes for a given years codes (only 2007 and 2012 are available right now)

http://api.naics.us/v0/q?year=2012

To get all NAICS codes for given search terms (searches only title and index right now)

http://api.naics.us/v0/s?year=2012&terms=libraries

Warning! The URL (server and/or structure) is likely to change in the very near future. Do not use for production (yet).

Usage

Additional information

Development setup (on Mac OS X 10.8)

First-time setup

1) Download and install Node.js.

2) Clone this repository to a folder on your computer. The rest of this document will refer to this folder as $PROJECT_ROOT.

3) Install project dependencies.

cd $PROJECT_ROOT
npm install

Every time you sync $PROJECT_ROOT with the remote GitHub repo

1) Update the project dependencies.

cd $PROJECT_ROOT
npm install

To start the REST API server

1) Start the REST API server.

cd $PROJECT_ROOT
npm start

Contributing

Help Needed

There are other data that can be included in the API. Not all of these are within the scope of the scraper however.

  • Illustrative examples from 2007 NAICS
  • Information from NAICS prior to 2007 (2002, 1997 - low priority)
  • Data for converting between different NAICS codes and other systems, like SIC or NIGP

On the API side:

  • The API should perform searches on all the available data and return relevant results from the requester (e.g. a business type lookup application)
  • Close existing issues.

Submitting an Issue

We use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, and operating system. Ideally, a bug report should include a pull request with failing specs.

Submitting a Pull Request

  1. Fork the repository.
  2. Create a topic branch.
  3. Add specs for your unimplemented feature or bug fix.
  4. Implement your feature or bug fix.
  5. Add, commit, and push your changes.
  6. Submit a pull request.

Code for America Tracker

naics-api open issues Ask a question     (View All Issues)
  • over 4 years Search results should include entries that contain search terms that are separated by other words
  • over 4 years Search function should accept NAICS codes as search terms
  • over 4 years Improve search functionality (goal is to improve how it returns results for lv-dof)
  • almost 5 years 2007 Illustrative Examples are not included
  • about 5 years Searches on index entries or some way of indexing synonyms
  • about 5 years Add Jasmine tests to help document features
  • about 5 years Allow for queries or searches to be performed on a digit limit range.
  • about 5 years Search terms that are separate words should match text separately
  • about 5 years Provide a way to convert between codes of different years.
  • about 5 years NAICS 2-digit codes that are ranges will break above & below retrieval
naics-api list of languages used
Other projects in Python