Semantic Search
Search by semantic meaning rather than keyword matching. Available on Growth plan and above.
GET /v1/semantic-searchRequest
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
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | yes | Natural language food query (min 2 chars) |
limit | integer | no | Results 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) | |
|---|---|---|
| Algorithm | Full-text (PostgreSQL tsvector) | Vector similarity (embeddings) |
| Best for | Exact product names, brands | Concepts, nutritional similarity |
| Example | "Parmalat milk 3.2%" | "calcium-rich dairy" |
| Plan | Developer+ | 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"
}