API Documentation
CPAlead offers various API services for pulling offers, fetching offers for specific users, conversion polling, and reversal data.
JSON Offers API
Pulls a list of available offers with JSON return format. List is returned sorted by offer ranking.
Endpoint:
https://cpalead.com/dashboard/reports/campaign_json.php?id={Your_Publisher_ID}
Available HTTP query parameters:
HTTP Parameter | Description |
---|---|
format |
JSON or JSONP format. |
country |
Only show offers from country, pass two letter ISO country code. |
show |
Limit amount of offers returned to X number. Can improve API speeds. |
offer_type |
By default, this API shows all available offer types, use this field to filter certain offer types. Available offer types: email_submit, pin_submit, mobile, trial, purchase, download. offer_type may also be a comma-delimited list of offer types, e.x. &offer_type=email_submit,pin_submit,app_install |
dating |
Boolean (true|false), By default, this API will not return Dating offers, use this field to enable showing dating offers. |
offerwall_offers |
Boolean (true|false), By default, this API will not return "Offerwall Only" offers, use this field to enable showing all offers, including available only for offerwalls. Only offerwalls traffic is accepted. |
device |
Use this only if you're NOT using the UA targeting parameter. By default, the API will show all available device types if you're not targeting by UA. Use this field to only display certain device types. Available offer types: ios, android, and desktop. Device may also be a comma-delimited list of offer types. Example: &device=ios,android,desktop For getting only CPI / CPE offers (which requires only installation for conversion - use: device=ios,android |
subid |
SubID tracking allows you to send extra data when a user clicks on your affiliate links by passing a tag at the end of your affiliate links, this parameter will automatically fill in the subid in your tracking link. |
subid2 |
A second subid variable for extra data. |
subid3 |
A third subid variable for extra data. |
gaid |
If you have a Google Advertising ID (GAID) for mobile, use this variable to automatically fill in the gaid on your tracking link. |
idfa |
If you have a Apple Identifier For Advertisers (IDFA) for mobile, use this variable to automatically fill in the idfa on your tracking link. |
Available targeting parameters, useful mostly for JSONP polling when needing to pull offers client-side for a specific user rather then pulling all offers.
HTTP Parameter | Description |
---|---|
callback |
JSONP callback function name. Only used for JSONP format. If using jQuery getJSON, use callback=? and jQuery will automatically fill function name in for you. See JSONP example. |
subid |
Enable subid tracking and pass your users subid, variable will be available for postback. |
geoip |
Geo target offers based on your users IP address, use a value of "user" to use the IP address of the client calling this script, this is useful for JSONP calls. |
ua |
Pass us your visitor's Useragent and we will detect if they are using an Android phone, iOS phone, or desktop device and we will display offers for that device only. Pass "user" to use the Useragent of the client calling this script, this is useful for JSONP calls. |
Return Data Example
JSONP Example
RSS and CSV APIs will be deprecated as of Jan. 2019. Please update your APIs to use our JSON Offers API.
Conversion API
Conversion API allows you to ping CPAlead to test for conversions, useful for making custom apps. Pass subid in as a subid or ip address, or "user" to have our system use the ip address of the client calling this script (useful for JSONP calls).
For push-type conversion service (Server-to-Server Postback), see our Postback Documentation.
Endpoint:
https://cpalead.com/dashboard/reports/conversion_api.php?id={Your_Publisher_ID}
Available HTTP query parameters:
HTTP Parameter | Description |
---|---|
subid |
Required. Lookup conversion based on subid, pass subid or users ip address, pass "user" to use the ip address of the client calling this script (useful for JSONP calls). |
campid |
Optional. Will check for conversion only for this campaign id. |
format |
JSON or JSONP format. |
callback |
JSONP callback function name. Only used for JSONP format. If using jQuery getJSON, use callback=? and jQuery will automatically fill function name in for you. |
Return Data Example
Reversal / Bad Lead API
Use this API to download your list of bad leads between two dates. Useful for sorting out bad traffic.
Endpoint:
https://cpalead.com/dashboard/reports/badleads_api.php?id={Your_Publisher_ID}&key={Your_Secret_Key}
Your Secret Key:
Login to your account to retrieve your secret key.
Available HTTP query parameters:
HTTP Parameter | Description |
---|---|
format |
JSON or JSONP format. |
date_start |
Starting date to use when pulling bad leads. Format: yyyy-mm-dd |
date_end |
End date to use when pulling bad leads. A maximum of one month can be pulled at a time. |
Return Data Example