@@ -394,7 +394,36 @@ paths:
394394 application/json :
395395 schema :
396396 $ref : " #/components/schemas/LicenseWithRules"
397-
397+ /v1/licenses:match :
398+ post :
399+ description : Get the list of matching licenses based on the provided license URL
400+ tags :
401+ - " licenses"
402+ operationId : getMatchingLicenses
403+ security :
404+ - ApiKeyAuth : []
405+ requestBody :
406+ description : Payload containing the license URL to match against the database.
407+ required : true
408+ content :
409+ application/json :
410+ schema :
411+ type : object
412+ required :
413+ - license_url
414+ properties :
415+ license_url :
416+ description : The license URL to resolve and match against the database.
417+ type : string
418+ format : url
419+ example : https://creativecommons.org/licenses/by/4.0/deed.nl
420+ responses :
421+ " 200 " :
422+ description : The list of matching licenses if any.
423+ content :
424+ application/json :
425+ schema :
426+ $ref : " #/components/schemas/MatchingLicenses"
398427components :
399428 schemas :
400429 Redirect :
@@ -1331,6 +1360,87 @@ components:
13311360 items :
13321361 $ref : " #/components/schemas/LicenseBase"
13331362
1363+ MatchingLicense :
1364+ type : object
1365+ description : Matching a license
1366+ properties :
1367+ license_id :
1368+ description : Unique identifier for the license (typically SPDX ID)
1369+ type : string
1370+ example : CC-BY-4.0
1371+ license_url :
1372+ description : Original license URL provided for resolution
1373+ type : string
1374+ example : https://creativecommons.org/licenses/by/4.0/
1375+ normalized_url :
1376+ description : URL after normalization (lowercased, trimmed, protocol removed)
1377+ type : string
1378+ example : creativecommons.org/licenses/by/4.0
1379+ match_type :
1380+ description : >
1381+ Type of match performed. One of:
1382+ - 'exact': Direct match found in database
1383+ - 'heuristic': Matched via pattern-based rules (CC resolver, common patterns)
1384+ - 'fuzzy': Similarity-based match against same-host licenses
1385+ type : string
1386+ example : heuristic
1387+ confidence :
1388+ description : >
1389+ Match confidence score (0.0-1.0), examples:
1390+ - 1.0: Exact match
1391+ - 0.99: Creative Commons resolved
1392+ - 0.95: Pattern heuristic match
1393+ - 0.0-1.0: Fuzzy match score based on string similarity
1394+ type : number
1395+ example : 0.99
1396+ spdx_id :
1397+ description : SPDX License Identifier if matched (e.g., 'CC-BY-4.0', 'MIT')
1398+ type : string
1399+ example : CC-BY-4.0
1400+ matched_name :
1401+ description : Human-readable name of the matched license
1402+ type : string
1403+ example : Creative Commons Attribution 4.0 International
1404+ matched_catalog_url :
1405+ description : Canonical URL from the license catalog/database
1406+ type : string
1407+ example : https://creativecommons.org/licenses/by/4.0/legalcode
1408+ matched_source :
1409+ description : >
1410+ Source of the match. Examples:
1411+ - 'db.license': Exact match from database
1412+ - 'cc-resolver': Creative Commons license resolver
1413+ - 'pattern-heuristics': Generic pattern matching
1414+ type : string
1415+ example : cc-resolver
1416+ notes :
1417+ description : Additional context about the match (e.g., version normalization, locale detection)
1418+ type : string
1419+ example : Detected locale/jurisdiction port 'nl'. SPDX does not list ported CC licenses; using canonical ID.
1420+ regional_id :
1421+ description : >
1422+ Regional/jurisdictional variant identifier for ported licenses
1423+ (e.g., 'CC-BY-2.1-jp' for Japan-ported Creative Commons)
1424+ type : string
1425+ example : CC-BY-4.0-nl
1426+ example :
1427+ license_id : CC-BY-4.0
1428+ license_url : https://creativecommons.org/licenses/by/4.0/deed.nl
1429+ normalized_url : creativecommons.org/licenses/by/4.0
1430+ match_type : heuristic
1431+ confidence : 0.99
1432+ spdx_id : CC-BY-4.0
1433+ matched_name : Creative Commons Attribution 4.0 International
1434+ matched_catalog_url : https://creativecommons.org/licenses/by/4.0/legalcode
1435+ matched_source : cc-resolver
1436+ notes : Detected locale/jurisdiction port 'nl'. SPDX does not list ported CC licenses; using canonical ID.
1437+ regional_id : CC-BY-4.0-nl
1438+
1439+ MatchingLicenses :
1440+ description : List of MatchingLicense
1441+ type : array
1442+ items :
1443+ $ref : " #/components/schemas/MatchingLicense"
13341444
13351445 parameters :
13361446 status :
0 commit comments