> For the complete documentation index, see [llms.txt](https://waap.docs.link11.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://waap.docs.link11.com/reference-information/api/namespace-reference/data-queries.md).

# Data queries

{% hint style="info" %}
Two of the **Data queries** routes below manage [quarantined traffic sources](/console-walkthrough/security/quarantined.md). The rest are for retrieving traffic data; for instructions on using them, see [API access to traffic data](/reference-information/api/api-access-to-traffic-data.md).
{% endhint %}

## Quarantine operations

## Get quarantined list

> Get quarantined list

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/quarantined":{"get":{"operationId":"api.quarantined.handler.get_quarantined","summary":"Get quarantined list","description":"Get quarantined list","parameters":[{"in":"query","name":"config","schema":{"type":"string"}},{"in":"query","name":"ids","schema":{"items":{"type":"string"},"type":"array"}},{"in":"query","name":"rule_ids","schema":{"items":{"type":"string"},"type":"array"}},{"description":"Database to get data from","in":"header","name":"provider","required":true,"schema":{"description":"Database to get data from","enum":["mongodb"],"type":"string"}},{"description":"Syntax of query","in":"header","name":"syntax","required":true,"schema":{"description":"Syntax of query","enum":["string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Query for quarantined has been run successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Delete record(s) from quarantined list

> Delete record(s) from quarantined list

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/quarantined":{"delete":{"operationId":"api.quarantined.handler.delete_quarantined","summary":"Delete record(s) from quarantined list","description":"Delete record(s) from quarantined list","parameters":[{"description":"Database to get data from","in":"header","name":"provider","required":true,"schema":{"description":"Database to get data from","enum":["mongodb"],"type":"string"}},{"description":"Syntax of query","in":"header","name":"syntax","required":true,"schema":{"description":"Syntax of query","enum":["json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"config":{"type":"string"},"ids":{"items":{"type":"string"},"type":"array"},"rule_ids":{"items":{"type":"string"},"type":"array"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Record(s) was/were successfully deleted"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Traffic data operations

## Get traffic data from logs

> Retrieve traffic data using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/logs":{"get":{"operationId":"api.logs.handler.get_loglines_860854857476889660","summary":"Get traffic data from logs","description":"Retrieve traffic data using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"in":"query","name":"limit","schema":{"default":100,"maximum":2500,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"minimum":0,"type":"integer"}},{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"if set to true the query will be saved in the query history","in":"query","name":"save_history","required":false,"schema":{"description":"if set to true the query will be saved in the query history","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Logs has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Get traffic stats

> Get stats (time\_period, counter, hostname, bandwidth, latency) using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/stats":{"get":{"operationId":"api.dashboard.handler.get_stats_1179987213029942625","summary":"Get traffic stats","description":"Get stats (time_period, counter, hostname, bandwidth, latency) using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Stats has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Get traffic timeline

> Get timeline (time\_period, sessions, remote\_addr, all\_hits, blocked, origin\_blocked, challenge, is\_human, statuses stats, origin statuses stats, bytes\_sent) using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/timeline":{"get":{"operationId":"api.dashboard.handler.get_timeline_185381998472123425","summary":"Get traffic timeline","description":"Get timeline (time_period, sessions, remote_addr, all_hits, blocked, origin_blocked, challenge, is_human, statuses stats, origin statuses stats, bytes_sent) using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Timeline has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Convert 'filters' query string to JSON

> Convert a query string (as used in the UI Dashboard and Events Log) into JSON format.

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/timeline/parse":{"post":{"operationId":"api.dashboard.handler.post_parse_38303596745303976","summary":"Convert 'filters' query string to JSON","description":"Convert a query string (as used in the UI Dashboard and Events Log) into JSON format.","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"query":{"oneOf":[{"type":"string"},{"type":"object"}]}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Filter string has been converted successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Get "top" traffic data

> Get topx stats using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/topx":{"get":{"operationId":"api.dashboard.handler.get_topx_2280964647653779379","summary":"Get \"top\" traffic data","description":"Get topx stats using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"if set to true the query will be saved in the query history","in":"query","name":"save_history","required":false,"schema":{"description":"if set to true the query will be saved in the query history","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Topx has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```
