@@ -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,88 @@ 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+ - 'none': No match found
1386+ type : string
1387+ example : heuristic
1388+ confidence :
1389+ description : >
1390+ Match confidence score (0.0-1.0), examples:
1391+ - 1.0: Exact match
1392+ - 0.99: Creative Commons resolved
1393+ - 0.95: Pattern heuristic match
1394+ - 0.0-1.0: Fuzzy match score based on string similarity
1395+ type : number
1396+ example : 0.99
1397+ spdx_id :
1398+ description : SPDX License Identifier if matched (e.g., 'CC-BY-4.0', 'MIT')
1399+ type : string
1400+ example : CC-BY-4.0
1401+ matched_name :
1402+ description : Human-readable name of the matched license
1403+ type : string
1404+ example : Creative Commons Attribution 4.0 International
1405+ matched_catalog_url :
1406+ description : Canonical URL from the license catalog/database
1407+ type : string
1408+ example : https://creativecommons.org/licenses/by/4.0/legalcode
1409+ matched_source :
1410+ description : >
1411+ Source of the match. Examples:
1412+ - 'db.license': Exact match from database
1413+ - 'cc-resolver': Creative Commons license resolver
1414+ - 'pattern-heuristics': Generic pattern matching
1415+ type : string
1416+ example : cc-resolver
1417+ notes :
1418+ description : Additional context about the match (e.g., version normalization, locale detection)
1419+ type : string
1420+ example : Detected locale/jurisdiction port 'nl'. SPDX does not list ported CC licenses; using canonical ID.
1421+ regional_id :
1422+ description : >
1423+ Regional/jurisdictional variant identifier for ported licenses
1424+ (e.g., 'CC-BY-2.1-jp' for Japan-ported Creative Commons)
1425+ type : string
1426+ example : CC-BY-4.0-nl
1427+ example :
1428+ license_id : CC-BY-4.0
1429+ license_url : https://creativecommons.org/licenses/by/4.0/deed.nl
1430+ normalized_url : creativecommons.org/licenses/by/4.0
1431+ match_type : heuristic
1432+ confidence : 0.99
1433+ spdx_id : CC-BY-4.0
1434+ matched_name : Creative Commons Attribution 4.0 International
1435+ matched_catalog_url : https://creativecommons.org/licenses/by/4.0/legalcode
1436+ matched_source : cc-resolver
1437+ notes : Detected locale/jurisdiction port 'nl'. SPDX does not list ported CC licenses; using canonical ID.
1438+ regional_id : CC-BY-4.0-nl
1439+
1440+ MatchingLicenses :
1441+ description : List of MatchingLicense
1442+ type : array
1443+ items :
1444+ $ref : " #/components/schemas/MatchingLicense"
13341445
13351446 parameters :
13361447 status :
0 commit comments