Skip to main content

WhaTap Open API v2 (2.0)

Open API v2

Retrieves APM statistics data for a project. Returns transaction, SQL, HTTP external call, Exception, and Client IP statistics aggregated by service within the specified time range.

Base URL

  • SaaS: https://api.whatap.io
  • Self-hosted: Depends on your deployment environment (e.g., https://{your-domain})

Authentication

All requests require the following headers.

Header Type Description
x-whatap-token string Project API token
x-whatap-pcode string Project code

Statistics Types

Type Description Filter Support
transaction Transaction (service) statistics -
sql SQL execution statistics -
httpc HTTP external call statistics host, port
error Exception statistics -
remote Client IP statistics -

Default Sort Order

If order is omitted, results are sorted in descending order by the following column for each type.

Type Default Sort
transaction timeSum
sql timeAvg
httpc timeSum
error count
remote count

Limitations

Item Value Description
Maximum time range 24 hours etime - stime cannot exceed 86,400,000ms.
Maximum records 10,000 Default value for the server setting open_api_max_records. When exceeded, check total > retrievedTotal.

Notes

  • Hash fields are signed integers and can be negative.
  • Statistics are aggregated from 5-minute cube data. The server internally aligns time boundaries.
  • If etime exceeds the current server time, it is automatically adjusted to the current time. The actual query range may be narrower than requested.
  • If total is greater than retrievedTotal, results have been truncated due to the maximum record limit. Narrow the time range to retrieve all data.
  • Pagination via page number or offset is not supported. Results are returned as a single page up to the maximum record count.

APM Statistics

Get Transaction Statistics

Retrieves transaction records for the specified time range. Aggregated by service (URL pattern).

header Parameters
x-whatap-token
required
string

Project API token

x-whatap-pcode
required
string

Project code

Request Body schema: application/json
required
stime
required
integer <int64>

Query start time. In UNIX epoch time (millisecond).

etime
required
integer <int64>

Query end time. In UNIX epoch time (millisecond). etime - stime cannot exceed 86,400,000ms (24 hours).

order
string

Sort column. If omitted, results are sorted by timeSum in descending order.

Responses

Response Schema: application/json
stime
integer

Query start time (millisecond)

etime
integer

Query end time (millisecond)

timestamp
integer

Server response generation time (millisecond)

Array of objects (TransactionRecord)
total
integer

Total number of records matching the criteria

retrievedTotal
integer

Number of records actually returned

Request samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000
}

Response samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000,
  • "timestamp": 1772591844544,
  • "data": [
    • {
      }
    ],
  • "total": 1210,
  • "retrievedTotal": 1210
}

Get SQL Statistics

Retrieves SQL execution records for the specified time range. Aggregated by SQL statement and DB Connection.

header Parameters
x-whatap-token
required
string

Project API token

x-whatap-pcode
required
string

Project code

Request Body schema: application/json
required
stime
required
integer <int64>

Query start time. In UNIX epoch time (millisecond).

etime
required
integer <int64>

Query end time. In UNIX epoch time (millisecond). etime - stime cannot exceed 86,400,000ms (24 hours).

order
string

Sort column. If omitted, results are sorted by timeAvg in descending order.

Responses

Response Schema: application/json
stime
integer
etime
integer
timestamp
integer
Array of objects (SqlRecord)
total
integer
retrievedTotal
integer

Request samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000
}

Response samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000,
  • "timestamp": 1772591844612,
  • "data": [
    • {
      }
    ],
  • "total": 121,
  • "retrievedTotal": 121
}

Get HTTP External Call Statistics

Retrieves HTTP external call records for the specified time range. Aggregated by URL and host.

The httpc type supports filtering by host and port. If the filter is omitted, all records are returned. When specifying a filter, both host and port must be included.

Note — When a filter is applied, the total field reflects the number of records matching the filter criteria.

header Parameters
x-whatap-token
required
string

Project API token

x-whatap-pcode
required
string

Project code

Request Body schema: application/json
required
stime
required
integer <int64>

Query start time (millisecond)

etime
required
integer <int64>

Query end time (millisecond)

order
string

Sort column. If omitted, results are sorted by timeSum in descending order.

object

Filters by host and port. Both host and port must be specified together.

Responses

Response Schema: application/json
stime
integer
etime
integer
timestamp
integer
Array of objects (HttpcRecord)
total
integer
retrievedTotal
integer

Request samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000,
  • "filter": {
    • "host": "api.example",
    • "port": "443"
    }
}

Response samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000,
  • "timestamp": 1772591844703,
  • "data": [
    • {
      }
    ],
  • "total": 6260,
  • "retrievedTotal": 6260
}

Get Exception Statistics

Retrieves Exception records for the specified time range. Aggregated by Exception class and message.

header Parameters
x-whatap-token
required
string

Project API token

x-whatap-pcode
required
string

Project code

Request Body schema: application/json
required
stime
required
integer <int64>

Query start time (millisecond)

etime
required
integer <int64>

Query end time (millisecond)

order
string

Sort column. If omitted, results are sorted by count in descending order.

Responses

Response Schema: application/json
stime
integer
etime
integer
timestamp
integer
Array of objects (ErrorRecord)
total
integer
retrievedTotal
integer

Request samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000
}

Response samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000,
  • "timestamp": 1772591844811,
  • "data": [
    • {
      }
    ],
  • "total": 1041,
  • "retrievedTotal": 1041
}

Get Client IP Statistics

Retrieves Client IP statistics for the specified time range. Includes GeoIP information.

header Parameters
x-whatap-token
required
string

Project API token

x-whatap-pcode
required
string

Project code

Request Body schema: application/json
required
stime
required
integer <int64>

Query start time (millisecond)

etime
required
integer <int64>

Query end time (millisecond)

order
string

Sort column. If omitted, results are sorted by count in descending order.

Responses

Response Schema: application/json
stime
integer
etime
integer
timestamp
integer
Array of objects (RemoteRecord)
total
integer
retrievedTotal
integer

Request samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000
}

Response samples

Content type
application/json
{
  • "stime": 1771545600000,
  • "etime": 1771545900000,
  • "timestamp": 1772591844850,
  • "data": [
    • {
      }
    ],
  • "total": 4335,
  • "retrievedTotal": 4335
}