KismetDB

If the KismetDB log is enabled, Kismet exposes historic, searchable data.

If KismetDB logging is not enabled, these endpoints will not be available and will return an error.

Historic packets

DESC

When the kismetdb log type is enabled, fetch packets which match the filter statement from the logfile.

Returns a PCAP-NG format stream of packets.

ROLES
ADDED
API added 2018-12
URI
/logging/kismetdb/pcap/{TITLE}.pcapng
METHODS
GET POST
URI
PARAMETERS
TITLE string REQUIRED

Arbitrary file name

filter multiple

Multiple filter options

JSON
PARAMETERS

This endpoint takes additional parameters by using a `POST` request and supplying a JSON document or json form variable.

You can find more information about API parameters here.

filter multiple OPTIONAL

Multiple filter options

API

The filter options can be passed as individual arguments on the GET URI, as URI-encoded variables (ie /logging/kismetdb/pcap/foo.pcapng?datasource=...&foo=...&bar=...), or passed as a JSON command dictionary as a POST request.

Filters function as an AND statement: To match a packet, it must match all filter terms.

Time window

Restrict packets by a timeframe which can be either bounded (both start and end times specified) or open-ended (only start or end specified)

timestamp_start number OPTIONAL

Posix timestamp with optional double precision as seconds.microseconds

timestamp_end number OPTIONAL

Posix timestamp with optional double precision as seconds.microseconds

Datasource

Limit packets to a specific datasource, by datasource UUID

datasource string OPTIONAL

Datasource UUID

Device key

Packets to, from, or otherwise associated with, the specified device.

device_id string OPTIONAL

Kismet device key

Match a specific data link type (DLT). This numeric DLT matches the libpcap link types and describes the physical frame type of the packet.

dlt number OPTIONAL

PCAP DLT value

Frequency

Match a specific, bounded, or open-ended frequency rage.

frequency number OPTIONAL

Natch a single frequency in KHz

frequency_min number OPTIONAL

Mininum frequency, in KHz

frequency_max number OPTIONAL

Maximum frequency, in KHz

Signal

Match a bounded or open-ended window of signal levels.

Packets with no signal level are considered to have a signal level of 0.

signal_min number OPTIONAL

Minimum signal level

signal_max number OPTIONAL

Maximum signal level

Device MAC addresses

Match by MAC address, if available.

address_source string OPTIONAL

Source MAC address

address_dest string OPTIONAL

Destination MAC address

address_trans string OPTIONAL

Transmitter MAC aaddress (such as the AP BSSID on Wi-Fi)

Location

Filter by a bounded location of rectangular minimum and maximum coordinates.

Coordinates are decimal degrees in floating point format (123.456789).

location_lat_min number OPTIONAL

Minimum latitude

location_lon_min number OPTIONAL

Minimum longitude

location_lat_max number OPTIONAL

Maximum latitude

location_lon_min number OPTIONAL

Maximum longitude

Packet size

Match a bounded or unbounded packet size window.

size_min number OPTIONAL

Minimum packet size, in bytes

size_max number OPTIONAL

Maximum packet size, in bytes

Tags

tag string OPTIONAL

Packet tag to match

Limit

Limit the number of packets returned.

limit number OPTIONAL

Return at most limit packets

Deleting packets

DESC

Delete all packets before drop_before from the KismetDB log.

On very long-running Kismet processes, this can be used to prevent the kismetdb from becoming unmanageable while retaining packet history, for instance by fetching all packets using the historic packet endpoint, then removing them from the kismetdb log.

ROLES
ADDED
API added 2018-12
URI
/logging/kismetdb/pcap/drop.cmd
METHODS
POST
JSON
PARAMETERS

This endpoint takes additional parameters by using a `POST` request and supplying a JSON document or json form variable.

You can find more information about API parameters here.

drop_before OPTIONAL

Pushing tagged data

DESC

Save an arbitrary JSON record in the kismetdb log, under a tag of your choosing. This can be used to keep data from other tools, such as sensor readings or camera images, in the same log and timeline as the Kismet data. Binary data, such as images, can be sent as base64 strings inside the JSON.

Records are saved to the snapshots table of the kismetdb log with the type API:<tag>, the current time, and the current GPS location (if there is a GPS fix). The JSON is stored as sent, in compact form.

Admin logins and API keys with the datalog role can push records; a datalog API key has no access to any other endpoint, which makes it suitable for giving to an external tool.

Requests to this endpoint may be up to kis_log_tagged_data_max_size bytes, 8MB by default (all other endpoints remain limited to 100KB). Larger requests are rejected with a 413 error. The larger limit only applies once the login has been accepted.

For example, saving an image from a camera:

$ curl -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
    --data "{\"tag\": \"camera\", \"data\": {\"image\": \"$(base64 -w0 shot.jpg)\"}}" \
    http://localhost:2501/logging/kismetdb/data/push.cmd

Records can be read back with the tagged data records endpoint, or from a log file with sqlite3:

$ sqlite3 foo.kismet "SELECT ts_sec, lat, lon, json FROM snapshots WHERE snaptype = 'API:camera'"

This endpoint is only available when the kismetdb log is enabled.

ROLES
admin datalog
ADDED
API added 2026-11
URI
/logging/kismetdb/data/push.cmd
METHODS
POST
JSON
PARAMETERS

This endpoint takes additional parameters by using a `POST` request and supplying a JSON document or json form variable.

You can find more information about API parameters here.

tag string REQUIRED

Record tag; 1 to 64 letters, digits, ., _, or -

data json REQUIRED

Any JSON value: an object, list, string, or number

RETURN

JSON object:

FieldContent
oktrue
tagTag of the saved record
ts_secTimestamp of the record, in seconds
ts_usecTimestamp of the record, microseconds
RESPONSES
200
Record saved
400
Invalid tag, missing data, or invalid JSON; the JSON error response describes the problem
401
Not logged in, or the API key does not have the datalog role
413
Request is larger than kis_log_tagged_data_max_size
500
Record could not be written to the log

Listing tagged data

DESC

List the tags of the records saved with the tagged data push endpoint, in the current kismetdb log, sorted by tag.

This endpoint is only available when the kismetdb log is enabled.

ROLES
readonly
ADDED
API added 2026-11
URI
/logging/kismetdb/data/tags.json
METHODS
GET POST
RETURN

JSON list of tags:

FieldContent
tagTag
countNumber of records with this tag
first_ts_secTimestamp of the oldest record, in seconds
last_ts_secTimestamp of the newest record, in seconds
RESPONSES
200
Success

Reading tagged data

DESC

Read back the records saved with the tagged data push endpoint from the current kismetdb log, oldest first. Without a tag, records of every tag are returned.

Options can be sent as URI parameters on a GET (ie /logging/kismetdb/data/records.json?tag=camera&limit=10) or as a JSON command on a POST.

Records are returned in pages. When more is true, there are more records; request them by passing the next value of the reply as after. A reply also stops early, with more set, once it holds about 32MB of data; a reply always includes at least one record, so a single large record can still be read. To find records without fetching their data, use data=false.

For example, fetching every camera record:

$ curl -H "Authorization: Bearer $KEY" \
    "http://localhost:2501/logging/kismetdb/data/records.json?tag=camera&after=0"

Then repeat with after set to the next value until more is false.

Record ids are only meaningful within the same kismetdb log. A record whose stored data is not valid JSON (for instance, if the log was edited by another tool) is returned with data set to null.

Readonly logins and API keys can read records; datalog API keys can only push records, and can not read them back.

This endpoint is only available when the kismetdb log is enabled.

ROLES
readonly
ADDED
API added 2026-11
URI
/logging/kismetdb/data/records.json
METHODS
GET POST
URI
PARAMETERS
tag string

Only records with this tag

after number

Only records after this record id

ts_start number

Only records at or after this time, in seconds

ts_end number

Only records at or before this time, in seconds

limit number

Return at most this many records, 1 to 1000; default 100

data boolean

false returns only the record details and size, without the data; default true

JSON
PARAMETERS

This endpoint takes additional parameters by using a `POST` request and supplying a JSON document or json form variable.

You can find more information about API parameters here.

tag string OPTIONAL

Only records with this tag

after number OPTIONAL

Only records after this record id

ts_start number OPTIONAL

Only records at or after this time, in seconds

ts_end number OPTIONAL

Only records at or before this time, in seconds

limit number OPTIONAL

Return at most this many records, 1 to 1000; default 100

data boolean OPTIONAL

false returns only the record details and size, without the data; default true

RETURN

JSON object:

FieldContent
oktrue
recordsList of records, below
moretrue if there are more records after these
nextId of the last record returned, to pass as after; missing when no records were returned

Each record:

FieldContent
idRecord id
tagTag
ts_secTimestamp, in seconds
ts_usecTimestamp, microseconds
latLatitude, or 0 if there was no GPS location
lonLongitude, or 0 if there was no GPS location
sizeSize of the stored data, in bytes
dataThe record data, as pushed; left out when data is false
RESPONSES
200
Success
400
Invalid option; the JSON error response describes the problem
401
Not logged in, or the API key does not have the readonly role

Deleting tagged data

DESC

Delete records saved with the tagged data push endpoint from the current kismetdb log. Only tagged records are deleted; other data in the log, such as GPS snapshots, POIs, devices, and packets, is never touched, even if its id is given in ids.

When more than one option is given, a record has to match all of them; for instance, tag and ts_end together delete only the older records with that tag. A request with no options is refused, so that an empty or mistaken request can not delete everything; to delete every tagged record, send all set to true.

For example, deleting the camera records older than a day:

$ curl -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
    --data "{\"tag\": \"camera\", \"ts_end\": $(( $(date +%s) - 86400 ))}" \
    http://localhost:2501/logging/kismetdb/data/delete.cmd

Only admin logins can delete records; readonly and datalog API keys can not.

Deleting records frees space inside the kismetdb log for new data, but does not make the log file smaller, and the deleted data may remain readable in the file until SQLite reuses that space. To remove it from the file for good, clean the log with kismetdb_clean or sqlite3 foo.kismet "VACUUM;" after Kismet has closed it.

This endpoint is only available when the kismetdb log is enabled.

ROLES
admin
ADDED
API added 2026-11
URI
/logging/kismetdb/data/delete.cmd
METHODS
POST
JSON
PARAMETERS

This endpoint takes additional parameters by using a `POST` request and supplying a JSON document or json form variable.

You can find more information about API parameters here.

tag string OPTIONAL

Only records with this tag

ids list OPTIONAL

Only records with these record ids; a list of 1 to 1000 ids

ts_start number OPTIONAL

Only records at or after this time, in seconds

ts_end number OPTIONAL

Only records at or before this time, in seconds

all boolean OPTIONAL

true to delete every tagged record

RETURN

JSON object:

FieldContent
oktrue
deletedNumber of records deleted
RESPONSES
200
Success
400
No options given, or an invalid option; the JSON error response describes the problem
401
Not logged in as an admin
500
The log could not be changed