Match a raw WFP body (snippets)
curl --request POST \
--url https://api.scanoss.com/v3/snippets/scan \
--header 'Content-Type: text/plain' \
--data 'file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c
12=a1b2c3,d4e5f6
'import requests
url = "https://api.scanoss.com/v3/snippets/scan"
payload = "file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n"
headers = {"Content-Type": "text/plain"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: 'file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n'
};
fetch('https://api.scanoss.com/v3/snippets/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scanoss.com/v3/snippets/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n",
CURLOPT_HTTPHEADER => [
"Content-Type: text/plain"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scanoss.com/v3/snippets/scan"
payload := strings.NewReader("file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scanoss.com/v3/snippets/scan")
.header("Content-Type", "text/plain")
.body("file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scanoss.com/v3/snippets/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'text/plain'
request.body = "file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n"
response = http.request(request)
puts response.read_body{
"file_hash": "<string>",
"file_path": "<string>",
"file_size": 123,
"total_lines": 123,
"tolerance_pct": 123,
"snippet_groups": [
{
"group_index": 123,
"candidates": [
{
"file_hash": "<string>",
"hits": 123,
"lines_matched": 123,
"matched_percent": 123,
"input_line_ranges": "<string>",
"oss_line_ranges": "<string>"
}
]
}
]
}{
"status": "error",
"error": {
"code": "INVALID_QUERY",
"message": "purl query parameter is required"
},
"timestamp": "2026-05-19T11:39:56Z"
}{
"status": "error",
"error": {
"code": "INTERNAL_ERROR",
"message": "..."
},
"timestamp": "2026-05-19T11:39:56Z"
}{
"status": "error",
"error": {
"code": "ENGINE_UNAVAILABLE",
"message": "scan engine not available"
},
"timestamp": "2026-05-19T11:39:56Z"
}{
"status": "error",
"error": {
"code": "TIMEOUT",
"message": "request timed out"
},
"timestamp": "2026-05-19T11:39:56Z"
}scan
Match a raw WFP body (snippets)
Match a raw WFP body (text/plain) against the KB (-S). The body must
contain at least one snippet-hash line (N=<hashes>); a WFP with only a
file hash yields 500. Optional threshold sets the minimum match
percentage (-T). Also served at the legacy /v3/scan/snippets alias
(used by the batchScanner pipeline) — deprecated, provisional for
compatibility and to be removed in a future version; new clients should
use /v3/snippets/scan.
POST
/
v3
/
snippets
/
scan
Match a raw WFP body (snippets)
curl --request POST \
--url https://api.scanoss.com/v3/snippets/scan \
--header 'Content-Type: text/plain' \
--data 'file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c
12=a1b2c3,d4e5f6
'import requests
url = "https://api.scanoss.com/v3/snippets/scan"
payload = "file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n"
headers = {"Content-Type": "text/plain"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: 'file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n'
};
fetch('https://api.scanoss.com/v3/snippets/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scanoss.com/v3/snippets/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n",
CURLOPT_HTTPHEADER => [
"Content-Type: text/plain"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scanoss.com/v3/snippets/scan"
payload := strings.NewReader("file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scanoss.com/v3/snippets/scan")
.header("Content-Type", "text/plain")
.body("file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scanoss.com/v3/snippets/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'text/plain'
request.body = "file=93d99b95d57fca563c23a2bc4954aeed,12044,src/scanner.c\n12=a1b2c3,d4e5f6\n"
response = http.request(request)
puts response.read_body{
"file_hash": "<string>",
"file_path": "<string>",
"file_size": 123,
"total_lines": 123,
"tolerance_pct": 123,
"snippet_groups": [
{
"group_index": 123,
"candidates": [
{
"file_hash": "<string>",
"hits": 123,
"lines_matched": 123,
"matched_percent": 123,
"input_line_ranges": "<string>",
"oss_line_ranges": "<string>"
}
]
}
]
}{
"status": "error",
"error": {
"code": "INVALID_QUERY",
"message": "purl query parameter is required"
},
"timestamp": "2026-05-19T11:39:56Z"
}{
"status": "error",
"error": {
"code": "INTERNAL_ERROR",
"message": "..."
},
"timestamp": "2026-05-19T11:39:56Z"
}{
"status": "error",
"error": {
"code": "ENGINE_UNAVAILABLE",
"message": "scan engine not available"
},
"timestamp": "2026-05-19T11:39:56Z"
}{
"status": "error",
"error": {
"code": "TIMEOUT",
"message": "request timed out"
},
"timestamp": "2026-05-19T11:39:56Z"
}Query Parameters
Minimum match threshold (percent).
Required range:
0 <= x <= 100Engine flags bitmask (-F). Gate: allow_flags_override. (Snippet/ranking tuning applies to /v3/raw/scan only.)
Required range:
x >= 0Body
text/plain
The body is of type string.