Comparative statistics

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:
  • link_id - Link ID
  • clicker_id - Clicker ID
  • sub_id - Sub ID
  • sub_id1 - Sub ID 1
  • sub_id2 - Sub ID 2
  • sub_id3 - Sub ID 3
  • ipv4 - IP v4
  • ipv6 - IP v6
  • ip_network1 - IP subnet, level 1
  • ip_network2 - IP subnet, level 2
  • proxy_type - Proxy type
  • ua - User agent
  • referer - Full click source
  • referer_domain - Domain of a click source
  • referer_name - Name of a well-known click source
  • cc - Country ISO code
  • country - Country
  • region - Region of a country
  • city - City
  • device - Device type
  • brand - Device Brand
  • model - Device Model
  • os - OS
  • os_ver - OS version
  • browser - Browser
  • browser_ver - Browser version
  • browser_type - Browser type
  • lang - The main language of the device
  • lang_full - Full device language
  • is_bot - The click was made by a bot
  • isp - Internet service provider
  • adblock - Ad blocker enabled

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."
        ]
    }
}