Mintlify Index
Obtener contenido de resultados
Recupera contenido de Mintlify Index mediante el ID o la URL de un resultado después de buscar.
POST
/
v1
/
contents
Obtener contenido de resultados
curl --request POST \
--url https://leaves.mintlify.com/api/universal-search/v1/contents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"nextjs:/docs/app/getting-started/caching-and-revalidating"
],
"query": "revalidar datos almacenados en caché",
"maxCharacters": 12000
}
'import requests
url = "https://leaves.mintlify.com/api/universal-search/v1/contents"
payload = {
"ids": ["nextjs:/docs/app/getting-started/caching-and-revalidating"],
"query": "revalidar datos almacenados en caché",
"maxCharacters": 12000
}
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({
ids: ['nextjs:/docs/app/getting-started/caching-and-revalidating'],
query: 'revalidar datos almacenados en caché',
maxCharacters: 12000
})
};
fetch('https://leaves.mintlify.com/api/universal-search/v1/contents', 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/contents",
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([
'ids' => [
'nextjs:/docs/app/getting-started/caching-and-revalidating'
],
'query' => 'revalidar datos almacenados en caché',
'maxCharacters' => 12000
]),
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/contents"
payload := strings.NewReader("{\n \"ids\": [\n \"nextjs:/docs/app/getting-started/caching-and-revalidating\"\n ],\n \"query\": \"revalidar datos almacenados en caché\",\n \"maxCharacters\": 12000\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/contents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"nextjs:/docs/app/getting-started/caching-and-revalidating\"\n ],\n \"query\": \"revalidar datos almacenados en caché\",\n \"maxCharacters\": 12000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://leaves.mintlify.com/api/universal-search/v1/contents")
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 \"ids\": [\n \"nextjs:/docs/app/getting-started/caching-and-revalidating\"\n ],\n \"query\": \"revalidar datos almacenados en caché\",\n \"maxCharacters\": 12000\n}"
response = http.request(request)
puts response.read_body{
"requestId": "6bf694e4-76cb-4d31-a222-c94b2d9b198a",
"results": [
{
"id": "nextjs:/docs/app/getting-started/caching-and-revalidating",
"url": "https://nextjs.org/docs/app/getting-started/caching-and-revalidating",
"title": "Almacenamiento en caché y revalidación",
"text": "# Almacenamiento en caché y revalidación\n\nUsa las API de revalidación para actualizar los datos almacenados en caché.",
"truncated": false,
"totalCharacters": 78,
"score": 0,
"source": "mintlify",
"siteName": "nextjs",
"breadcrumbs": [
"Enrutador de aplicaciones",
"Primeros pasos"
],
"publishedDate": null
}
],
"statuses": [
{
"id": "nextjs:/docs/app/getting-started/caching-and-revalidating",
"status": "success"
}
]
}{
"error": "Una solicitud puede hacer referencia como máximo a 20 elementos entre urls e ids"
}{
"error": "No autorizado"
}{
"error": "La dirección IP no está permitida para esta clave de API"
}{
"error": "Límite de uso superado. Vuelve a intentarlo más tarde"
}{
"error": "<string>"
}Autorizaciones
Clave de API de Mintlify Index con el prefijo mint_us_.
Cuerpo
application/json
- Option 1
- Option 2
Proporciona al menos un ID de resultado de Mintlify o una URL de resultado. Puedes combinar ambos campos, con un máximo total de 20 elementos.
URL de resultados que se recuperarán. Usa este campo para resultados web.
Required array length:
1 - 20 elementsID de resultados de Mintlify que se recuperarán.
Required array length:
1 - 20 elementsMinimum string length:
1Número máximo de caracteres de contenido que se devolverán por resultado.
Rango requerido:
x >= 1Consulta que se usará para seleccionar las secciones más relevantes cuando el contenido supere maxCharacters.
Minimum string length:
1Respuesta
La recuperación de contenido se completó. Comprueba cada estado para determinar si el elemento se procesó correctamente.
⌘I
Obtener contenido de resultados
curl --request POST \
--url https://leaves.mintlify.com/api/universal-search/v1/contents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"nextjs:/docs/app/getting-started/caching-and-revalidating"
],
"query": "revalidar datos almacenados en caché",
"maxCharacters": 12000
}
'import requests
url = "https://leaves.mintlify.com/api/universal-search/v1/contents"
payload = {
"ids": ["nextjs:/docs/app/getting-started/caching-and-revalidating"],
"query": "revalidar datos almacenados en caché",
"maxCharacters": 12000
}
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({
ids: ['nextjs:/docs/app/getting-started/caching-and-revalidating'],
query: 'revalidar datos almacenados en caché',
maxCharacters: 12000
})
};
fetch('https://leaves.mintlify.com/api/universal-search/v1/contents', 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/contents",
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([
'ids' => [
'nextjs:/docs/app/getting-started/caching-and-revalidating'
],
'query' => 'revalidar datos almacenados en caché',
'maxCharacters' => 12000
]),
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/contents"
payload := strings.NewReader("{\n \"ids\": [\n \"nextjs:/docs/app/getting-started/caching-and-revalidating\"\n ],\n \"query\": \"revalidar datos almacenados en caché\",\n \"maxCharacters\": 12000\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/contents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"nextjs:/docs/app/getting-started/caching-and-revalidating\"\n ],\n \"query\": \"revalidar datos almacenados en caché\",\n \"maxCharacters\": 12000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://leaves.mintlify.com/api/universal-search/v1/contents")
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 \"ids\": [\n \"nextjs:/docs/app/getting-started/caching-and-revalidating\"\n ],\n \"query\": \"revalidar datos almacenados en caché\",\n \"maxCharacters\": 12000\n}"
response = http.request(request)
puts response.read_body{
"requestId": "6bf694e4-76cb-4d31-a222-c94b2d9b198a",
"results": [
{
"id": "nextjs:/docs/app/getting-started/caching-and-revalidating",
"url": "https://nextjs.org/docs/app/getting-started/caching-and-revalidating",
"title": "Almacenamiento en caché y revalidación",
"text": "# Almacenamiento en caché y revalidación\n\nUsa las API de revalidación para actualizar los datos almacenados en caché.",
"truncated": false,
"totalCharacters": 78,
"score": 0,
"source": "mintlify",
"siteName": "nextjs",
"breadcrumbs": [
"Enrutador de aplicaciones",
"Primeros pasos"
],
"publishedDate": null
}
],
"statuses": [
{
"id": "nextjs:/docs/app/getting-started/caching-and-revalidating",
"status": "success"
}
]
}{
"error": "Una solicitud puede hacer referencia como máximo a 20 elementos entre urls e ids"
}{
"error": "No autorizado"
}{
"error": "La dirección IP no está permitida para esta clave de API"
}{
"error": "Límite de uso superado. Vuelve a intentarlo más tarde"
}{
"error": "<string>"
}