---
title: "Get integration account stats"
method: GET
path: "/api/businesses/{business_id}/integrations/{integration_id}/stats"
tags: ["integrations"]
---

# Get integration account stats

`GET /api/businesses/{business_id}/integrations/{integration_id}/stats`

## Request

- Base URL: `https://api.mymarky.ai`
- URL: `https://api.mymarky.ai/api/businesses/{business_id}/integrations/{integration_id}/stats`
- Auth: HTTP bearer

Fetch account/page analytics for a single connected integration.

Returns the normalized `AccountStats` model (followers, impressions,
reach, profile_views, plus a timeseries `metrics` array) for the
integration's platform — Facebook, Instagram, LinkedIn, Twitter/X,
TikTok, Pinterest, or YouTube. Use the `id` from
`GET /businesses/{business_id}/integrations` as the integration_id.

Some accounts have no account-level analytics to give — a LinkedIn personal
profile, or a platform whose reads we have turned off on cost grounds.
Those return 200 with a populated `unavailable_reason` and null metrics,
NOT an error. Null there means "not available", not zero.

Errors:
    400 invalid_value: The integration_id is not a valid UUID.
    400 invalid_request: A date, period, or metric value was rejected.
    401 authentication_required: API key or token is missing, invalid, or revoked.
    401 SOCIAL_TOKEN_EXPIRED: The connected account's token expired and could not be refreshed — the response's reconnect_url points to where to reconnect.
    403 permission_denied: Your plan does not include API access.
    404 resource_not_found: No integration with that ID exists, or it is not in your org.
    429 rate_limit_exceeded: You sent too many requests this minute.
    502 UPSTREAM_PROVIDER_ERROR: The social platform returned an error while fetching stats.

## Path parameters

- `business_id` string, required: A UUID identifier.
- `integration_id` string, required: A UUID identifier.

## Query parameters

- `since` string, nullable: Start date (YYYY-MM-DD). Defaults to 30 days ago.
- `until` string, nullable: End date (YYYY-MM-DD). Defaults to today.
- `period` string: Aggregation period: day, week, days_28, lifetime
- `metrics` string, nullable: Comma-separated metric names (platform-specific). Omit for defaults.

## Headers

- `Marky-Version` '2026-04-08' | '2026-07-17' | '2026-08-02' | '2026-08-04' | '2026-08-06'

## Response `200`

Successful Response

- AccountStats: Account/page-level statistics. Data-source agnostic: works for API fetches and local DB reads.
  - `fetched_at` string, date-time
  - `platform` string, nullable
  - `account_id` string, nullable
  - `page_id` string, nullable
  - `followers` integer, nullable
  - `following` integer, nullable
  - `posts_count` integer, nullable
  - `impressions` integer, nullable
  - `reach` integer, nullable
  - `profile_views` integer, nullable
  - `website_clicks` integer, nullable
  - `audience_age_pct` object, nullable: Age bucket -> share of audience (0.0-1.0). IG, YT, LinkedIn, Pinterest.
  - `audience_gender_pct` object, nullable: Gender ('FEMALE'/'MALE'/'UNKNOWN') -> share. IG, YT, LinkedIn, Pinterest.
  - `audience_country_pct` object, nullable: ISO country code -> share. IG, YT, LinkedIn.
  - `audience_city_pct` object, nullable: City name -> share. IG only.
  - `audience_industry_pct` object, nullable: LinkedIn-only: industry name -> share.
  - `audience_seniority_pct` object, nullable: LinkedIn-only: seniority bucket -> share.
  - `audience_function_pct` object, nullable: LinkedIn-only: job function -> share.
  - `metrics` MetricTimeseries[]
    - `name` string, required
    - `title` string, nullable
    - `description` string, nullable
    - `period` string, nullable
    - `metric_kind` string, nullable: What this metric actually counts, so metrics can be compared safely: 'content_reach', 'impressions', 'profile_visits', 'followers', or 'engagement'. Two metrics with DIFFERENT kinds measure different things and must not be compared (e.g. Facebook 'profile_visits' is not Instagram 'content_reach'). None = unknown.
    - `values` MetricValue[]
      - `value` union
        - integer
        - number
        - string
      - `start_time` string, date-time, nullable
      - `end_time` string, date-time, nullable
  - `raw_metrics` object
  - `unavailable_reason` string, nullable: Non-null when the platform does not support account-level analytics for this account type (e.g. LinkedIn personal profiles). When set, the numeric fields being null means 'not supported by provider', not 'zero' or 'no data'.
  - `post_stats_hint` string

## Other responses

- `400`: Bad request — the input was malformed or otherwise invalid.
- `401`: Authentication failed — the API key is missing or invalid.
- `403`: Forbidden — the key is valid but may not access this resource.
- `404`: Not found — no resource matches the id in the path.
- `422`: Validation error — one or more fields failed validation.
- `429`: Rate limited — retry after the window resets (see Retry-After).
- `500`: Server error — something failed on our side; retry or quote X-Request-Id.

---

[API](https://skmtc.dev/mymarky/apis/marky-public-api.md) · [All operations](https://skmtc.dev/mymarky/apis/marky-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mymarky/apis/marky-public-api/revisions/25aeacae455c?raw)
