SBOM Generator & Validator (CycloneDX / SPDX) API

Generate a CycloneDX 1.6 or SPDX 2.3 SBOM from package-lock, yarn, pnpm, poetry, composer, go.sum or Cargo.lock; validate, convert, diff and merge SBOMs.

POSThttps://apibox.io.vn/v1/sbom-tools
Security & Crypto▶ Try it online

A Software Bill of Materials lists every component inside your software. The EU Cyber Resilience Act makes SBOMs mandatory for products sold in the EU (vulnerability reporting from 11 September 2026, full obligations from 11 December 2027), and US federal buyers already ask for them. action=generate builds one from a lockfile: package-lock.json / npm-shrinkwrap.json, yarn.lock (v1 and Berry), pnpm-lock.yaml, requirements.txt (pinned == lines), poetry.lock, Pipfile.lock, composer.lock, go.sum / go.mod, Cargo.lock and Gemfile.lock. Each component gets a package URL (purl), the lockfile hash (npm SHA-512 integrity, Cargo SHA-256 checksum, Composer SHA-1), the licence when the lockfile has it (normalised to an SPDX expression) and the dependency graph when the lockfile records it.

Output is CycloneDX 1.6 JSON (default) or SPDX 2.3 JSON (output=spdx); download=1 returns the file itself. action=validate checks a CycloneDX (1.2–1.7) or SPDX 2.x JSON document: required fields, enumerations, unique bom-refs / SPDXIDs, references that resolve, hash length, purl syntax, SPDX licence expressions, plus the NTIA minimum elements (supplier, name, version, unique identifier, dependencies, author, timestamp) with coverage percentages. action=convert turns CycloneDX into SPDX and back, action=diff compares two SBOMs (added, removed, upgraded, downgraded, licence changes) and action=merge combines up to 20.

vulns=1 looks every component up on OSV.dev and adds the advisories (CycloneDX vulnerabilities, SPDX security references). The code is APIBox's own (no CycloneDX library); validation follows the specifications' rules but is not a full JSON Schema run. An SBOM built from a lockfile cannot see vendored code, native libraries or OS packages.

Markdown · OpenAPI · Postman · llms.txt

Parameters

NameInTypeRequiredDefault
actionbodystringnogenerategenerate, validate, convert, diff or merge (alias op).
lockfilebodystringnogenerate: lockfile text (or upload it as file, or send it as the raw body).
filebodyfilenoLockfile or SBOM file upload (multipart).
filenamebodystringnoLockfile name when the format cannot be detected (e.g. poetry.lock).
outputbodystringnocyclonedxcyclonedx (1.6 JSON) or spdx (2.3 JSON).
namebodystringnoName of your application (root component, alias app_name); version, supplier, author, license too.
include_devbodybooleannotruefalse leaves out dev dependencies.
vulnsbodybooleanno1: add known vulnerabilities from OSV.dev.
sbombodyobjectnovalidate / convert: the SBOM (JSON object or text).
sbom_abodyobjectnodiff: the old SBOM; sbom_b the new one. merge: sboms array.
downloadbodybooleanno1: return the SBOM file instead of JSON with a summary.

Example

curl -X POST "https://apibox.io.vn/v1/sbom-tools" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action":"generate","lockfile":"# yarn lockfile v1\n\n\"@babel/code-frame@^7.0.0\":\n  version \"7.12.13\"\n  resolved \"https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz\"\n  integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==\n  dependencies:\n    \"@babel/highlight\" \"^7.12.13\"\n\n\"@babel/highlight@^7.12.13\":\n  version \"7.13.10\"\n  integrity sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==\n  dependencies:\n    js-tokens \"^4.0.0\"\n\njs-tokens@^4.0.0:\n  version \"4.0.0\"\n  integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==\n","name":"my-app","version":"1.0.0"}'

Response

{
  "action": "generate",
  "input_format": "yarn.lock",
  "output": "CycloneDX 1.6 JSON",
  "summary": {
    "components": 3,
    "direct": 1,
    "with_hashes": 3,
    "with_licence": 0,
    "by_type": {
      "npm": 3
    },
    "licences": {
      "unknown": 3
    }
  },
  "note": "Built from the lockfile only: vendored code, native libraries and system packages are not visible. Licences come from the lockfile when it has them (package-lock, composer.lock).",
  "sbom": {
    "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
    "bomFormat": "CycloneDX",
    "specVersion": "1.6",
    "serialNumber": "urn:uuid:da83b698-18a4-4fb0-adb4-731efa0d9901",
    "version": 1,
    "metadata": {
      "timestamp": "2026-11-15T16:20:25Z",
      "lifecycles": [
        {
          "phase": "build"
        }
      ],
      "tools": {
        "components": [
          {
            "type": "application",
            "name": "APIBox sbom-tools",
            "version": "1.0",
            "externalReferences": [
              {
                "type": "website",
                "url": "https://apibox.io.vn/docs/sbom-tools/"
              }
            ]
          }
        ]
      },
      "component": {
        "type": "application",
        "bom-ref": "root-component",
        "name": "my-app",
        "version": "1.0.0"
      }
    },
    "components": [
      {
        "type": "library",
        "bom-ref": "pkg:npm/%40babel/code-frame@7.12.13",
        "group": "@babel",
        "name": "code-frame",
        "version": "7.12.13",
        "hashes": [
          {
            "alg": "SHA-512",
            "content": "1d5d429b443766ba4247dded9163988ae60880bc595d91551b65602be3015a352a653ba776ea5b7f1d9a5daad7bb0e4aa3968c723b4981b4ace2f506052e6fea"
          }
        ],
        "purl": "pkg:npm/%40babel/code-frame@7.12.13",
        "externalReferences": [
          {
            "type": "distribution",
            "url": "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz"
          }
        ]
      },
      "…"
    ],
    "dependencies": [
      {
        "ref": "root-component",
        "dependsOn": [
          "pkg:npm/%40babel/code-frame@7.12.13"
        ]
      },
      {
        "ref": "pkg:npm/%40babel/code-frame@7.12.13",
        "dependsOn": [
          "pkg:npm/%40babel/highlight@7.13.10"
        ]
      },
      {
        "ref": "pkg:npm/%40babel/highlight@7.13.10",
        "dependsOn": [
          "pkg:npm/js-tokens@4.0.0"
        ]
      },
      {
        "ref": "pkg:npm/js-tokens@4.0.0",
        "dependsOn": []
      }
    ]
  }
}

Use cases

  • Ship the SBOM that EU customers ask for under the Cyber Resilience Act
  • Add an SBOM step to CI from the lockfile, without installing extra tooling
  • Check a supplier's SBOM for missing fields before accepting a delivery
  • Compare the SBOMs of two releases to see what changed

FAQ

CycloneDX or SPDX?

Both are accepted by most tools and regulators. CycloneDX is common in security tooling (OWASP); SPDX is an ISO standard (ISO/IEC 5962) often used for licence compliance. You can convert between them here.

Why are licences missing for npm packages?

npm lockfiles usually do not store licences. Composer locks do. Run the spdx-license or dep-audit endpoints with latest=1 to look licences up from the registries.

Is my lockfile stored?

No. It is parsed in memory and the SBOM is returned in the response; nothing is logged.

Related APIs

Start with 1,000 free requests every month. Get free API key →