Перейти к содержимому

Get revenue, cost and ROI for a link

GET
/api/v1/links/{code}/analytics/economics
curl --request GET \
--url 'https://example.com/api/v1/links/example/analytics/economics?from=2026-02-01T00%3A00%3A00Z&to=2026-02-27T23%3A59%3A59Z&granularity=hour&limit=20&limit_countries=20&limit_cities=20&compare=prev_period' \
--header 'Authorization: Bearer <token>'
code
required
string

Short code or custom alias

from
string

Example

2026-02-01T00:00:00Z

Start date (ISO 8601). Default: 30 days ago

to
string

Example

2026-02-27T23:59:59Z

End date (ISO 8601). Default: now

granularity
string
default: day
Allowed values: hour day week month
limit
number
default: 20 >= 1 <= 100
limit_countries
number
default: 20 <= 250

Limit for countries (geo endpoint)

limit_cities
number
default: 20 <= 100

Limit for cities (geo endpoint)

countries
Array<string>

Filter by ISO 3166-1 alpha-2 country codes (comma-separated)

compare
string
Allowed values: prev_period prev_year

Compare with a previous period

Media typeapplication/json
object
from
required
string
to
required
string
clicks
required
number
uniqueClicks
required
number
conversions
required
number
revenue
required

Confirmed income only (sale / rebill / upsell); leads and rejected are excluded. A conversion without payout uses its offer payout (fixed-payout offers).

number
cost
required
number
profit
required

Revenue - cost

number
roi

(revenue - cost) / cost * 100. Null when cost is 0.

object
cr

(leads + sales) / clicks * 100 — rejected conversions, rebills and upsells are not counted. Null when clicks is 0.

object
epc

Earnings per click: revenue / clicks. Null when clicks is 0.

object
cpc

Cost per click: cost / clicks. Null when clicks is 0.

object
cpm

Cost per 1000 CLICKS (not impressions — impressions are not tracked). Null when clicks is 0.

object
mixedCurrencies
required

True when some revenue/cost could not be converted into the base currency (no FX rate on that date) and so ended up in a different currency than the rest. Everything else is converted by the rate of its own date; treat the totals as informational when this is set.

boolean
linkId
required
string
shortCode
required
string

Example generated

{
"from": "example",
"to": "example",
"clicks": 1,
"uniqueClicks": 1,
"conversions": 1,
"revenue": 1,
"cost": 1,
"profit": 1,
"roi": {},
"cr": {},
"epc": {},
"cpc": {},
"cpm": {},
"mixedCurrencies": true,
"linkId": "example",
"shortCode": "example"
}

Forbidden — not the owner

Link not found