SPDX license identification from LICENSE text
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
| Field | Type | Required | Description |
|---|---|---|---|
text | string; length 0..200000 | yes | The full LICENSE file content. |
restrict | array<string; length 0..40>; max 40 items | no | Only 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.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: 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. |
identified | boolean | no | |
bestId | string | no | |
confidence | string; one of "high", "medium", "low" | no | |
candidates | array<object> | no | |
normalizedBytes | integer | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always 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
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent