01 Intro & authentication
API requests go over HTTPS. The function base URL is https://cpaw.cat/api/cpaw/<func>.json. The format extension is mandatory (.json).
Parameters may be passed in GET or POST. The response is always JSON in UTF-8, and the HTTP response status is always 200.
Placeholder parameters are shown in curly braces throughout: {id} — the auth string, {offer} — an offer ID, {network} — a network ID. In real requests do not use the curly braces — only the values themselves.
Authentication
The key is passed in the id parameter as <userid>-<key>:
<userid>— your numeric user ID;<key>— your personal API key.
02 Response format
A successful response has status: ok and the payload in data:
{
"status": "ok",
"data": { "...": "..." }
}
The offers function additionally returns a navigation block nav alongside it — its fields are described in that section. The others return everything at once, with no pagination.
03 Error handling
On error the response has status: error and an error field with the error code:
{
"status": "error",
"error": "auth"
}
Common error codes:
auth— the API key is invalid;ban— the user is banned;access— access to the requested resource is denied;request— malformed request (e.g. the format extension is missing);not-found— the requested object was not found.
Each function may also return its own error codes, described in its section.
Back to contents04 Event types
Event type IDs are used in the requests and responses of the feed and offer functions:
| ID | Event | ID | Event |
|---|---|---|---|
1 | New offer | 9 | Price changed |
2 | Offer disabled | 10 | Payout changed |
3 | Offer enabled | 11 | Upsell changed |
4 | New goal | 12 | Cross-sell changed |
5 | Goal disabled | 13 | Percentage changed |
6 | Goal enabled | 14 | Currency changed |
7 | Type changed | 15 | Offer name changed |
8 | Hold changed | 16 | Goal name changed |
05 feed — Update feed
Returns feed events for the given period. Up to 1000 events per response, sorted newest first (by descending id).
Parameters
| Field | Description |
|---|---|
feed | Feed type: all — every public event; offer — my offers; subs — my subscriptions. Default — my monitoring (my offers + my subscriptions). |
from | Start of range: date YYYY-MM-DD or Unix Timestamp. |
to | End of range: date YYYY-MM-DD or Unix Timestamp. |
after | The ID of the last change after which to start the export. |
search | An offer URL in the affiliate network to search by. |
network | Affiliate network ID. |
offer | Offer ID on the WatchCat side. |
goal | Goal ID on the WatchCat side. |
type | An event type ID. |
after instead of dates. After each pull, save the largest change id (always first in the list) and pass it in after on the next request.Response
The data field is an array of events (the feed is time-ordered). Fields of each event:
| Field | Description |
|---|---|
id | Change ID. |
time | Event time, Unix Timestamp. |
tid | Event type, number. |
nid | Network ID. |
oid | Offer ID. |
gid | Goal ID (0 if the event isn't about a goal). |
date | Event date, YYYY-MM-DD HH:MM:SS. |
type | Event type name. |
network | Network name. |
offer | Offer name. |
goal | Goal name or false. |
value | New value or false. |
old | Old value or false. |
url | Offer URL on WatchCat. |
my | true for a personal offer, false for public. |
{
"status": "ok",
"data": [
{
"id": 35400, "time": 1573291851, "tid": 4,
"nid": 16, "oid": 6113, "gid": 19304,
"date": "2019-11-09 09:30:51", "type": "New goal",
"network": "Admitad", "offer": "Edadeal [CPI, Android] RU",
"goal": "Install on Android",
"value": false, "old": false,
"url": "https://cpaw.cat/offer/6113", "my": false
}
]
}
Back to contents
06 network — Networks list
Lists the networks available to work with. No input parameters. data is an object keyed by network ID; each value has:
| Field | Description |
|---|---|
id | Network ID. |
name | Name. |
domain | The domain used to recognize offer links. |
private | The network is private, VIP-only. Present for VIP users only. |
offer | The network supports adding your own private offers. |
fav | Featured network (shown on the dashboard). |
prio | Sort priority (networks ordered by prio desc, then by name). |
geo | Network geo: { code: name } — the union of the geos of the network's active public offers. Empty ([]) until the network's first crawl. |
auths | The credentials required (only when offer = true): login/pass — account login and password, user — the API user ID, api/key — the public and secret keys. |
subscribed | Whether the current user is subscribed to this network's changes. |
level | Subscription level: 0 — not subscribed, 1 — new offers only, 2 — any changes. |
{
"status": "ok",
"data": {
"2": {
"id": 2, "name": "Admitad", "domain": "www.admitad.com",
"offer": true, "fav": true, "prio": 100,
"geo": { "ru": "Russia", "de": "Germany" },
"auths": [ "user", "key" ],
"subscribed": true, "level": 2
}
}
}
Back to contents
07 offers — Offer list & search
Lists offers: the global catalog, private offers, subscriptions. Search by URL, name, or similar offers.
Parameters
| Field | Description |
|---|---|
filter | my — my offers; public — public; subs — my subscriptions. Default — mine + public. |
like | An offer ID to find similar offers for (by the name's keywords). If set, search is ignored. |
search | An offer name (full-text search) or its URL in the affiliate network. |
geo | Offer geo: one or more two-letter ISO country codes separated by space, dash or comma. |
active | Activity: 0 — disabled, 1 — active. |
network | Network ID. |
show | Offers per page, 10–1000, default 500. |
offset | Start position of the slice (0, 500, 1000, …). |
page | List page when offset is not given (default 1). |
Response
The data field is an object of offers (keyed by offer ID), with a navigation block nav alongside it for pagination:
nav field | Description |
|---|---|
total | total records found |
page | current page |
pages | total pages |
show | records per page |
offset | start position of the slice in the full list |
Offer fields:
| Field | Description |
|---|---|
id | Offer ID. |
active | Offer is active. |
name | Offer name. |
info | Offer URL on WatchCat. |
nid | Network ID. |
network | Network name. |
url | Offer URL in the affiliate network. |
add | Whether the offer can be added as a private one. |
time | Time of the last change, Unix. |
date | Date of the last change. |
first | First time the offer was seen, Unix. |
sub | Whether the user is subscribed to the offer. |
now | Instant notification for the subscription (otherwise it goes to the digest). |
goal | Number of active goals. |
goals | Total goals. |
geo | Offer geo: { code: name }. |
private | false for a public offer, or the private-offer object: period, plus login/pass/user/api/key (decrypted, where present). |
{
"status": "ok",
"data": {
"2861": {
"id": 2861, "active": true, "name": "AB Gymnic belt",
"info": "https://cpaw.cat/offer/2861", "nid": 6, "network": "M1 Shop",
"url": "http://m1-shop.ru/myoffers/add/453", "add": true,
"time": 1571411245, "date": "2019-10-18 15:07:25", "first": 1571411245,
"sub": true, "now": false, "goal": 3, "goals": 5,
"geo": { "ru": "Russia", "ua": "Ukraine" },
"private": false
}
},
"nav": { "total": 100, "page": 1, "pages": 1, "show": 500, "offset": 0 }
}
Back to contents
08 offer — Offer details
Shows everything about a single offer. Locate the offer three ways:
- by
offer— the offer ID on the WatchCat side (the only way for a private offer); - by
url— the offer URL in the affiliate network (public only); - by
network+uid— the network ID and the offer ID on its side (public only).
offer parameter (in the legacy API it was id; now id is taken for auth).Parameters
| Field | Description |
|---|---|
offer | Offer ID on WatchCat. |
url | Offer URL in the affiliate network (public offers only). |
network | Network ID (with uid, public only). |
uid | Offer ID on the network's side (with network). |
If the offer isn't found — error not-found. On success data holds the offer fields (the same as in offers), plus:
| Field | Description |
|---|---|
goals | Total offer goals. |
goalactive | Number of active goals (in the offers list this field is called goal). |
goal | An object of goals, keyed by goal ID (fields below). |
change | An array of offer changes (fields below). |
Goal fields (goal):
| Field | Description |
|---|---|
id | Goal ID. |
active | Goal is active. |
name | Goal name. |
type | Model: CPS/CPL/CPA/CoD/CPC/RS. |
code | Goal code in the network. |
geo | ISO geo code of the goal. |
price | Landing price. |
cash | Base payout or its lower bound. |
up | Upsell / upper bound. |
cross | Cross-sell. |
percent | Percentage. |
currency | Currency or false. |
Change fields (change): id, time, tid, gid, date, type, goal, value, old (see feed).
{
"status": "ok",
"data": {
"id": 2874, "active": true, "name": "Detoxic - anti-parasite remedy",
"info": "https://cpaw.cat/offer/2874", "nid": 6, "network": "M1 Shop",
"url": "http://m1-shop.ru/myoffers/add/897", "add": true,
"time": 1571432786, "date": "2019-10-18 21:06:26", "first": 1571429261,
"sub": true, "now": false,
"private": false, "goals": 1, "goalactive": 1,
"geo": { "tj": "Tajikistan" },
"goal": {
"11419": {
"id": 11419, "active": true, "name": "Tajikistan", "type": "CPS",
"code": "tj", "geo": "tj", "price": 200, "cash": 350,
"up": 0, "cross": 0, "percent": 0, "currency": "rub"
}
},
"change": [
{ "id": 24201, "time": 1571432786, "tid": 4, "gid": 11419,
"date": "2019-10-18 21:06:26", "type": "New goal",
"goal": "Tajikistan", "value": false, "old": false }
]
}
}
Back to contents
09 stat — Per-network stats
Aggregates for each public network. No input parameters. data holds:
nets— an array of networks with fieldsid,name,url(catalog filtered by this network),nomy(the network does not support adding your own offers),domain,offer(offers),goal(goals),change(changes);total— grand totals:networks,offers,goals,changes.
{
"status": "ok",
"data": {
"nets": [
{
"id": 2, "name": "Admitad",
"url": "https://cpaw.cat/offers?n=2", "nomy": true,
"domain": "www.admitad.com", "offer": 5820, "goal": 14310, "change": 92034
}
],
"total": { "networks": 48, "offers": 99358, "goals": 229257, "changes": 3293186 }
}
}
Back to contents
10 daily — Daily stats
Global counters. No input parameters. data:
| Field | Description |
|---|---|
net | Total working networks. |
nets | Of those, public networks. |
offer | Total offers. |
offers | Offers added in the last 24 hours. |
goal | Total goals. |
goals | Goals added in the last 24 hours. |
change | Total changes. |
changes | Changes in the last 24 hours. |
{
"status": "ok",
"data": {
"net": 48, "nets": 47,
"offer": 99358, "offers": 42,
"goal": 229257, "goals": 118,
"change": 3293186, "changes": 1204
}
}
Back to contents
11 add — Add a private offer
Creates a private offer and enables its once-a-day check. The source offer is given one of three ways.
Parameters
| Field | Description |
|---|---|
offer | An existing public WatchCat offer (first way). |
url | The offer URL in the affiliate network (second way). |
network + uid | The network ID and the offer ID on its side (third way). |
login, pass, user, api, key | Network credentials. The exact set of fields comes from the networks list (the auths field). |
On success data holds the id of the added offer (needed for edit / del).
Error codes: not-found — offer/network not found; no-private — the network doesn't support own offers; bad-auth — the network rejected the credentials; error — save failed.
{ "status": "ok", "data": { "id": 1234 } }
Back to contents
12 edit — Configure a private offer
Changes the credentials and check frequency. Send only the fields you want to change; only offer is required.
Parameters
| Field | Description |
|---|---|
offer* | The offer ID on the WatchCat side (required). |
period | Check period in minutes: 1440 — once a day (optimal), 720 — twice a day, 360 — every 6 hours, 180 — every 3 hours, 120 — every 2 hours, 60 — hourly; VIP also gets 30 and 10. |
login, pass, user, api, key | Credentials (only fields already set on the offer are updated). |
On success data holds id and changed — the fields actually changed (empty if a field already had the desired value).
Error codes: bad-id — offer not given; access — the offer isn't yours; edit — save failed.
{ "status": "ok", "data": { "id": 1234, "changed": [ "api" ] } }
Back to contents
13 del — Delete a private offer
Deletes a previously added private offer and its entire check history.
Parameters
| Field | Description |
|---|---|
offer* | The offer ID on the WatchCat side (required). |
Error codes: bad-id — offer not given; access — the offer isn't yours.
{ "status": "ok", "data": { "id": 1234 } }
Back to contents
14 sub — Subscribe to an offer
Adds a subscription to a public offer. Idempotent: a repeat call doesn't create a duplicate, but lets you toggle the instant-notification flag.
Parameters
| Field | Description |
|---|---|
offer* | The public offer ID (required). |
now | Instant notification: 1 — notify immediately, 0 — include in the digest. If omitted: 0 on a new subscription, unchanged on an existing one. |
On success data holds id and the current value of the now flag.
Error codes: bad-id — offer not given; access — the offer is private or the network is unavailable.
{ "status": "ok", "data": { "id": 1234, "now": 1 } }
Back to contents
15 unsub — Unsubscribe from an offer
Removes a subscription to a public offer.
Parameters
| Field | Description |
|---|---|
offer* | The offer ID (required). |
Error codes: bad-id — offer not given; access — the offer is private or the network is unavailable.
{ "status": "ok", "data": { "id": 1234 } }
Back to contents
16 nwsub — Subscribe to a network
Adds a subscription to a whole affiliate network. Idempotent: a repeat call doesn't create a duplicate, but lets you change the subscription level.
Parameters
| Field | Description |
|---|---|
network* | The network ID (required). |
level | Subscription level: 1 — new offers only, 2 — any changes. Default 1. |
On success data holds the network id and the current level.
Error codes: bad-id — network not given; access — the network is unavailable (a private network for a non-VIP user).
{ "status": "ok", "data": { "id": 2, "level": 2 } }
Back to contents
17 nwunsub — Unsubscribe from a network
Removes a network subscription. Always allowed (including when the network has become private).
Parameters
| Field | Description |
|---|---|
network* | The network ID (required). |
Error codes: bad-id — network not given.
{ "status": "ok", "data": { "id": 2 } }
Back to contents