Skip to main content
GET
/
v0
/
top_sources
Get top traffic sources (referrers / utm)
curl --request GET \
  --url https://api.formo.so/v0/top_sources \
  --header 'Authorization: Bearer <token>'
{
  "meta": [
    {
      "name": "project_id",
      "type": "String"
    },
    {
      "name": "referrer",
      "type": "String"
    },
    {
      "name": "visits",
      "type": "UInt64"
    },
    {
      "name": "users",
      "type": "UInt64"
    },
    {
      "name": "hits",
      "type": "UInt64"
    }
  ],
  "data": [
    {
      "project_id": "proj_abc",
      "referrer": "Direct",
      "visits": 612,
      "users": 487,
      "hits": 1024
    },
    {
      "project_id": "proj_abc",
      "referrer": "google.com",
      "visits": 312,
      "users": 268,
      "hits": 542
    },
    {
      "project_id": "proj_abc",
      "referrer": "twitter.com",
      "visits": 184,
      "users": 154,
      "hits": 312
    },
    {
      "project_id": "proj_abc",
      "referrer": "farcaster.xyz",
      "visits": 98,
      "users": 86,
      "hits": 167
    }
  ],
  "rows": 4,
  "rows_before_limit_at_least": 18
}
Returns the top traffic sources for the project. Pass metric_column to switch between referrer, utm_source, utm_medium, utm_campaign, utm_term, and utm_content. Defaults to referrer.

Authorizations

Authorization
string
header
required

Workspace API key (e.g. formo_xxx). Create one in the Formo dashboard under Team Settings > API Keys.

Query Parameters

date_from
string<date>

Inclusive start date (YYYY-MM-DD). Defaults to 7 days before date_to.

date_to
string<date>

Inclusive end date (YYYY-MM-DD). Defaults to today.

metric_column
enum<string>

Column to break down sources by. Use channel for the 12-channel acquisition classifier (see docs/channels.md).

Available options:
referrer,
referrer_url,
ref,
utm_source,
utm_medium,
utm_campaign,
utm_term,
utm_content,
origin,
device,
browser,
os,
channel
limit
integer
default:50

Maximum results to return (default 50, max 1000)

Required range: 1 <= x <= 1000
offset
integer
default:0

Number of results to skip for pagination (default 0)

Required range: 0 <= x <= 100000

Response

Top sources

Raw Tinybird pipe response. The data array contains the analytics rows; the exact row shape depends on the endpoint.

data
object[]
meta
object[]
rows
integer
rows_before_limit_at_least
integer
statistics
object