API: What data can be obtained and how
Tatiana
Last Update il y a un an
Authorisation
To use the API for the first time, you will need to obtain a Bearer token. This token has no expiry date. Keep the token secure.
There is a maximum of 3 requests per second.
Use value of id_token in your next request
200 Successful
401 Authorization
404 Not found
429 Too Many Requests
500 Server error
Get statistics
The method returns data on offers and traffic sources only on revshare and hybrid deals (GET method).
You can get the daily approximate earnings by traffic sorts for the day or selected period. Earnings here have not yet been reconciled and are not finalised. Maximum 3 requests per second.
The trafficSourceUrl and trafficSourceDomain fields has been added to the response body. They are filled in if trafficSourceUrl and trafficSourceDomain are entered in the personal cabinet. The date can be obtained for any period.
Query parameters
dateFrom YYYY-MM-DD For example, 2023-01-30
dateTo YYYY-MM-DD For example, 2023-01-30
Currency XXX For example, USD
groupBy M or D 'М' - month or 'D' – day
sources yes or no Displays the value of the traffic source field
withFullSources yes or no Adds the URL and domain to the traffic sourceHeaders
Authorization id_token {Bearer token – common for both methods, taken from the authorisation api}
Content-Type application/json
The method has four mandatory parameters: dateFrom, dateTo, currency, groupBy. Without them, 400 will be returned.
NB: we recommend not request data for a period of more than a month with gropby D.
dateFrom (string): The start date of the period, e.g., ‘2022-01-01’.
dateTo (string): The end date of the period, e.g. ‘2022-05-07’.
currency (string): The currency in which the financials are presented, e.g. ‘USD’.
group (string): Grouping by month (‘M’) or day (‘D’).
total (object): Object containing the total statistics for the entire period.
registrations (integer): The number of registrations.
clicks (integer): The number of clicks.
ndc (integer): New deposits.
netRevenue (float): Net revenue.
purchaseAmount (float): Amount of deposits
dates (array): An array of objects containing date statistics
earnings (float): Earnings (publisher_revenue).
date (string): The date, e.g. ‘2022-05-31’.
affiliates (array): An array of objects containing information about publishers.
project (string): The name of the programme, e.g. ‘program_name [NO REGS]’.
publisher (string): The publisher, e.g. ‘publisher_name’.
source(string): the name of the source of traffic from the LC, e.g. ‘https://xxx’ or traffic_source_name.
trafficSourceUrl (string): a link to the traffic source, e.g. ‘https://Traffic-source-url.com/213’,
trafficSourceDomain (string) the domain of the traffic source, e.g. ‘Traffic_source_domain.com’.
affiliate (string): account - the name on the side of Revenuelab, e.g. ‘IE’.
brands (array): An array of objects containing information about brands.
brand (string): The name of the brand, e.g. ‘bet’.
Get earnings
The method returns earnings data for the month by traffic source (Post method) for Revshare and for CPA earnings.
This methos is suitable to find out the reconciled earnings with adjustments for a pay period. Maximum 3 queries per second. Fiat and USDT exchange rates are up to date throughout the day, BTC exchange rate is up to date within a minute.
header ‘accept: application/json’\.
header ‘Content-Type: application/json’ \
header ‘Authorisation: {Bearer token - common for both methods, taken from the authorisation api}
startOfPeriod – The field is filled with the start date of the month;
endOfPeriod – The field is filled with the end-of-month date;
isShowZero – The field is filled in as true if it is necessary to get data on zero earnings, otherwise it is false;
selectedCurrencies – The field is filled with earnings statuses (EUR, USD, etc.);
selectedModels – The field is filled with payment models: CPA, REV_SHARE or HYBRID, if you specify one of the options, only earnings with the specified payment model will be returned;
selectedDomains – Поле заполняется названиями traffic_source (Name в личном кабинете);
selectedTrafficNames – The field is filled with the names of traffic_source (Name in personal account);
totalsCurrency – The field is filled with the currency in which the sums of earnings in the totals block should be received (EUR, USD, etc. Full list in the article section Additional information);
selectedOffers – The field is filled with the names of offers (brands), when selected, only earnings on the specified offers will be returned;
responseCurrency – The field is filled with the currency in which the earnings on the offers in the resulEarning fields, etc. should come, the full list of fields in the Additional Information section.
There are no mandatory parameters in the method. If you make a query without them, all non-zero earnings for the whole time will be returned for all offers.
Periods are specified by calendar months, for example, the start – 2024-06-01, and the end – 2024-06-30.
By default, non-zero earnings are returned (isSHowZero:false).
In the fields except isShowZero, endOfPeriod, startOfPeriod, totalsCurrency, responseCurrency you can specify several parameters. If 1 element is passed, then only records on it are returned. If 2 or more items are passed, then records containing any of the passed items are returned.
If there were no adjustments on earnings, empty blocks "adjustmentDetails": ‘’ and "adjustmentFormula": “” will return. There will be 0 in the adjustment":0 field.
If there were adjustments for earnings, these fields are filled with the appropriate values. The reason field displays the ID of the reason for the adjustment from the system. You can specify it on your account.
1. totalsCurrency field has been added added to the earnings query to select the currency of totals in the response.
By default, totals come in Euros. When sending a different currency, totals will be recalculated based on RevenueLab rates and will come in the requested currency.
For example: if you send “totalsCurrency”:”USD”, the totals block will be changed and rates block will be added in the body of the response, example of a new totals response:
“Rates” contains the currencies in which the earnings were made in the first place and the rate at which those currencies were converted to the requested currency.
The field is optional. If you fill it with 1 or more offers' names, the answer will return earnings only for these offers. The totals will be calculated by the selected offers as well.
For example: if you send ‘selectedOffers’:[‘offer_name_1’, ‘offer_name_2’], the response will return earnings only for ‘brandName’: ‘offer_name_1’ and ‘brandName’: ‘offer_name_2’
UPD 27.03.25: responseCurrency
An optional field responseCurrency has been added to the earnings request to select the currency in which earnings for each offer will be sent in the response.
By default, earnings come in the currency of the affiliate program (currency field). Fill the new field with the code of the currency that is available in Revenuelab to get earnings recalculated at the internal rate in the old fields.
"publisherEarning": 104, || earnings for the offer before adjustments and carriovers;
"netRevenue": 358.94, || total earnings on the offer before adjustments and carriovers;
"originalNetRevenue": 358.94, || заработок общий по офферу в оригинальной валюте;
"inboundCarryover": 0, || inbound carriover of the offer;
"outboundCarryover": 0, || outbound curiover of the offer;
"adjustment": 0, || amount of adjustments for the offer;
"resultEarning": 104.00, || total earnings on the offer, taking into account adjustments and carriovers;
"leftToPay": 0, || the balance of earnings available for payment;
"paidAmount": 104.00, || paid part of earnings;
"threshold": 0, || trachhold on offer.
The rates block will be returned in the response after the totals block, which contains the currency rates used to convert earnings. For example, when requesting responseCurrency: ‘EUR’, if the offenders' earnings were in USD and EUR, the rates block will be returned:
Additional information
In the statistics the data in the To be paid and Paid business statuses (selectedBusinessStatuses field) are reconciled.
The purchaseAmount field in the statistics contains information on the amount of the deposit on the offer.
List of currency codes processed by the system in the earnings:
EUR, USD, RUB, BTC, GBP, JPY, NOK, SEK, TRY, AUD, CNY, ZAR, NZD, PLN, UAH, THB, RON, BYN, KZT, CZK, BRL.
4. To see the earnings of a particular offer in any currency, you need to pass the ‘selectedOffers’ field, specifying 1 or more offers ‘selectedOffers’ : [‘offer_name’] and the field ‘totalsCurrency’ : ‘USD’. In this case, only the earnings on the transferred offer will return. in the block ‘totals’ calculated earnings on this offer will return, recalculated at the system exchange rate in USD.
Message to your manager if you have any questions or suggestions for functionality development!
Yours RevenueLab <3
