import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
waap_compact_traffic_metrics = client.waap.analytics.get_traffic_filtered(
resolution="daily",
start="2024-04-13T00:00:00+01:00",
)
print(waap_compact_traffic_metrics)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/waap"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapCompactTrafficMetrics, err := client.Waap.Analytics.GetTrafficFiltered(context.TODO(), waap.AnalyticsGetTrafficFilteredParams{
Resolution: waap.AnalyticsGetTrafficFilteredParamsResolutionDaily,
Start: "2024-04-13T00:00:00+01:00",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapCompactTrafficMetrics)
}
curl --request GET \
--url https://api.gcore.com/waap/v1/analytics/traffic-filtered \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/waap/v1/analytics/traffic-filtered', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/waap/v1/analytics/traffic-filtered",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/waap/v1/analytics/traffic-filtered")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/analytics/traffic-filtered")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"timestamp": 123,
"passed": 0,
"blocked": 0,
"monitored": 0,
"allowed": 0
}
]{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"detail": "Auth token is missing or invalid"
}{
"detail": "Permission denied"
}{
"type": "http-not-found",
"title": "Not Found",
"status": 404,
"detail": "The resource is not found"
}{
"type": "request-validation-failed",
"title": "Request validation error.",
"status": 422,
"detail": "One or more fields have validation errors.",
"errors": [
{
"loc": [
"body",
"name"
],
"detail": "Input should be a valid string"
},
{
"loc": [
"body",
"date"
],
"detail": "Field required"
},
{
"loc": [
"query",
"limit"
],
"detail": "Field required"
}
]
}{
"type": "internal-server-error",
"title": "Internal server error.",
"status": 500,
"detail": "An unexpected condition was encountered which prevented the server from fulfilling the request."
}Get filtered traffic data
Retrieves a traffic time series data over a set of domains. The response is suitable for plotting a time series chart. This method allows filtering the traffic data by various criteria.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
waap_compact_traffic_metrics = client.waap.analytics.get_traffic_filtered(
resolution="daily",
start="2024-04-13T00:00:00+01:00",
)
print(waap_compact_traffic_metrics)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/waap"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapCompactTrafficMetrics, err := client.Waap.Analytics.GetTrafficFiltered(context.TODO(), waap.AnalyticsGetTrafficFilteredParams{
Resolution: waap.AnalyticsGetTrafficFilteredParamsResolutionDaily,
Start: "2024-04-13T00:00:00+01:00",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapCompactTrafficMetrics)
}
curl --request GET \
--url https://api.gcore.com/waap/v1/analytics/traffic-filtered \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/waap/v1/analytics/traffic-filtered', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/waap/v1/analytics/traffic-filtered",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/waap/v1/analytics/traffic-filtered")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/analytics/traffic-filtered")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"timestamp": 123,
"passed": 0,
"blocked": 0,
"monitored": 0,
"allowed": 0
}
]{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"detail": "Auth token is missing or invalid"
}{
"detail": "Permission denied"
}{
"type": "http-not-found",
"title": "Not Found",
"status": 404,
"detail": "The resource is not found"
}{
"type": "request-validation-failed",
"title": "Request validation error.",
"status": 422,
"detail": "One or more fields have validation errors.",
"errors": [
{
"loc": [
"body",
"name"
],
"detail": "Input should be a valid string"
},
{
"loc": [
"body",
"date"
],
"detail": "Field required"
},
{
"loc": [
"query",
"limit"
],
"detail": "Field required"
}
]
}{
"type": "internal-server-error",
"title": "Internal server error.",
"status": 500,
"detail": "An unexpected condition was encountered which prevented the server from fulfilling the request."
}Authorizations
Query Parameters
Filter by JA3 TLS client fingerprint. Each value must be exactly 32 hexadecimal characters, mixed case allowed, normalized to lowercase. Supply multiple values to match any of them. Omit the parameter to apply no JA3 filter.
10^[0-9a-fA-F]{32}$["e7d705a3286e19ea42f587b344ee6865"]
Filter by JA4 TLS client fingerprint. When present, the value must match the JA4 form <ja4_a>_<ja4_b>_<ja4_c> (a 10-character prefix and two 12-character hexadecimal hashes, mixed case allowed, normalized to lowercase). Supply multiple values to match any of them. Omit the parameter entirely to apply no JA4 filter.
10^[0-9a-zA-Z]{10}_[0-9a-fA-F]{12}_[0-9a-fA-F]{12}$["t13d3113h2_e8f1e7e78f70_ce5650b735ce"]
Exclude entries whose JA3 TLS client fingerprint matches any of the supplied values. Each value must be exactly 32 hexadecimal characters, mixed case allowed, normalized to lowercase. Supply multiple values to exclude any of them. Omit the parameter to apply no JA3 exclusion.
10^[0-9a-fA-F]{32}$["e7d705a3286e19ea42f587b344ee6865"]
Exclude entries whose JA4 TLS client fingerprint equals any of the supplied values. An item must match the JA4 form <ja4_a>_<ja4_b>_<ja4_c> (a 10-character prefix and two 12-character hexadecimal hashes, mixed case allowed, normalized to lowercase). Omit the parameter to apply no JA4 exclusion.
10^[0-9a-zA-Z]{10}_[0-9a-fA-F]{12}_[0-9a-fA-F]{12}$["t13d3113h2_e8f1e7e78f70_ce5650b735ce"]
Include entries that have any of the given traffic types.
A type of traffic that a request is categorized as.
policy_allowed, policy_blocked, custom_rule_allowed, custom_blocked, legit_requests, sanctioned, dynamic, api, static, ajax, redirects, monitor, err_40x, err_50x, passed_to_origin, timeout, other, ddos, legit, monitored ["api", "ajax"]
Response
Successful Response
Was this page helpful?