URL for a request
Method
GET
Incoming Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_token | string | Yes | API token for access |
| period1_from | string | Yes | Period from [Y-m-d] |
| period1_to | string | Yes | Period to [Y-m-d] |
| period2_from | string | Yes | Comparative period from [Y-m-d] |
| period2_to | string | Yes | Comparative period to [Y-m-d] |
| group | string | Yes | By which field to group. Possible options:
The fields can be comma-separated. For example: os, os_ver |
| links | array | No | Array of link IDs |
| limit | int | No | Number of records to output. By default - 100. From 1 to 10000. |
Return values
The server returns a response in JSON format. The list of parameters depends on the server response code:
Request example
curl 'https://firelinks.cc/api/out/stat/compare?api_token=W9DtD7JtyHI7nPj8eEWul2pVkcobE62IHaHi3n8ClQdogBGZe6n70fIgTH3u&period1_from=2022-08-01&period1_to=2022-08-15&period2_from=2022-08-15&period2_to=2022-08-31&group=country'
Response example 200
{
"success": true,
"data": {
"totals": {
"total": 330,
"total_period_1": 330,
"total_period_2": 330
},
"0": {
"group": "France",
"period_1_hits": 278,
"period_1_quality": 3,
"period_1_clicks": 2,
"period_1_out": 278,
"period_1_mobile": 278,
"period_1_bots": 0,
"period_2_hits": 278,
"period_2_quality": 3,
"period_2_clicks": 2,
"period_2_out": 278,
"period_2_mobile": 278,
"period_2_bots": 0,
"total_period_1_percent": 84,
"total_period_2_percent": 84,
"total_period_1_mobile_percent": 100,
"total_period_2_mobile_percent": 100
},
"1": {
"group": "Poland",
"period_1_hits": 50,
"period_1_quality": 3,
"period_1_clicks": 1,
"period_1_out": 50,
"period_1_mobile": 50,
"period_1_bots": 0,
"period_2_hits": 50,
"period_2_quality": 3,
"period_2_clicks": 1,
"period_2_out": 50,
"period_2_mobile": 50,
"period_2_bots": 0,
"total_period_1_percent": 15,
"total_period_2_percent": 15,
"total_period_1_mobile_percent": 100,
"total_period_2_mobile_percent": 100
}
}
}
Response example 422
{
"success": false,
"errors": "Validation errors",
"data": {
"period1_from": [
"The date from field is not a date."
]
}
}