The FlowTraq Web API provides a RESTful interface for for retrieving NetFlow data from a FlowTraq Server in JSON format for use by third-party applications. This API defines two methods of retrieving data:

An API authentication token is required for all requests. Authentication tokens must be generated for each client through the FlowTraq command line tools. To request the token, send an HTTP request such as:

POST https://example.com/flowtraq/api/v1/auth

Parameter NameValueDefault ValueNotes
serverstring"localhost"The FlowTraq server address.
portnumber9640The FlowTraq server port.
usernamestring required Username of a user on the Flowtraq server.
passwordstring required Password of the Flowtraq server user.

The response will contain either the resulting auth token or an error message:

Parameter NameValueNotes
auth_tokenstringOnly returned if authentication successful.
errorstringOnly returned if authentication failed.

Various FlowTraq view combinations may be retrieved via the API by sending requests to:

GET https://example.com/flowtraq/api/v1/stat

Parameter NameValueDefault ValueNotes
serverstring"localhost"The FlowTraq server address.
portnumber9640The FlowTraq server port.
auth_tokenstring required A recently acquired authentication token from an authentication request.
group_bystring"IP"A rank entity as described in Retrieving Statistical Queries from the Command Line.
count_bystring"BYTES"A rank field as described in Retrieving Statistical Queries from the Command Line. Use a space to separate the token "unique".
directionstring none Possible values: "snd", "rcv".
before_timetimestamp none A timestamp in the format "MM/DD/YY hh:mm:ss.microsec".
after_timetimestamp none A timestamp in the format "MM/DD/YY hh:mm:ss.microsec".
time_rangestring-15mA time specifier as described in Time Navigation.
querystring none A filter string as described in Filter String Syntax.
rowsnumber10The maximum number or rows to return.

The response will contain either the resulting data table or an error message:

Parameter NameValueNotes
columns[string]An array of column names.
data[[string]]An array of rows, one rank entity per row. Values in each row correspond to the column names in the columns field.
errorstringOnly returned if the request failed.