# Query grammar `GET` `https://api.unusualwhales.com/api/alerts/query/grammar` Returns the grammar of the alert Query language: available targets, syntax, fields, functions, operators, scopes and example expressions. Without a `target` parameter an overview over all targets is returned. Pass a `target` to get the full field reference for that alert type. Use the Query language to create complex alert configurations via the create alert configuration endpoint. You can compare fields `strike > spot`, add complex math operations `ln(strike / spot) / (iv * sqrt(dte / 365)) > 2` and write configs similar as to one writes SQL. If you are an Ai/Agent you should use this endpoint to fetch the grammar and then post them to `/api/alerts/configuration`. See the documentation at the https://api.unusualwhales.com/docs/operations/PublicApi.AlertsController.create_config for more info on the format and how to post an alert config. ## Authentication ``` Authorization: Bearer YOUR_API_KEY ``` ## Query Parameters | Name | Type | Required | Description | |------|------|----------|-------------| | `target` | string | No | The alert target to return the detailed grammar for. | ## Example ### curl ```bash curl -X GET "https://api.unusualwhales.com/api/alerts/query/grammar" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json" ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("api.unusualwhales.com") headers = {"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"} conn.request("GET", "/api/alerts/query/grammar", headers=headers) response = conn.getresponse() print(response.read().decode("utf-8")) ``` ## Response Example ```json {} ```