Skip to main content
GET
/
v2
/
template
/
search
Search Templates
curl --request GET \
  --url https://api.projectdiscovery.io/v2/template/search \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://api.projectdiscovery.io/v2/template/search"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://api.projectdiscovery.io/v2/template/search', 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.projectdiscovery.io/v2/template/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.projectdiscovery.io/v2/template/search"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.projectdiscovery.io/v2/template/search")
.header("X-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.projectdiscovery.io/v2/template/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "results": [
    {
      "uri": "<string>",
      "id": "<string>",
      "name": "<string>",
      "author": [
        "<string>"
      ],
      "tags": [
        "<string>"
      ],
      "severity": "<string>",
      "type": "<string>",
      "dir": "<string>",
      "ref": "<string>",
      "vendor": "<string>",
      "product": "<string>",
      "classification": {
        "cve-id": [
          "<string>"
        ],
        "cwe-id": [
          "<string>"
        ],
        "cvss-metrics": "<string>",
        "cvss-score": 123,
        "epss-score": 123,
        "epss-percentile": 123,
        "cpe": "<string>"
      },
      "metadata": {},
      "digest": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "release_tag": "<string>",
      "is_early": true,
      "raw": "<string>",
      "template_id": "<string>",
      "description": "<string>",
      "filename": "<string>",
      "impact": "<string>",
      "ai_meta": {
        "model_used": "<string>",
        "is_prompt_by_human": true,
        "is_template_by_human": true,
        "prompt": "<string>"
      },
      "references": [
        "<string>"
      ],
      "is_draft": true,
      "is_github": true,
      "is_new": true,
      "is_pdteam": true,
      "remediation": "<string>"
    }
  ],
  "total": 123,
  "count": 123,
  "facets": {
    "is_new": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "creation_stats": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "author": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "is_early": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "dir": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "product": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "severity": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "tags": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "type": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    },
    "vendor": {
      "buckets": {},
      "missing": 123,
      "other": 123,
      "total": 123
    }
  },
  "message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}

Authorizations

X-API-Key
string
header
required

Headers

X-Team-Id
string

Query Parameters

scope
enum<string>
default:public_private

Scope of templates to search (public or private)

Available options:
public,
private,
public_private
limit
integer
default:50

Maximum number of results to return

offset
integer
default:0

Number of results to skip for pagination

fields
string

Specific fields to return in the response

sort_asc
string

Field to sort results in ascending order

sort_desc
string

Field to sort results in descending order

q
string

Search query string

highlight
boolean
default:false

Whether to highlight search matches in results

facet_size
integer
default:5

Number of facets to return in the response

Response

Successful search response

results
object[]
required
total
integer
required

Total number of matching results

count
integer
required

Number of results in this response

facets
object
required
message
string