Query Log Lens from the JSON API
Log Lens serves JSON from the same origin as its dashboard. Every endpoint is a query string on the root URL, selected with the api parameter - for example GET /?api=summary. Reads use GET, so they are never blocked by the cross-origin guard and are the safest place to start.
Set your base URL
Point a variable at your deployment - for the standalone server from Install and run the standalone app, that is:
export LOG_LENS_URL="http://127.0.0.1:8787"
Make your first request
Ask for the dashboard totals - trends, severities, types, and initial sources:
curl --get "$LOG_LENS_URL/" --data-urlencode "api=summary"
Then search issues. Filters combine with AND; results paginate:
curl --get "$LOG_LENS_URL/" \
--data-urlencode "api=errors" \
--data-urlencode "severity=ERROR" \
--data-urlencode "sort=occurrences" \
--data-urlencode "limit=25"
Send the API key header
Authentication is optional. If your deployment sets a token (LOG_LENS_TOKEN), every request must present it - otherwise you get 401:
curl --get "$LOG_LENS_URL/" \
--data-urlencode "api=summary" \
--header "X-Log-Lens-Token: $LOG_LENS_TOKEN"
Authorization: Bearer $LOG_LENS_TOKEN is also accepted. When no token is configured, the API is unauthenticated (the local-first default).
Read the response shape
List endpoints return a data array plus a meta block:
{
"data": [
{
"id": 15,
"severity": "ERROR",
"title": "Database query failed",
"count": 42,
"last_seen": "2026-07-24 16:42:12",
"status": "in_progress",
"log_type": "laravel"
}
],
"meta": { "total": 144, "page": 1, "limit": 50, "pages": 3, "sort": "newest" }
}
Key defaults:
| Parameter | Default | Range |
|---|---|---|
limit | 50 | 1-200 |
page | 1 | one-indexed |
sort | newest | newest, oldest, occurrences |
Add include_stack=true or include_context=true for heavier investigation payloads. To read one issue with its occurrences, timeline, and status history, use GET /?api=error&id=15.
Errors always return application/json with a single error field. Treat responses as sensitive - log messages can carry credentials, URLs, or request payloads.