# GET /api/query

> GET /api/query reference: Cypher in the q parameter, optional fields, headers, the response envelope, and when to use GET or POST, with five languages.

*Source: https://www.whisper.security/docs/cypher-api/reference/query-get*

---
`GET /api/query` runs the same query functionality as [`POST /api/query`](/docs/cypher-api/reference/query-post), with the Cypher passed as the `q` URL parameter. It is handy for quick checks and links you can paste into a browser.

`GET` is single-statement only: it takes no `parameters` object and does not run `;`-separated batches. Use `POST` for anything real: it avoids URL-encoding the whole query, has no URL length limit, and carries parameters cleanly. Use `GET` for one-off reads and debugging.

The parameter is `q`, not `query`. A `GET` with no `q`, including one that sends `?query=` instead, answers `400 missing-query-parameter`.

Base URL: `https://graph.whisper.security`. Authentication is shared across the API and covered on the [API Reference](/docs/cypher-api/reference) index.

## Request

| Part | Value |
|------|-------|
| Query parameter `q` | The Cypher query, URL-encoded. Required. |
| Query parameter `timeout` | Optional. Milliseconds to allow for this query; a value above what your access allows is lowered, not honored. |
| Query parameter `projectionFull` | Optional, default `false`. Set `true` to include the reconciled threat-verdict properties in whole-node projections; see [POST /api/query](/docs/cypher-api/reference/query-post#request-body). |
| `X-API-Key` header | Your API key. [Sign in](https://console.whisper.security/sign-in?redirect_url=https%3A%2F%2Fwww.whisper.security%2Fdocs%2Fcypher-api) to get one. Without one the query runs with reduced access. |
| `User-Agent` header | Recommended. Send a descriptive value that names your client. |

## Call it

```whisper-code-tabs
{
  "curl": "curl -s -A \"whisper-client/1.0\" \\\n  -H \"X-API-Key: $WHISPER_API_KEY\" \\\n  \"https://graph.whisper.security/api/query?q=RETURN%201%20AS%20n\"",
  "python": "import requests\n\nres = requests.get(\n    \"https://graph.whisper.security/api/query\",\n    params={\"q\": \"RETURN 1 AS n\"},\n    headers={\n        \"X-API-Key\": \"whisper-YOUR_API_KEY\",\n        \"User-Agent\": \"whisper-client/1.0\",\n    },\n)\nprint(res.json())",
  "node": "const url = new URL(\"https://graph.whisper.security/api/query\");\nurl.searchParams.set(\"q\", \"RETURN 1 AS n\");\n\nconst res = await fetch(url, {\n  headers: {\n    \"X-API-Key\": process.env.WHISPER_API_KEY,\n    \"User-Agent\": \"whisper-client/1.0\",\n  },\n});\nconsole.log(await res.json());",
  "go": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\nfunc main() {\n\tq := url.Values{}\n\tq.Set(\"q\", \"RETURN 1 AS n\")\n\tu := \"https://graph.whisper.security/api/query?\" + q.Encode()\n\treq, _ := http.NewRequest(\"GET\", u, nil)\n\treq.Header.Set(\"X-API-Key\", \"whisper-YOUR_API_KEY\")\n\treq.Header.Set(\"User-Agent\", \"whisper-client/1.0\")\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tout, _ := io.ReadAll(res.Body)\n\tfmt.Println(string(out))\n}",
  "ruby": "require \"net/http\"\nrequire \"json\"\nrequire \"uri\"\n\nuri = URI(\"https://graph.whisper.security/api/query\")\nuri.query = URI.encode_www_form(q: \"RETURN 1 AS n\")\nreq = Net::HTTP::Get.new(uri, {\n  \"X-API-Key\" => \"whisper-YOUR_API_KEY\",\n  \"User-Agent\" => \"whisper-client/1.0\",\n})\n\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs JSON.parse(res.body)"
}
```

The response is the same envelope as `POST`:

```json
{"columns": ["n"], "rows": [{"n": 1}], "statistics": {"rowCount": 1, "executionTimeMs": 0}}
```

Errors are the same `application/problem+json` documents as on `POST`, keyed on the `type` slug; see [Errors](/docs/cypher-api/errors). For the full request body, parameter binding, and batch statements, see [POST /api/query](/docs/cypher-api/reference/query-post). For graph-wide counts, see [GET /api/query/stats](/docs/cypher-api/reference/stats).
