API Usage
For tight integrations or custom frontends, LookIA provides a REST interface designed for speed and simplicity.
Authentication & CORS
Access to the search endpoint does not require an API key. Instead, security is handled via Cross-Origin Resource Sharing (CORS) based on the "Allowed Domains" specified in your widget configuration.
Requests must include a valid Origin header matching your allowed settings.
Query Endpoint
Search queries are executed via a POST request to /api/sites/{site_id}/query.
Request Structure:
curl -X POST https://api.lookia.com/api/sites/YOUR_SITE_ID/query \
-H "Origin: https://your-allowed-domain.com" \
-H "Content-Type: application/json" \
-d '{
"terms": "How do I calculate compound interest?"
}'
Parameters:
terms(string, required): The natural language phrase you want to request.min_score(float, optional): Optional threshold override for the underlying core query (advanced use only).include_ai_answeris determined automatically by your subscription level and dashboard settings. Limit is fixed to 10 results.
Response Parsing
The API responds with JSON containing an array of matched nodes.
{
"matches": [
{
"id": "item-1283",
"score": 0.92,
"metadata": {
"title": "Understanding Compound Interest",
"url": "/finance/compound-interest-guide",
"excerpt": "Compound interest is the addition of interest to the principal sum of a loan or deposit..."
}
}
]
}
By mapping the metadata to your customized frontend components, you bypass the need for our visual widget entirely.
Rate Limits
By default, accounts allow up to 10 queries per second (QPS). For higher volumes, contact support.