# DomainTraffic

The DomainTraffic type of the TypeScript SDK, which domains.getTraffic take or answer.

```ts
type DomainTraffic = {
  byOutcome: Record<string, number>
  domain: string
  estimated: boolean
  range: string
  retentionDays: number
  rows: TrafficRow[]
  series?: TrafficSeriesPoint[]
  totals: DomainTrafficTotals
}
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `byOutcome` | `Record<string, number>` | Breakdown of event counts by outcome |
| `domain` | `string` | Domain name |
| `estimated` | `boolean` | True if metrics are sampled estimates |
| `range` | `string` | Time range of statistics |
| `retentionDays` | `number` | Analytics retention window in days |
| `rows` | [`TrafficRow[]`](/docs/sdks/typescript/types/traffic-row) | Breakdown rows grouped by outcome and route kind |
| `series` | [`TrafficSeriesPoint[]`](/docs/sdks/typescript/types/traffic-series-point) | Optional. Time-series buckets for charting |
| `totals` | [`DomainTrafficTotals`](/docs/sdks/typescript/types/domain-traffic-totals) |  |

## Used by

| Method | What it does |
| --- | --- |
| [`domains.getTraffic`](/docs/sdks/typescript/domains/get-traffic) | Get domain traffic statistics |
