Semantic Search

Search by semantic meaning rather than keyword matching. Available on Growth plan and above.

GET /v1/semantic-search

Request

curl "https://api.c0r.ai/v1/semantic-search?q=high+protein+breakfast&limit=5" \
  -H "X-API-Key: fdb_your_growth_key"

Python

import requests

response = requests.get(
    "https://api.c0r.ai/v1/semantic-search",
    params={"q": "high protein breakfast", "limit": 5},
    headers={"X-API-Key": "fdb_your_growth_key"}
)
print(response.json())

JavaScript

const response = await fetch(
  "https://api.c0r.ai/v1/semantic-search?q=high+protein+breakfast&limit=5",
  { headers: { "X-API-Key": "fdb_your_growth_key" } }
);
const data = await response.json();
console.log(data);

Query Parameters

ParameterTypeRequiredDescription
qstringyesNatural language food query (min 2 chars)
limitintegernoResults per page (default 10, max 50)

Response

{
  "results": [
    {
      "id": "c_abc123",
      "name": "Greek yogurt, plain",
      "nutrition": {
        "calories": 100,
        "proteins": 17.0,
        "fats": 0.7,
        "carbs": 6.0
      },
      "score": 0.92,
      "source": "curated",
      "verified": true
    }
  ],
  "total": 5,
  "query": "high protein breakfast"
}

Compared to Full-Text Search

Search (/v1/search)Semantic Search (/v1/semantic-search)
AlgorithmFull-text (PostgreSQL tsvector)Vector similarity (embeddings)
Best forExact product names, brandsConcepts, nutritional similarity
Example"Parmalat milk 3.2%""calcium-rich dairy"
PlanDeveloper+Growth+

Plan Requirement

Semantic search requires the Growth plan ($99/mo) or above. Calling this endpoint with a Developer or Starter key returns HTTP 403:

{
  "detail": "Semantic search requires Growth or Business plan. Upgrade at developer.c0r.ai"
}