This part of the API can be used to access statistics about the leads in your account. The data is analogous to that shown on statistics pages of the LeadConduit Classic web UI. The "full access" API key is required for all statistics API calls (see the overview for more about API keys).
An Important Note
This API is not designed to be polled frequently, so please exhibit responsible behavior when calling the API in a loop. A good rule of thumb: if you're polling for changes, limit your calls to once or twice per day. Evening and overnight hours are better than mid-day. If you make multiple simultaneous API requests (e.g., with multiple threads), the number of concurrent calls should not exceed three.
Different resource URLs are available for easy access to statistics for different time periods. The results of each call can be filtered with additional parameters; see below.
GET https://api.leadconduit.com/stats/financial/today GET https://api.leadconduit.com/stats/financial/yesterday GET https://api.leadconduit.com/stats/financial/last_7_days GET https://api.leadconduit.com/stats/financial/last_30_days GET https://api.leadconduit.com/stats/financial/this_month GET https://api.leadconduit.com/stats/financial/last_month GET https://api.leadconduit.com/stats/financial/YYYY GET https://api.leadconduit.com/stats/financial/YYYY/MM GET https://api.leadconduit.com/stats/financial/YYYY/MM/DD GET https://api.leadconduit.com/stats/financial/all
The following optional parameters may be used to filter the results (see the Common Parameters page for more information):
campaign_id— the campaign to request statistics for
source_id— the ID of the source account or site to get statistics for
recipient_id— the ID of the recipient to get statistics for
profile_id— the ID of the lead profile to retrieve
start— can only be used on the
end— can only be used on the
daily— for periods spanning multiple days, set to "true" to break out data by day
verbose— (“false” or “true”, default is “false”). Set to “true” to return statistics results even if there is no lead flow. Setting this parameter to “true” can cause a very large result set to be returned from the API. Omitting the
verboseparameter will cause statistics to be returned with 0 (zero) in the total column.
prices— (“all” or “all_rolled_up”, default is "all"). By default (“all”), a new statistics row will be shown for each unique combination of purchase price and sale price. For example, if you lower the payout for one of your lead sources, you will see two rows in the financial results: one for all the leads purchased at the higher price, and one for leads purchased at the lower price. Setting this parameter to “all_rolled_up” will cause one row to be returned. The purchase_price column and the sale_price columns will display the range of prices collected.
owned_only(optional, "false" or "true", default is "false"). Set to "true" to return statistics only for campaigns which you own, excluding data for campaigns that are owned by another account but which have been shared to you.
All calls return a JSON hash containing two elements:
- count — tells you how many statistics records returned by the call
- items — the statistics records returned:
- campaign_id — the ID of the campaign
- campaign — the name of the campaign
- source_id — the ID of the leads' source account or site (affiliate)
- source — the leads' source account or site (affiliate) name
- recipient_id — the ID of the lead recipient (advertiser)
- recipient — the lead recipient (advertiser) name
- purchase_price — cost per lead in USD
- sale_price — revenue per lead in USD
- total — number of good and bad leads provided by the source and sent to the recipient at the purchase and sale prices
- billable — number of billable leads provided by the source and sent to the recipient at the purchase and sale prices. Only "good" leads are billable.
- non_billable — number of non-billable leads provided by the source and sent to the recipient at the purchase and sale prices. "Bad" leads are not billable. This column represents the sum of the invalid, rejected, and returned columns.
- invalid — number of leads marked bad by LeadConduit due to campaign constraints.
- rejected — number of leads marked bad by the recipient during lead delivery.
- returned — number of leads which were accepted by the recipient, but later returned.
- cost — total cost for the billable leads in USD (purchase_price multiplied by billable)
- revenue — total revenue for billable leads in USD (sale_price multiplied by billable)
- profit — total profit for billable leads in USD (revenue minus cost)
Each hash can be considered a "row" as you might think of a record in a database. Each hash has a unique combination of the following columns: campaign_id, source_id, recipient_id, purchase_price, sale_price. That is to say, if the lead pricing changes you will see two hashes with the same campaign, source and recipient, but with different pricing. This feature makes it possible for you to understand how many leads were purchased from whom, and sold to whom at what pricing levels.
A sample request: