# GET /v1/stats/subid

Get statistics by subid

Pops, revenue and eCPM grouped by sub1, sub2 and sub3, for at most 90 days; JSON or CSV. Revenue per subid is an allocation of the revenue reported by /v1/stats for each zone and country in proportion to pops, not a separate measurement (`revenue_allocated` is always true); the totals equal the totals of /v1/stats for the same range and filters. Rows are sorted by revenue; rows beyond `limit` are merged into one row whose subid is `~other`. A null subid means no subid was sent. Requires scope publisher:read (API key or web session). Rate limit tier: stats.

- Required scope: `publisher:read`
- Rate limit: `stats` — 30 requests per 60-second window per API key or web session

## Parameters

| Name | In | Type | Required |
|---|---|---|---|
| `from` | query | string | yes |
| `to` | query | string | yes |
| `group_by` | query | ("sub1" \| "sub2" \| "sub3")[] | no |
| `site_id` | query | integer | no |
| `zone_id` | query | integer | no |
| `sub1` | query | string | no |
| `sub2` | query | string | no |
| `sub3` | query | string | no |
| `limit` | query | integer | no |
| `format` | query | "json" \| "csv" | no |

## Response

```
{ count_basis?: "valid" | "legacy" | "mixed"; currency: "USD"; estimated_from: string | null; forecast_basis_version?: "forecast-basis-v1"; forecast_generation?: string; forecast_updated_at?: string | null; measurement_definition?: { complete: boolean; includes_direct: boolean; includes_legacy: boolean; tag_valid_after_ms: integer[] }; measurement_generation?: string; measurement_status?: "ok" | "stale" | "updating"; measurement_updated_at?: string | null; money_basis_version?: string; money_generation?: string; revenue_allocated: true; rows: { ecpm: string | null; pops: integer; revenue: string; status?: "estimated" | "reported" | "final" | "mixed"; sub1?: string | null; sub2?: string | null; sub3?: string | null }[]; totals: { ecpm: string | null; pops: integer; revenue: string; status?: "estimated" | "reported" | "final" | "mixed" }; truncated?: boolean; updated_at?: string | null }
```

## Errors

Rate-limited routes return `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the window ends); a 429 also carries `Retry-After`. The headers may be absent while the limiter is temporarily unavailable (requests are then let through).

| Status | Meaning |
|---|---|
| 401 | Missing, invalid or revoked API key. |
| 403 | The key lacks the required scope, or the operation is not allowed for this actor. |
| 429 | Rate limit exceeded; wait `Retry-After` seconds. |
| 400 | Default Response |
| 404 | Default Response |
| 503 | Default Response |

HTML documentation: https://agimone.com/en/developers/api/#get-subid-stats
API 2026-10
