SPDX license identification from LICENSE text

$0.005 USDC per call · Developer and security · POST /api/v1/license-identify · Id license-identify

Normalizes a LICENSE file (SPDX varietal substitutions: whitespace, case, quotes, bullets, copyright lines) and matches it against distinctive phrases of 32 common SPDX licenses (MIT, MIT-0, Apache-2.0, BSD-2/3/4-Clause, 0BSD, GPL-2/3 +/- or-later, LGPL-2.1/3.0 +/- or-later, AGPL-3.0 +/- or-later, MPL-2.0, ISC, Unlicense, CC0-1.0, Zlib, Artistic-2.0, EPL-2.0, BSL-1.0, WTFPL, Python-2.0, PostgreSQL, OFL-1.1, CDDL-1.0, EUPL-1.2, AFL-3.0, NCSA). Returns the best SPDX id with a high/medium/low confidence verdict, the top candidates and whether the license is OSI-approved and FSF-libre. 'High' requires all anchor phrases present and a clear lead over the runner-up — missing anchors or a tie returns fail with the ranked list so callers choose.

What you get

The classifier ships in every supply-chain tool as 2MB of regexes. This is the 20-license subset that covers most real-world LICENSE files, with the same matching rules the SPDX project publishes.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/license-identify. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/license-identify \
  -H 'content-type: application/json' \
  -d '{"text":"MIT License\n\nCopyright (c) 2024 Example\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software..."}'

Input

FieldTypeRequiredDescription
textstring; length 0..200000yesThe full LICENSE file content.
restrictarray<string; length 0..40>; max 40 itemsnoOnly consider these SPDX ids.

Example request body

{
  "text": "MIT License\n\nCopyright (c) 2024 Example\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software..."
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
identifiedbooleanno
bestIdstringno
confidencestring; one of "high", "medium", "low"no
candidatesarray<object>no
normalizedBytesintegerno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the code-preflight-kit package.

Machine-readable