Stat

Pass your token to receive stats:

curl -H "token: your_token" https://api.might.io/stat

After a successful execution of the request you will receive JSON object:

{ "success": true, "values": [ { "campaign": "403" }, { "campaign": "53" } ], "stat": { "rows": 2, "rows_before_limit_at_least": 2, "rows_read": 319 }, "limit": 999.999362, }

Where:

  • values - An object with statistics, where "campaign" indicates a campaign id
  • limit - Remaining query limit
  • stat - Object with statistics
    1. rows - Number of rows selected
    2. rows_before_limit_at_least - Rows before limit
    3. rows_read - Number of lines read. The limit depends on the number of rows and columns read
Request values
Parameter Description Format Default value
date_from date of sampling start YYYY-MM-DD current date
date_to date of sampling end YYYY-MM-DD current date
time_from time of sampling start hh:mm:ss 00:00:00
time_to time of sampling end hh:mm:ss 23:59:59
length sample length read more 25
currency sample currency read more USD
timezone time zone read more Europe/Berlin
segments sample segments, you can forward through "," read more campaign
columns sample columns, you can forward through "," read more -
order your sort read more or read more -
direction sorting direction "asc" or "desc" desc
offset number of lines to skip takes integer positive values or 0 0
filters filtration, read more accepts the filter object -
Filters

Pass JSON object in the filters parameter to filter the data:

[ { "field": "segment name OR column name", "condition": "equall OR more OR more_or_equal OR less OR less_or_equal", "value": "filtering value", }, ... more filters ]

Where:

Selection of campaigns for the current day, where the number of visits > = 10000, object filter is encoded via URL Encode
[ { "field": "visits", "condition": "more_or_equal", "value": "1000", }, ]
curl -H "token: your_token" 'https://api.might.io/stat?filters=%5B%7B%22field%22%3A%22visits%22%2C%22condition%22%3A%22more_or_equal%22%2C%22value%22%3A%221000%22%7D%5D'
Examples

Selection offers and visits,clicks,ctr for the current day

curl -H "token: your_token" 'https://api.might.io/stat?segments=offer&columns=visits,clicks,ctr'
{ "success": true, "values": [ { "ctr": 0, "offer": "google.com", "visits": 1, "ctr": 0 }, { "ctr": 0, "offer": "402", "visits": 1, "ctr": 0 } ], "stat": { "rows": 2, "rows_before_limit_at_least": 2, "rows_read": :8192 }, "limit": 999.967232, }