Binom Documentation

К навигации

API

Often you need to get data from your tracker for additional scripts, services, automation. For this we implemented API that displays any data from tracker in a convenient JSON format. Functions for processing this format are in any common programming language.

Working with API in our tracker is simple. First go to the Settings (top menu on the right). At the bottom of the page find API and copy the &api_key=XXXXXXXXXXXXX parameter.

Then go to any report (for campaigns or landas), add this parameter to the URL and load this URL. You will see all the same data as in the report, but in JSON format.

Reports for campaigns, lands, offers and sources

For example, we need to get information about our campaigns. Let’s open Campaigns page and display the Test group's campaigns with traffic for last 7 days.

Then add to the URL our api_key - &api_key=1000001a768088356b266709102e84d50bcf4c6 and will see following data:
[{
"id":"10",
"status":"1",
"name":"Test Camp",
"date_cr":"1458474310",
"keyword":"676zlthzbiagiyetab8v",
"group_id":"2",
"group_name":"Test",
"ts":"Test",
"ts_id":"2",
"start_date":"1458470766",
"clicks":"2038",
"bots":0,
"profit":"-11.28000",
"ROI":"-55.348380765",
"LP_CTR":"0.0000",
"leads":"92",
"CR":"4.5142",
"EPC":"0.004465161",
"CPC":"0.010000000",
"rev":"9.10000",
"spend":"20.38000",
"lp_cl":"0",
"off_cl":0,
"note":0,
"current_cpc":"0.01000",
"auto_cpc":0,
"link":"http:\/\/\/tracker.com\/click.php?camp_id=10&key=676zlthzbiagiyetab8v&creative={creative}"
}]

In general, most of the parameters have clear meaning. But, just in case, we will analyze them all.

Parameter Description
idCampaign id
statusСampaign status: 1 - active, 0 - in the archive (deleted)
nameCampaign name
date_crCampaign creation timestamp
keywordCampaign key, same as in Tracking URL
group_idGroup Id
group_nameGroup name
tsTraffic source
ts_idSource Id /td>
start_dateTimestamp of the first click in the campaign
clicksNumber of clicks for the selected period
botsNumber of bots (for future functionality)
profitCampaign profit for selected period
ROIROI
LP_CTRLP CTR = LP Clicks / Click * 100%
leadsNumber of conversions
CRCR (Conversion Rate) = Leads / Clicks * 100%
EPCAverage Revenue per click = Revenue / Clicks
CPCAverage cost per click for the selected period = Spend / Clicks
revIncome (Revenue)
spendCost
lp_clAmount of clicks on land (LP Clicks)
off_cl??
noteCampaign notes
current_cpcCurrent CPC
auto_cpc1 - if auto CPC is set in the campaign, otherwise 0
linkTracking URL of compaign
You can change the URL parameters at the API request. Let’s analyze these parameters.
Parameter Description
orderColumn number for sorting (API function output goes in sorted form). For example: &order=2 - sort by name, &order=6 - by clicks, &order=14 - by ROI
typeASC - sort ascending, DESC - sort descending
search_nameApply a search by the Name column in report
statusFilter by active, deleted and campaigns with traffic for the selected period. all - all campaigns, wt - with traffic, on - active, off - deleted
groupFilter by group of campaigns, &group=Group_ID. &group=all - all groups
traffic_sourceFilter by traffic source, &traffic_source=TS_ID. &traffic_source=all - all sources
dateTime period
1 - today
2 - yesterday
3 - last 7 days
4 - last 14 days
5 - current month
6 - last month
7 - current year
8 - last year
9 - for all time
11 - current week
10 - custom time with additional requests of the form &date_s=2016-07-31+%7C+02%3A00&date_e=2016-07-31+%7C+02%3A00, value format: [YYYY]-[MM]-[DD]+%7C+[HH]%3A[MM]
12 - custom date with an additional query, form &date_s=2016-07-05&date_e=2016-07-06, value format [YYYY]-[MM]-[DD]

This API function changes in 1.9.
The changes concern names of columns and some filters.

≤1.8 1.9≤
date_ct create_date
ts ts_name
LP_CTR lp_ctr
CR cr
EPC epc
CPC cpc
rev revenue
spend cost
lp_cl landing_clicks
off_cl offer_clicks
note is_note
link url
Parameter ≤1.8 Parameter 1.9≤ Description
order order_name Column name for sorting. For example: &order_name=clicks - sorting by clicks
type order_type ASC - ascending sorting, DESC - descendingly sorting

Campaign report

For example, let’s display a report for our test campaign, according to the landings.

By adding the &api_key parameter to the URL, we will get the following data:
[{
"Level":"1",
"Name":"test123321",
"Clicks":"2,038",
"LP Clicks":"0",
"LP CTR":"0.00%",
"Leads":"92",
"CR":"4.51%",
"EPC":"0.0045",
"CPC":"0.0100",
"Revenue":"9.10",
"Spend":"20.38",
"Profit":"-11.28",
"ROI":"-55.35%"
}]

Each parameter except Level clearly corresponds to the report column, as well as the output. There are separators between digits of numbers and % of numbers. Level - is the level of the row in the multi-level report.

Just like in the campaign report, you can change the URL parameters.

Parameter Description
camp_idId of the campaigns on which the report is built
&val_page=allAdd to your URL if you want to get the results of all report pages
group1
group2
group3
Accordingly, first, second and third grouping of the report. If you want a single-level report, you may not use the other parameters.
2 - grouping by paths
3 - by offers
4 - by lands
5 - by rules
6 - ISP / Carrier
30 - Connection type
7 - IP
8 - IP-range 1.2.3.xxx
9 - IP-range 1.2.xxx.xxx
10 - Device type
29 - Device name
11 - Device brand
12 - Device model
13 - Screen Resolution
14 - Connection speed
15 - Browser name
16 - Browser with version
17 - OS
18 - OS with version
19 - Country
21 - Language
22 - Affiliate network
24 - Referral Domain
23 - Referral URL
25 - Day of the week
26 - Hour of the day
31 - Group by days
27 - Grouping by the first token
282, 283 .. 290 - Grouping by 2-10 tokens
dateTime interval
1 - today
2 - yesterday
3 - last 7 days
4 - last 14 days
5 - current month
6 - last month
7 - current year
8 - last year
9 - for all time
11 - current week
10 - custom time with additional requests of the form &date_s=2016-07-31+%7C+02%3A00&date_e=2016-07-31+%7C+02%3A00, value format: [YYYY]-[MM]-[DD]+%7C+[HH]%3A[MM]
12 - custom date with an additional query, form &date_s=2016-07-05&date_e=2016-07-06, value format [YYYY]-[MM]-[DD]

This API function changes in 1.9.


All columns' names shifted to lowercase, whitespaces replaced by underscore and other.

[{
"level":"1",
"name":"test123321",
"clicks":"2,038",
"offer_clicks":"0",
"lp_ctr":"0.00%",
"leads":"92",
"cr":"4.51%",
"epc":"0.0045",
"cpc":"0.0100",
"revenue":"9.10",
"cost":"20.38",
"profit":"-11.28",
"roi":"-55.35%"
}]

FILTERS APPLICATION

Our tracker allows you to apply saved filters for reports. For example, you can get a ready-made blacklist for your campaign. To do this, create and save a filter on the report page of any campaign - it will appear in the list of saved filters. Next to his name will be a digit. Remember it.

Add the &fid=N parameter, where N is the filter number in your API URL for the campaign statistics and you will receive a filtered report.

Update costs

The tracker allows you to change the cost of your traffic through API. To do this, use the following URL:
http://track_domain.com/?page=save_update_costs&camp_id=1&type=1&date=1&timezone=3&token_id=1&token_val=100&value=55&api_key=123456789vf8fhj

Parameter Description Example
camp_idCompaigns ID on which the report is built23
type1 - Cost (full cost), 2 - CPC (cost per click)1.5
date Time interval
1 - today
2 - yesterday
3 - last 7 days
4 - last 14 days
5 - current month
6 - last month
7 - current year
8 - last year
9 - for all time
11 - current week
12 - custom date
1
date_s or date_eStart and end date (при &date=12). Format of the values [YYYY]-[MM]-[DD]&date_s=2016-08-01&date_e=2016-08-02
timezoneThe time zone of the traffic source. If it is different from the tracker’s, the update of costs will occur with an offset. The value is from -12 to 12.-2
token_idNumber of the token if you want to update costs based on a certain value of the token (for example, by publishers) 2
token_valValue of the tokenpubdomain.com
valueNew cost of the click, or total cost of the traffic per period (depending on the type of update)23.5

This API function changes in 1.9.
http://track_domain.com/?page=save_update_costs&camp_id=1&date=1&timezone=3&token_number=1&token_value=100&cpc=0.005&api_key=123456789vf8fhj

Parameter Description Example
camp_idCompaigns ID on which the report is built23
date Time interval
1 - today
2 - yesterday
3 - last 7 days
4 - last 14 days
5 - current month
6 - last month
7 - current year
8 - last year
9 - for all time
11 - current week
12 - custom date
1
date_s or date_eStart and end date (при &date=12). Format of the values [YYYY]-[MM]-[DD]&date_s=2016-08-01&date_e=2016-08-02
timezoneThe time zone of the traffic source. If it is different from the tracker’s, the update of costs will occur with an offset. The value is from -12 to 12.-2
token_numberNumber of the token if you want to update costs based on a certain value of the token (for example, by publishers) 2
token_valueValue of the tokenpubdomain.com
cost or cpcNew cost of the click, or total cost of the traffic per period (depending on the type of update)23.5

Add, change, delete, restore list of offers and landings

Tracker allows you to add, modify, delete and restore deleted offers and landings. All requests in API for creating / deleting offers go through the index.php file in the root folder of the tracker: http://tracker.com/index.php

Requests can be sent either through GET or via POST. In order to access functionality, you must pass parameter api_key in request to index.php with the value of the API key, which you can get in the tracker settings.

To determine the action, you must pass the parameter action.
Аction is composed like this - [manipulation object]_[action].
There are two objects - offer and landing
List of possible actions: get, getall, delete, restore, add, edit

ACTIONS AND PARAMETERS

Action Description Mandatory parameters
offer_getGain information about offerid
offer_getallGain list of offerswithout parameters
offer_deleteOffer deleteid
offer_restoreRestore deleted offerid
offer_editEdit offerid
offer_addCreate new offerMandatory parameters: name, url, payout. If auto_payout parameter is specified, you don't have to use payout
landing_getGain information about the Landing id
landing_getallGain list of landingsБез параметров
landing_deleteLand deleteid
landing_restoreRestore deleted landid
landing_editEdit landid
landing_addCreate new landname, url
source_getallGain list of traffic sourceswithout parameters

PARAMETERS FOR WORK WITH OFFER

Parameter Description Example
name Offer Name MyOfferName
url Offers URL (with tokens) http://offer.com/?a=19892&c=1232&s2={clickid}
network Affiliate network's ID (see Aff Networks for details) 3
payout Payout, if auto, than don't have to specify 1.2
status 0 - Offer deleted, 1 - Active 1
geo Country (abbreviated) US, RU, FR, UK
group_of Id of offer's group 2
auto_payout 1 - if auto, 0 - if not 0
upsell 1 - if Upsell enabled for offer, 0 - if not 0

PARAMETERS FOR WORKING WITH LANDING

Parameter Description Example
name Land's name MyLanderName
url Land's URL (with tokens) http://lander.com/1/index.php?device_name={device_name}
status 0 - deleted land, 1 - active 1
lang Language (abbreviated as in the tracker) EN, RU, AR, ES
group_lp Id of the land's group 23
offers Amount of offers on land (multi-offers) 1

EXAMPLES

Script:
$.ajax({
type:"post",
url:"http://tracker.com/index.php",
data: {
"api_key" : "12345678qwertyu",
"action" : "offer_edit",
"id" : "10",
"name" : "BornByBinomAPI"
}
});
Will change the name of the 10th offer to BornByBinomAPI

EXECUTE RESULTS

If change was successful, server sends json with the status parameter: added, edited, restored
So the answer to the example above is {"status":"edited"}
If any errors occur, json returns with the "error" parameter, for example:
Response to an attempt to restore (offer_resore) for non-existent offer will be {"error":"Object not found"}

Want to help us improve this documentation page? Create a pull request