# Quick start

Evaluate a CQL expression in under a minute.

The Evaluation API exposes endpoints for executing [CQL](/reference/cql/introduction) expressions in real time against the current user context, available in a client-side variant authenticated with a public [application ID](/explanation/application) and a server-side variant authenticated with a secret [API key](/explanation/application/api-keys).

> **Prefer the SDK**
>
> Most applications should integrate through the [Croct SDK](/reference/sdk), which handles authentication, client IDs, context detection, and caching. Call the HTTP API directly only for custom integrations or when building a new client.

## Evaluate an expression

Make a `POST` request to `/client/web/evaluate` with the expression to evaluate:

**JavaScript**

```js
const response = await fetch('https://api.croct.io/client/web/evaluate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-App-Id': '<APP ID>',
    'X-Client-Id': '<CLIENT ID>',
  },
  body: JSON.stringify({query: 'user is returning'}),
});

const result = await response.json();
```

**cURL**

```bash
curl -X POST 'https://api.croct.io/external/web/evaluate' \
  -H 'Content-Type: application/json' \
  -H 'X-Api-Key: <API KEY>' \
  -d '{"query": "user is returning"}'
```

The response is the JSON-serializable result of the expression. In this case, a boolean:

```json
true
```

See the [endpoint reference](/reference/api/service/evaluation/endpoint/client/evaluate#response) for more details.
