---
title: "Traffic Sources"
method: GET
path: "/api/admin/sources"
tags: ["Admin"]
---

# Traffic Sources

`GET /api/admin/sources`

## Request

- Base URL: `https://pegarex.com.br` (the document declares no server; this is the origin it was published from)
- URL: `https://pegarex.com.br/api/admin/sources`
- Auth: HTTP bearer

Where sessions come from — classified from the referrer of each
session's FIRST page_view.

Per session, not per page_view: in a single-page app document.referrer
keeps the original external value across in-app navigation, so counting
page views would weight a source by how many pages its visitors clicked
through rather than by how many of them arrived.

An internal (pegarex.com.br) referrer on a session's first page view is
worth its own bucket: the SEO landing pages under /precos and the brand
hubs are served by landing_routes.py rather than the SPA, so they emit no
page_view of their own — a session that arrives from one shows up here
with the site itself as the referrer. Hard reloads land there too.

Same consent caveat as everything on this page: only visitors who accepted
the cookie banner are tracked at all.

## Query parameters

- `days` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pegarex/apis/pegarex-api.md) · [All operations](https://skmtc.dev/pegarex/apis/pegarex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pegarex/apis/pegarex-api/revisions/8c789c9bd72d?raw)
