Analytics API

This API provides daily requests, bandwidth usage metrics for a specified domain. It helps users monitor and analyze requests, bandwidth consumption to gain insights into network performance.

Prerequisite#

  1. You must have an account on Nitrogen.
  2. Your target domain on which you want to get bandwith or requests, must have been registered on Nitrogen.
  3. You must have a service account configured with Editor access. If not, you can refer this article for the same.

API Request & Response#

Endpoint#

POST https://dash.n7.io/api/v2/sense/metric/bandwidth

or

POST https://dash.n7.io/api/v2/sense/metric/requests

Authorization#

Authorization: Token <api-key-of-service-account>

API Request Payload#

The following is the api request payload.

{
    "domain": "www.example.com",
    "date" : "2024-10-10T00:00:00Z"
}

Example#

curl --request PUT --location 'https://dash.n7.io/api/v2/sense/metric/bandwidth' \
--header 'Authorization: Token <api-key-of-service-account>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "domain": "www.example.com",
    "date": "2024-10-10T00:00:00Z"
}'

or

curl --request PUT --location 'https://dash.n7.io/api/v2/sense/metric/requests' \
--header 'Authorization: Token <api-key-of-service-account>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "domain": "www.example.com",
    "date": "2024-10-10T00:00:00Z"
}'

Request Payload#

  • domain: The domain name for which you want to retrieve requests or bandwidth metrics, e.g., “www.example.com
  • date: The target date in YYYY-MM-DDTHH:MM:SSZ format (UTC) for which the requests or bandwidth data is requested.

Payload Fields#

FieldTypeDefault
domainrequired(none)
daterequired(none)

API Response Object#

The following is the api response

{
    "value": "123123"
}

Response Fields#

  • value : containing requests or bandwidth value for the specified domain and date.