Skip to Content
ReferenceAPI referenceCrowdSec

Count CrowdSec alerts per day

GET
/api/v1/crowdsec/alerts/daily

Returns how many alerts started on each of the last days days, today included, without the community blocklist pulls. An alert counts on the day of its first event, or of when the LAPI stored it when it has no first event. One LAPI request reads at most 2000 alerts. Answers 403 when the server has no CrowdSec machine credentials, CROWDSEC_MACHINE_ID and CROWDSEC_MACHINE_PASSWORD.

Authorization

cookiesession<token>

Session cookie authentication.

Query Parameters

days?integer

Days to count, from 1 to 31. Defaults to 7.

Range1 <= value <= 31
Default7
tz?string

An IANA timezone such as Europe/Oslo. Days start at midnight in it. An unknown zone gets a 400. Defaults to UTC.

Default"UTC"

Response Body

Request fulfilled, document follows

application/json
  1. response

Alerts per day over the last days, oldest day first.

capped*boolean

True when the LAPI returned more than 2000 alerts. The counts then cover the 2000 it stored last, and any day can count short, the oldest days most.

days*array<>
total*integer

The sum of days.

Example Request
curl -X GET 'https://geometrikks.example.com/api/v1/crowdsec/alerts/daily'
Example Response
{  "capped": true,  "days": [    {      "count": 0,      "date": "string"    }  ],  "total": 0}