1. Home
  2. Gateway
  3. HTTP API
  4. Analytics

Analytics

Get detailed statistics of your account directly through our HTTP API.

Please send your request to the following URL:

https://gateway.sms77.io/api/analytics

Optional parameters

In addition to the data for authentication, the following parameters can be specified:

Parameters description Possible values
start Start date of the statistics in the format YYYY-MM-DD. By default, the date of 30 days ago is set. 2020-01-01
end End date of the statistics. Defaults to the current day. 2020-05-30
label Shows only data of a specific label. all – Shows all data, default.
customer_label1
customer_label2
subaccounts Receive the data only for the main account, all your (sub-)accounts or only for specific subaccounts. only_main – Only data of the main account, default.
all – Data of all accounts
9123456 – Subaccount ID
group_by Defines the grouping of the data. date – default
label
subaccount
country

Response explanation

The results are returned formatted as JSON.

Example 1

Query the statistics of the last 30 days.

Request
https://gateway.sms77.io/api/analytics?p=api-key

Response

[
    {
        "date": "2020-05-13",
        "hlr": 0,
        "inbound": 72,
        "mnp": 0,
        "sms": 145,
        "usage_eur": 0.208,
        "voice": 0
    },
    {
        "date": "2020-05-14",
        "hlr": 0,
        "inbound": 72,
        "mnp": 0,
        "sms": 1,
        "usage_eur": 0.508,
        "voice": 0
    },
    {
        "date": "2020-05-15",
        "hlr": 0,
        "inbound": 72,
        "mnp": 0,
        "sms": 38,
        "usage_eur": 2.908,
        "voice": 0
    },
    {
        "date": "2020-05-16",
        "hlr": 0,
        "inbound": 72,
        "mnp": 0,
        "sms": 2,
        "usage_eur": 0.208,
        "voice": 0
    }
]

Example 2

Query the statistics of 2019, grouped by destination country. The property country presents the ISO 3166-1 alpha-2 code of the respective country. If this code is empty, it is an unidentifiable country.

Request
https://gateway.sms77.io/api/analytics?p=api-key&start=2019-01-01&end=2019-12-31&group_by=country

Response

[
    {
        "country": "DE",
        "inbound": 43744,
        "hlr": 333,
        "mnp": 167,
        "sms": 149046,
        "usage_eur": 11204.0564,
        "voice": 19
    },
    {
        "country": "",
        "inbound": 43744,
        "hlr": 572,
        "mnp": 29,
        "sms": 0,
        "usage_eur": 5.8725,
        "voice": 0
    },
    {
        "country": "LI",
        "inbound": 0,
        "hlr": 6,
        "mnp": 12,
        "sms": 15,
        "usage_eur": 1.331,
        "voice": 0
    },
    {
        "country": "US",
        "inbound": 4,
        "hlr": 2,
        "mnp": 0,
        "sms": 10,
        "usage_eur": 0.8,
        "voice": 0
    },
    {
        "country": "PL",
        "inbound": 8,
        "hlr": 20
        "mnp": 0,
        "sms": 8,
        "usage_eur": 0.6,
        "voice": 0
    }
]