Mintlify Index
Search technical knowledge
Search Mintlify Index for ranked technical documentation and web results.
POST
/
v1
/
search
Search technical knowledge
curl --request POST \
--url https://leaves.mintlify.com/api/universal-search/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Next.js 16 caching and revalidation",
"numResults": 5,
"text": {
"maxCharacters": 4000
},
"includeDomains": [
"nextjs.org"
]
}
'import requests
url = "https://leaves.mintlify.com/api/universal-search/v1/search"
payload = {
"query": "Next.js 16 caching and revalidation",
"numResults": 5,
"text": { "maxCharacters": 4000 },
"includeDomains": ["nextjs.org"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'Next.js 16 caching and revalidation',
numResults: 5,
text: {maxCharacters: 4000},
includeDomains: ['nextjs.org']
})
};
fetch('https://leaves.mintlify.com/api/universal-search/v1/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://leaves.mintlify.com/api/universal-search/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'Next.js 16 caching and revalidation',
'numResults' => 5,
'text' => [
'maxCharacters' => 4000
],
'includeDomains' => [
'nextjs.org'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://leaves.mintlify.com/api/universal-search/v1/search"
payload := strings.NewReader("{\n \"query\": \"Next.js 16 caching and revalidation\",\n \"numResults\": 5,\n \"text\": {\n \"maxCharacters\": 4000\n },\n \"includeDomains\": [\n \"nextjs.org\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://leaves.mintlify.com/api/universal-search/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Next.js 16 caching and revalidation\",\n \"numResults\": 5,\n \"text\": {\n \"maxCharacters\": 4000\n },\n \"includeDomains\": [\n \"nextjs.org\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://leaves.mintlify.com/api/universal-search/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Next.js 16 caching and revalidation\",\n \"numResults\": 5,\n \"text\": {\n \"maxCharacters\": 4000\n },\n \"includeDomains\": [\n \"nextjs.org\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"requestId": "3d8ed0aa-c21c-4a18-b995-207aa6315ea8",
"results": [
{
"id": "nextjs:/docs/app/getting-started/caching-and-revalidating",
"url": "https://nextjs.org/docs/app/getting-started/caching-and-revalidating",
"title": "Caching and revalidating",
"text": "Caching is a technique for storing the result of data fetching and other computations.",
"truncated": false,
"totalCharacters": 92,
"score": 0.91,
"source": "mintlify",
"siteName": "nextjs",
"breadcrumbs": [
"App Router",
"Getting started"
],
"publishedDate": null
}
]
}{
"error": "Invalid request body"
}{
"error": "Unauthorized"
}{
"error": "IP address is not allowed for this API key"
}{
"error": "Rate limit exceeded. Please try again later"
}{
"error": "<string>"
}Authorizations
Mintlify Index API key with the mint_us_ prefix.
Body
application/json
Search query.
Minimum string length:
1Maximum number of results to return.
Required range:
1 <= x <= 20Controls result content. Set to true to include matched content, false to omit it, or provide maxCharacters to include truncated content. When omitted, defaults to false.
Domains to include in search results.
Minimum array length:
1Minimum string length:
1Domains to exclude from search results.
Minimum array length:
1Minimum string length:
1⌘I
Search technical knowledge
curl --request POST \
--url https://leaves.mintlify.com/api/universal-search/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Next.js 16 caching and revalidation",
"numResults": 5,
"text": {
"maxCharacters": 4000
},
"includeDomains": [
"nextjs.org"
]
}
'import requests
url = "https://leaves.mintlify.com/api/universal-search/v1/search"
payload = {
"query": "Next.js 16 caching and revalidation",
"numResults": 5,
"text": { "maxCharacters": 4000 },
"includeDomains": ["nextjs.org"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'Next.js 16 caching and revalidation',
numResults: 5,
text: {maxCharacters: 4000},
includeDomains: ['nextjs.org']
})
};
fetch('https://leaves.mintlify.com/api/universal-search/v1/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://leaves.mintlify.com/api/universal-search/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'Next.js 16 caching and revalidation',
'numResults' => 5,
'text' => [
'maxCharacters' => 4000
],
'includeDomains' => [
'nextjs.org'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://leaves.mintlify.com/api/universal-search/v1/search"
payload := strings.NewReader("{\n \"query\": \"Next.js 16 caching and revalidation\",\n \"numResults\": 5,\n \"text\": {\n \"maxCharacters\": 4000\n },\n \"includeDomains\": [\n \"nextjs.org\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://leaves.mintlify.com/api/universal-search/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Next.js 16 caching and revalidation\",\n \"numResults\": 5,\n \"text\": {\n \"maxCharacters\": 4000\n },\n \"includeDomains\": [\n \"nextjs.org\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://leaves.mintlify.com/api/universal-search/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Next.js 16 caching and revalidation\",\n \"numResults\": 5,\n \"text\": {\n \"maxCharacters\": 4000\n },\n \"includeDomains\": [\n \"nextjs.org\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"requestId": "3d8ed0aa-c21c-4a18-b995-207aa6315ea8",
"results": [
{
"id": "nextjs:/docs/app/getting-started/caching-and-revalidating",
"url": "https://nextjs.org/docs/app/getting-started/caching-and-revalidating",
"title": "Caching and revalidating",
"text": "Caching is a technique for storing the result of data fetching and other computations.",
"truncated": false,
"totalCharacters": 92,
"score": 0.91,
"source": "mintlify",
"siteName": "nextjs",
"breadcrumbs": [
"App Router",
"Getting started"
],
"publishedDate": null
}
]
}{
"error": "Invalid request body"
}{
"error": "Unauthorized"
}{
"error": "IP address is not allowed for this API key"
}{
"error": "Rate limit exceeded. Please try again later"
}{
"error": "<string>"
}