{
  "openapi": "3.0.3",
  "info": {
    "title": "EntityCodes.org Static Registry API",
    "version": "1.0.0",
    "description": "Unauthenticated, read-only STATIC dataset API providing flat JSON/JSON-LD files over CDN for 1,012 U.S. NAICS 2022 codes, 1,004 SIC 1987 codes, concordance graph exports, and dataset indices. Pure static serving from global edge locations \u2014 no authentication headers, no rate limits, no server-side execution, and no POST/PUT write endpoints.",
    "license": {
      "name": "US Government Work",
      "url": "https://www.usa.gov/government-works"
    }
  },
  "servers": [
    {
      "url": "https://entitycodes.org"
    }
  ],
  "paths": {
    "/naics/{code}.json": {
      "get": {
        "summary": "Get NAICS 2022 DefinedTerm Entity",
        "description": "Returns a flat JSON-LD DefinedTerm record for a 6-digit NAICS 2022 industry code, including Census definition, SBA size standards, IRS PBA mappings, establishment counts, and transitive SIC crosswalks.",
        "operationId": "getNAICSEntity",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "6-digit NAICS 2022 industry classification code (e.g., 541511).",
            "schema": {
              "type": "string",
              "pattern": "^\\d{6}$",
              "example": "541511"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "NAICS 2022 DefinedTerm JSON-LD entity record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NAICSDefinedTerm"
                }
              }
            }
          },
          "404": {
            "description": "NAICS code not found in registry"
          }
        }
      }
    },
    "/sic/{code}.json": {
      "get": {
        "summary": "Get SIC 1987 DefinedTerm Entity",
        "description": "Returns a flat JSON-LD DefinedTerm record for a 4-digit SIC 1987 industry code, including OSHA description, division, major group, and transitive NAICS 2022 crosswalks.",
        "operationId": "getSICEntity",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "4-digit SIC 1987 industry classification code (e.g., 7371).",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$",
              "example": "7371"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SIC 1987 DefinedTerm JSON-LD entity record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SICDefinedTerm"
                }
              }
            }
          },
          "404": {
            "description": "SIC code not found in registry"
          }
        }
      }
    },
    "/api/manifest.json": {
      "get": {
        "summary": "Get Static API Manifest",
        "description": "Returns registry metadata, dataset dictionary, industry counts, endpoint list, and OpenAPI 3.0 specification URL.",
        "operationId": "getAPIManifest",
        "responses": {
          "200": {
            "description": "Static API Manifest JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIManifest"
                }
              }
            }
          }
        }
      }
    },
    "/api/graph.json": {
      "get": {
        "summary": "Get Concordance Graph Export",
        "description": "Returns the complete NAICS 2022 \u2194 SIC 1987 concordance graph containing nodes (industries and groups) and typed edges (parentOf and crosswalk).",
        "operationId": "getConcordanceGraph",
        "responses": {
          "200": {
            "description": "Concordance Graph JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConcordanceGraph"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "NAICSDefinedTerm": {
        "type": "object",
        "required": [
          "@context",
          "@type",
          "@id",
          "identifier",
          "name",
          "description",
          "url",
          "inDefinedTermSet",
          "sameAs",
          "additionalProperty",
          "ec:crosswalk",
          "ec:provenance",
          "license",
          "dateModified"
        ],
        "properties": {
          "@context": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object"
                    }
                  ]
                }
              }
            ]
          },
          "@type": {
            "type": "string",
            "enum": [
              "DefinedTerm"
            ]
          },
          "@id": {
            "type": "string",
            "format": "uri"
          },
          "identifier": {
            "type": "string",
            "example": "541511"
          },
          "name": {
            "type": "string",
            "example": "Custom Computer Programming Services"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "inDefinedTermSet": {
            "$ref": "#/components/schemas/DefinedTermSet"
          },
          "isPartOf": {
            "$ref": "#/components/schemas/DefinedTermPart"
          },
          "sameAs": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "additionalProperty": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyValue"
            }
          },
          "ec:crosswalk": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrosswalkItem"
            }
          },
          "ec:provenance": {
            "type": "object"
          },
          "license": {
            "type": "string",
            "format": "uri"
          },
          "dateModified": {
            "type": "string",
            "example": "2026-07-21"
          }
        }
      },
      "SICDefinedTerm": {
        "type": "object",
        "required": [
          "@context",
          "@type",
          "@id",
          "identifier",
          "name",
          "description",
          "url",
          "inDefinedTermSet",
          "sameAs",
          "additionalProperty",
          "ec:crosswalk",
          "ec:provenance",
          "license",
          "dateModified"
        ],
        "properties": {
          "@context": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object"
                    }
                  ]
                }
              }
            ]
          },
          "@type": {
            "type": "string",
            "enum": [
              "DefinedTerm"
            ]
          },
          "@id": {
            "type": "string",
            "format": "uri"
          },
          "identifier": {
            "type": "string",
            "example": "7371"
          },
          "name": {
            "type": "string",
            "example": "Computer Programming Services"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "inDefinedTermSet": {
            "$ref": "#/components/schemas/DefinedTermSet"
          },
          "isPartOf": {
            "$ref": "#/components/schemas/DefinedTermPart"
          },
          "sameAs": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "additionalProperty": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyValue"
            }
          },
          "ec:crosswalk": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrosswalkItem"
            }
          },
          "ec:provenance": {
            "type": "object"
          },
          "license": {
            "type": "string",
            "format": "uri"
          },
          "dateModified": {
            "type": "string",
            "example": "2026-07-21"
          }
        }
      },
      "DefinedTermSet": {
        "type": "object",
        "required": [
          "@type",
          "name",
          "url"
        ],
        "properties": {
          "@type": {
            "type": "string",
            "enum": [
              "DefinedTermSet"
            ]
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "sameAs": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "DefinedTermPart": {
        "type": "object",
        "required": [
          "@type",
          "identifier",
          "name",
          "@id"
        ],
        "properties": {
          "@type": {
            "type": "string",
            "enum": [
              "DefinedTerm"
            ]
          },
          "identifier": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "@id": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "PropertyValue": {
        "type": "object",
        "required": [
          "@type",
          "name",
          "value"
        ],
        "properties": {
          "@type": {
            "type": "string",
            "enum": [
              "PropertyValue"
            ]
          },
          "name": {
            "type": "string"
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "integer"
              }
            ]
          },
          "unitText": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "CrosswalkItem": {
        "type": "object",
        "required": [
          "system",
          "code",
          "title",
          "url"
        ],
        "properties": {
          "system": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "confidence": {
            "type": "string"
          },
          "via": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "APIManifest": {
        "type": "object",
        "required": [
          "name",
          "description",
          "version",
          "buildDate",
          "license",
          "openapi",
          "counts",
          "endpoints",
          "datasets"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "buildDate": {
            "type": "string"
          },
          "license": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "counts": {
            "type": "object",
            "properties": {
              "naics_industries": {
                "type": "integer"
              },
              "sic_industries": {
                "type": "integer"
              },
              "crosswalk_edges": {
                "type": "integer"
              }
            }
          },
          "endpoints": {
            "type": "object"
          },
          "datasets": {
            "type": "object"
          }
        }
      },
      "ConcordanceGraph": {
        "type": "object",
        "required": [
          "buildDate",
          "nodesCount",
          "edgesCount",
          "nodes",
          "edges"
        ],
        "properties": {
          "buildDate": {
            "type": "string"
          },
          "nodesCount": {
            "type": "integer"
          },
          "edgesCount": {
            "type": "integer"
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "system": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              }
            }
          },
          "edges": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string"
                },
                "target": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "confidence": {
                  "type": "string"
                },
                "via": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}