NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

NAICS Code API

The NAICS Code API covers the full North American Industry Classification System: all 2,125 codes with their official titles, descriptions and hierarchy, the 20,373 Census index terms and the 4,601 cross-reference rules.

On top of the taxonomy it answers the questions people actually look a code up for — whether a business is small under SBA rules, which single code a description belongs to, and how risky an industry is to onboard.

NAICS is published by the U.S. Census Bureau under the Office of Management and Budget and is in the public domain. Size standards come from 13 CFR 121.201.

Available endpoints:

(4.5)

From 7,915 users

2,100+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
175ms218ms267ms596ms1059ms

Didn't find what you were looking for? Suggest an improvement

5 endpoints

https://api.api-ninjas.com/v1/naics

Returns the official title, description, full hierarchy, children, index terms and cross-reference rules for a NAICS 2022 code. Available on all plans, including Free.

Pass crosswalk_to to also map the code to an earlier NAICS revision.


Parameters

  • code  optional

    A 2 to 6 digit NAICS code, for example 541511. Required unless codes or title is supplied. Sector aliases resolve automatically: 32 returns the published 31-33 sector.

  • codes  optional

    Comma-separated codes for a batch lookup. Up to 50 on Developer and 500 on Business and above.

  • title  optional

    Look up by official title instead of code. Partial matches are supported and up to 25 results are returned.

  • year  optional

    NAICS revision. Currently 2022 only; NAICS 2027 is not published by the Census Bureau until January 2027.

  • country  optional

    Currently US only. NAICS Canada and SCIAN Mexico are not yet available.

  • crosswalk_to  optional

    Map the code to an earlier revision. Currently 2017 only.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields:

  • code

    The NAICS code.

  • title

    Official Census title for the code.

  • level

    Digit length: 2 sector through 6 national industry.

  • level_name

    One of sector, subsector, industry_group, industry, national_industry.

  • description

    The official Census definition of the industry.

  • hierarchy

    Array of every ancestor from sector down to this code, each with code, level and title.

  • parent

    The immediate parent code, or null for a sector.

  • children

    Array of immediate child codes.

  • index_terms

    The official Census index terms assigned to this code — the phrases the Census Bureau itself files under it.

  • cross_references

    The “classified elsewhere” rules that bear on this code.

  • crosswalk

    Only when crosswalk_to is supplied. Contains change_type (unchanged, renumbered, split, merged or new) and the predecessor mappings.

Sample Request Live Demo!

code
crosswalk_to

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/naics?code=541511&crosswalk_to=2017

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    code:"541511",
    title:"Custom Computer Programming Services",
    level:6,
    level_name:"national_industry",
    year:2022,
    country:"US",
    description:"This U.S. industry comprises establishments primarily engaged in writing, modifying, testing, and supporting software to meet the needs of a particular customer. Cross-References. Establishments primarily engaged in--",
    hierarchy:[
      {
        code:"54",
        level:2,
        title:"Professional, Scientific, and Technical Services"
      },
      {
        code:"541",
        level:3,
        title:"Professional, Scientific, and Technical Services"
      },
      {
        code:"5415",
        level:4,
        title:"Computer Systems Design and Related Services"
      },
      {
        code:"54151",
        level:5,
        title:"Computer Systems Design and Related Services"
      },
      {
        code:"541511",
        level:6,
        title:"Custom Computer Programming Services"
      }
    ],
    parent:"54151",
    children:[],
    index_terms:[
      "Applications software programming services, custom computer",
      "Computer program or software development, custom",
      "Computer programming services, custom",
      "Computer software analysis and design services, custom",
      "..."
    ],
    index_term_count:18,
    cross_references:[
      {
        text:"Software design, development, and publishing, or software publishing only--are classified in Industry 513210, Software Publishers;"
      },
      {
        text:"Providing computing infrastructure, data processing services, Web hosting services (except software publishing), and related services, including streaming support services (except streaming distribution services)--are classified in Industry 518210, Computing Infrastructure Providers, Data Processing, Web Hosting, and Related Services; and"
      }
    ]
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/naics?code=541511&crosswalk_to=2017" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/naicssearch

Returns ranked candidate codes for a keyword or phrase, scored against the 20,373 official Census index terms plus titles and descriptions. Available on all plans, including Free.

Every result names the index term that matched, so you can see why it ranked. No classification rules are applied — use /v1/naicsclassify when you need one decided answer.


Parameters

  • query  required

    A keyword or phrase describing an industry or activity, for example coffee shop. Limited to 300 characters.

  • level  optional

    Restrict results to codes of this digit length, 2 to 6.

  • limit  optional

    Maximum results to return. Capped at 5 on Free and Learner, 25 on Developer and above.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields:

  • query

    The query as submitted.

  • count

    Number of results returned.

  • results

    Array of matches, ranked best first.

  • results[].code

    The matching NAICS code.

  • results[].title

    Official title for that code.

  • results[].score

    Relevance from 0 to 1, normalised so the best match is 1.

  • results[].matched_on

    Which text matched: index_term, title or description.

  • results[].matched_text

    The exact official text that matched.

Sample Request Live Demo!

query
limit

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/naicssearch?query=coffee%20shop&limit=5

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    query:"coffee shop",
    count:5,
    results:[
      {
        code:"722515",
        title:"Snack and Nonalcoholic Beverage Bars",
        score:1,
        matched_on:"index_term",
        matched_text:"Coffee shops, on premise brewing"
      },
      {
        code:"311920",
        title:"Coffee and Tea Manufacturing",
        score:0.1817,
        matched_on:"index_term",
        matched_text:"Coffee concentrates (i.e., instant coffee) manufacturing"
      },
      {
        code:"111339",
        title:"Other Noncitrus Fruit Farming",
        score:0.1717,
        matched_on:"index_term",
        matched_text:"Coffee farming"
      }
    ]
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/naicssearch?query=coffee%20shop" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/naicssizestandard

Returns the SBA small-business size standard for a NAICS code, taken from 13 CFR 121.201. Requires a Developer subscription or above.

Supply revenue or employees and the response adds an eligibility verdict with remaining headroom. This is informational and is not an SBA size determination.


Parameters

  • code  optional

    A 6-digit NAICS code. Required unless codes is supplied.

  • codes  optional

    Comma-separated codes for a batch lookup.

  • revenue  optional

    Annual receipts in USD. Used when the standard for the code is receipts-based.

  • employees  optional

    Employee count. Used when the standard for the code is employee-based.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields:

  • size_standard.basis

    Either annual_receipts or employees.

  • size_standard.threshold_usd

    The receipts ceiling in USD, or null for employee-based codes.

  • size_standard.threshold_employees

    The employee ceiling, or null for receipts-based codes.

  • eligibility.is_small

    Whether the supplied figure falls at or below the ceiling.

  • eligibility.headroom_pct

    How much room remains below the ceiling, as a percentage.

  • footnotes

    Footnote numbers from the CFR table that apply to this code.

  • authority

    Always 13 CFR 121.201.

  • effective_date

    Effective date of the size-standard table in use.

  • calculation_basis

    Business and above. The 5-year receipts and 24-month employee averaging rules.

  • affiliation_note

    Business and above. How affiliation under 13 CFR 121.103 affects the measurement.

  • exceptions

    Business and above. Footnoted sub-standards for the code, such as the three exceptions under 541330.

Sample Request Live Demo!

code
revenue

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/naicssizestandard?code=541511&revenue=18000000

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    code:"541511",
    title:"Custom Computer Programming Services",
    size_standard:{
      basis:"annual_receipts",
      threshold_usd:34000000,
      threshold_employees:null
    },
    eligibility:{
      is_small:true,
      evaluated_on:"annual_receipts",
      your_value:18000000,
      headroom_usd:16000000,
      headroom_pct:47.1
    },
    footnotes:[],
    authority:"13 CFR 121.201",
    effective_date:"2025-01-01",
    calculation_basis:"Annual receipts are the 5-year average of total income plus cost of goods sold, per 13 CFR 121.104. Employee counts a...",
    affiliation_note:"Size is measured for the concern together with all of its affiliates, per 13 CFR 121.103. Ownership, management, cont...",
    exceptions:[]
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/naicssizestandard?code=541511&revenue=18000000" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/naicsclassify

Assigns one primary NAICS code to a free-text business description by applying NAICS’s own rules: the primary-activity test, the cross-reference exclusions, and establishment scope. Requires a Business subscription or above.

The deciding rule and the official index term that matched are both returned, so the classification can be justified during an audit.


Parameters

  • description  required

    A description of the business or establishment to classify. Limited to 2,000 characters.

  • include_alternatives  optional

    Whether to return rejected candidate codes and the rule that rejected each. Defaults to true.

  • min_confidence  optional

    Suppress the result when confidence falls below this value, from 0 to 1.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields:

  • primary.code

    The single assigned NAICS code.

  • primary.title

    Official title for that code.

  • primary.confidence

    Confidence in the assignment, from 0 to 1.

  • primary.decided_by

    Which rule settled it, such as primary_activity_test.

  • secondary_codes

    Other activities the description covers. ancillary: true marks an activity that supports the primary one rather than standing alone.

  • adjudication.reasoning

    A short statement of the deciding activity.

  • adjudication.rules_applied

    Each NAICS rule evaluated, with the source_text relied on and an outcome of excluded or not_excluded.

  • adjudication.evidence

    The official Census index term that matched, with its score.

  • establishment_note

    Present when the description implies more than one establishment.

  • alternatives

    Candidate codes that were considered and rejected, each with rejected_by.

Sample Request Live Demo!

description

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/naicsclassify?description=We%20manufacture%20kitchen%20cabinets%20and%20also%20install%20them%20in%20customers'%20homes.

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    input:"We manufacture kitchen cabinets and also install them in customers' homes.",
    primary:{
      code:"337110",
      title:"Wood Kitchen Cabinet and Countertop Manufacturing",
      confidence:0.88,
      decided_by:"primary_activity_test"
    },
    secondary_codes:[
      {
        code:"238350",
        title:"Finish Carpentry Contractors",
        activity:"installation",
        ancillary:true
      }
    ],
    adjudication:{
      candidates_considered:30,
      reasoning:"Manufacturing is the principal activity; installing self-manufactured cabinets is ancillary to it.",
      rules_applied:[
        {
          rule:"cross_reference_exclusion",
          code:"238350",
          source_text:"Installing cabinets manufactured by others--are classified in Industry 238350, Finish Carpentry Contractors",
          outcome:"not_excluded",
          detail:"Inapplicable: this establishment installs cabinets it manufactures itself."
        }
      ],
      evidence:[
        {
          type:"index_term",
          text:"Cabinets, kitchen (except freestanding), stock or custom, manufacturing",
          score:1
        }
      ]
    },
    establishment_note:"Description implies a single establishment. NAICS assigns one primary code per establishment.",
    method:"bm25_shortlist+gpt-5-nano_adjudication_v1"
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/naicsclassify?description=We%20manufacture%20kitchen%20cabinets%20and%20also%20install%20them" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/naicsrisk

Returns an industry-level KYB and underwriting risk profile for a NAICS code. Requires a Business subscription or above.

This describes an industry, never a specific business. It is API Ninjas analysis derived from public FinCEN and FFIEC guidance and published card-network restricted-business lists, and it is not a compliance determination or a consumer report.


Parameters

  • code  optional

    A NAICS 2022 code. Required unless codes is supplied.

  • codes  optional

    Comma-separated codes for a batch lookup.

  • framework  optional

    Which lens to apply: kyb (default), card or lending.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields:

  • risk_level

    low, moderate or high.

  • flags

    Every risk flag is returned, including the ones that are false, so you can see what was checked rather than only what fired. Includes money_services_business, cash_intensive, cannabis_related, firearms, gambling, crypto_related and others.

  • rationale

    Why the flags were set, citing the guidance relied on.

  • review_recommendation

    standard, standard_plus_documentation, enhanced_due_diligence or decline_typical.

  • typical_mcc

    Merchant category codes commonly used for this industry.

  • commonly_prohibited_by

    The kinds of counterparty that typically refuse this industry outright.

Sample Request Live Demo!

code
framework

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/naicsrisk?code=522320&framework=kyb

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    code:"522320",
    title:"Financial Transactions Processing, Reserve, and Clearinghouse Activities",
    risk_level:"high",
    flags:{
      money_services_business:true,
      cash_intensive:false,
      regulated_entity:true,
      cannabis_related:false,
      firearms:false,
      adult:false,
      gambling:false,
      crypto_related:true,
      export_controlled:false,
      high_chargeback:false,
      age_restricted:false,
      pharmaceutical:false
    },
    rationale:[
      "FinCEN MSB registration may apply. Financial transaction processing and clearinghouse activity is identified as higher-risk in the FFIEC BSA/AML manua...",
      "Credit intermediation is a regulated financial activity."
    ],
    review_recommendation:"enhanced_due_diligence",
    framework:"kyb",
    typical_mcc:[
      "6051"
    ],
    commonly_prohibited_by:[
      "payment_facilitators",
      "sponsor_banks"
    ]
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/naicsrisk?code=522320" \ -H "X-Api-Key: YOUR_API_KEY"

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the NAICS Code API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • The classification itself is published by the U.S. Census Bureau under the Office of Management and Budget. It is a work of the U.S. Government and therefore in the public domain under 17 U.S.C. 105, so the codes, titles, descriptions, index terms and cross-references carry no licence restrictions. API Ninjas is not affiliated with or endorsed by the Census Bureau or the SBA. Every response includes a source and disclaimer block.
  • /v1/naicssearch is retrieval: give it a keyword like coffee shop and it returns every code that plausibly covers that activity, ranked, with the official Census index term that matched. It applies no judgement. /v1/naicsclassify is adjudication: give it a full business description and it returns one primary code chosen by NAICS's own rules, with the deciding rule recorded. Use search behind a picker, and classify when you need a single code to store.
  • NAICS assigns exactly one primary code per establishment, determined by the principal activity measured by revenue. Additional activities are returned in secondary_codes, with ancillary: true marking those that support the primary activity rather than standing alone — installing cabinets you manufactured yourself, for example. The adjudication.rules_applied array records which rule decided it, so the answer can be justified later.
  • Call /v1/naicssizestandard with a code plus revenue or employees. The response gives the threshold from 13 CFR 121.201, whether the standard is receipts-based or employee-based, and an is_small verdict with headroom. Business and above also returns the averaging rules, the affiliation note, and the footnoted exceptions. This is informational and is not an SBA size determination.
  • Yes. Pass crosswalk_to=2017 to /v1/naics and the response adds a crosswalk block with a change_type of unchanged, renumbered, split, merged or new, plus the predecessor codes. The Census concordance covers 6-digit national industries only. NAICS 2027 is not published by the Census Bureau until January 2027 and will be added when it lands.
  • /v1/naics and /v1/naicssearch are available on every plan, including Free. /v1/naicssizestandard requires Developer or above. /v1/naicsclassify and /v1/naicsrisk require Business or above. Batch lookups with the codes parameter allow 50 codes on Developer and 500 on Business and above. See the pricing page.
  • /v1/naicsrisk returns an industry-level KYB and underwriting profile: flags such as money_services_business, cash_intensive, cannabis_related, gambling and crypto_related, a risk_level, typical merchant category codes, and a review recommendation. It is API Ninjas editorial analysis derived from public FinCEN and FFIEC guidance and published card-network restricted-business lists. It describes an industry, never a specific business, and it is not a compliance determination or a consumer report.