Back to KB
Difficulty
Intermediate
Read Time
4 min

`/api/search` API Documentation

By Codcompass TeamΒ·Β·4 min read

/api/search API Documentation

Overview

The /api/search endpoint provides a unified interface for full-text article discovery and contextual content recommendations. It is designed to power frontend search bars, autocomplete widgets, and "related articles" sections across the platform. The endpoint operates in two distinct modes: Search (default) and Recommendation.

  • Search Mode: Performs case-insensitive matching against article titles and excerpts, returning up to 10 published results.
  • Recommendation Mode: Returns up to 5 contextually relevant articles, prioritizing those that belong to the same content series as the reference article.

This endpoint is publicly accessible and requires no authentication, making it suitable for client-side integration, static site generation, and third-party tooling.

Endpoint Reference

PropertyValue
Base URLhttps://api.codcompass.com
Path/api/search
HTTP MethodGET
AuthenticationNone (Public)
Content-Typeapplication/json

Request Format

The endpoint accepts all parameters via URL query strings. No request body is required.

Query Parameters

ParameterTypeRequiredDefaultDescription
qstringConditional""Search query string. Must be at least 2 characters long for search mode. Ignored in recommendation mode.
typestring

πŸŽ‰ Mid-Year Sale β€” Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register β€” Start Free Trial

7-day free trial Β· Cancel anytime Β· 30-day money-back

Sources

  • β€’ api-reference