API
POST /api/search
Web Search
POST /api/search
Web Search
Authentication: Authorization: Bearer <key> or X-API-Key: <key>. Create keys at developers.cognitivx.io/keys.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Org-ID | header | string | null | No | - |
Request body
A JSON request body is required.
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | - |
max_results | integer | No | Defaults to 5. |
Example request
curl -X POST https://api.cognitivx.io/api/search \
-H "Authorization: Bearer icog_..." \
-H "Content-Type: application/json" \
-d '{
"query": "what did we decide about billing",
"max_results": 5
}'Example response
200 application/json
{
"results": [
{
"title": "string",
"url": "https://example.com",
"snippet": "string"
}
],
"query": "what did we decide about billing"
}Responses
| Status | Description |
|---|---|
200 | Success. Returns the response body shown below. |
422 | Request validation failed. detail lists each offending field. |