Skip to content

Search API

The Search API allows you to create, update, and manage search records independently of content updates. This provides more control over structured data (title, summary, content, filterable attributes) rather than relying solely on content extractors.

Method: Bearer Token

All API requests must include the following headers:

HeaderDescription
Quant-TokenYour project’s API token (found in your dashboard)
Quant-CustomerYour customer identifier
Quant-ProjectYour project identifier

These headers will be validated to ensure the request is authorized.

Example:

Terminal window
curl -H "Quant-Customer: example-customer" \
-H "Quant-Project: example-project" \
-H "Quant-Token: your-project-token" \
https://api.quantcdn.io/v1/search

All API requests must be directed to:

https://api.quantcdn.io/v1/

URL: /search

Method: GET

Description: Check index size, outstanding tasks, and basic configuration.

Status Code: 200 OK

{
"index_size": 1250,
"pending_tasks": 0,
"facets": ["categories", "tags"],
"status": "ready"
}

URL: /search

Method: POST

Description: Create or update search records in the index.

An array of search record objects:

[
{
"title": "This is a record",
"url": "/blog/page",
"summary": "The record is small and neat.",
"content": "Lots of good content here. But not too much!"
},
{
"title": "Fully featured search record",
"url": "/about-us",
"summary": "The record contains all the trimmings.",
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"image": "https://www.example.com/images/about.jpg",
"categories": ["Blog", "Commerce", "Jamstack"],
"tags": ["Tailwind", "QuantCDN"]
}
]
PropertyTypeRequiredDescription
titlestringYesTitle used in search results and as a searchable attribute
urlstringYesThe URL path where the content is accessible
summarystringYesContent snippet displayed in search results
contentstringYesMain searchable content (can contain HTML, tags will be stripped)
imagestringNoURL to an image for display in search results
categoriesobject/arrayNoCustom taxonomies for faceting and filtering
tagsarrayNoTags for faceting and filtering

Status Code: 200 OK

{
"message": "Search records created/updated successfully",
"processed": 2,
"errors": 0
}

URL: /search/facet

Method: POST

Description: Define which attributes should be filterable in search results.

An array of attribute names:

["categories", "tags"]

Status Code: 200 OK

{
"message": "Facets updated successfully",
"facets": ["categories", "tags"]
}

URL: /search

Method: DELETE

Description: Remove a specific item from the search index.

HeaderTypeRequiredDescription
Quant-UrlstringYesThe URL path of the record to delete
Terminal window
curl -X DELETE \
-H "Quant-Customer: example-customer" \
-H "Quant-Project: example-project" \
-H "Quant-Token: your-project-token" \
-H "Quant-Url: /about-us" \
https://api.quantcdn.io/v1/search

Status Code: 200 OK

{
"message": "Search record deleted successfully",
"url": "/about-us"
}

URL: /search/all

Method: DELETE

Description: Remove all records from the search index.

Terminal window
curl -X DELETE \
-H "Quant-Customer: example-customer" \
-H "Quant-Project: example-project" \
-H "Quant-Token: your-project-token" \
https://api.quantcdn.io/v1/search/all

Status Code: 200 OK

{
"message": "Search index cleared successfully"
}

You can include search records when posting content by adding a search_record object to your content payload:

{
"content": "<html><body><h1>My static web page</h1></body></html>",
"url": "/",
"published": true,
"info": {
"author_name": "Joe Static",
"log": "Included custom search_record values"
},
"search_record": {
"title": "Manually provided title",
"summary": "Content snippet to display in search results.",
"content": "This page has a lot of body content. It is manually provided via search_record.",
"image": "https://via.placeholder.com/custom",
"categories": {
"tags": ["manual-tag-1", "manual-tag-2"],
"custom_taxonomy": ["apple", "banana", "pineapple"]
}
}
}
KeyDescription
titleUsed both as a searchable attribute and the title in search results
summaryUsed as a searchable attribute and the content snippet in search results
contentMain searchable content (HTML tags will be stripped)
imageURL to an image for display in search results
categoriesObject containing taxonomies with arrays of terms for faceting

All keys within search_record are optional. The configured extractors will attempt to determine content as a fallback.

{
"error": "Invalid parameter",
"message": "Search record must include title, url, and content"
}
{
"error": "Unauthorized",
"message": "Invalid API token"
}
{
"error": "Rate limit exceeded",
"message": "Too many requests, please try again later"
}