Skip to content
Docs

Retrieve analytics

Early access. Tell us what you're building and we'll set you up. Contact us

GETapi.lempile.com/accounts/{account_id}/analytics

The X account's own analytics by UTC day, read from its analytics page (x.com/i/account_analytics, which needs X Premium). Complete days only: to is capped at yesterday (UTC). Each count is X's daily series; engagements, engagement_rate and shares are always null (X has them by the hour only). Read-only.

Scope: accounts.read.

Authentication

X-API-KEY header·A Lempile API key, made in the dashboard under Access tokens.

Path parameters

  • account_idstringrequired

    Lempile id, X user id or handle.

Query parameters

  • fromstring · daterequired

    First day, YYYY-MM-DD.

  • tostring · daterequired

    Last day, YYYY-MM-DD; at most 365 days after from.

Responses

200

Analytics.

›

application/json

  • account_idstring
  • objectany
    AlwaysAccountAnalytics
  • providerany
    AlwaysX
  • fromstring
  • tostring
  • read_atstring · date-time
  • daysarray of AnalyticsDay
    ›Show fields
    • datestring · date
    • impressionsinteger | null
    • likesinteger | null
    • repliesinteger | null
    • repostsinteger | null
    • quotesinteger | null
    • bookmarksinteger | null
    • profile_visitsinteger | null
    • postsinteger | null
    • replies_sentinteger | null
    • quotes_sentinteger | null
    • new_followsinteger | null
    • unfollowsinteger | null
    • engagementsinteger | null
    • engagement_ratenumber | null
    • sharesinteger | null
  • totalsAnalyticsDay
    ›Show fields
    • datestring · date
    • impressionsinteger | null
    • likesinteger | null
    • repliesinteger | null
    • repostsinteger | null
    • quotesinteger | null
    • bookmarksinteger | null
    • profile_visitsinteger | null
    • postsinteger | null
    • replies_sentinteger | null
    • quotes_sentinteger | null
    • new_followsinteger | null
    • unfollowsinteger | null
    • engagementsinteger | null
    • engagement_ratenumber | null
    • sharesinteger | null
  • followersobject
    ›Show fields
    • totalinteger
    • verifiedinteger
    • activeinteger
400

errors/invalid_parameters.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

401

Missing or invalid API key ({error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

402

subscription_required: the workspace has no active trial or subscription.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

404

errors/resource_not_found: no such account in this workspace, or it isn't an X account.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

422

errors/analytics_unavailable: X doesn't show analytics to this account yet (e.g. under X's follower floor).

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

423

errors/x_account_locked: X shows the account its lock page (x.com/account/access). Nothing was done; someone has to pass X's check.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

502

errors/analytics_not_loaded (no Premium, or the page didn't finish) or errors/analytics_failed.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

503

errors/service_unavailable (the account isn't ready, or the browser runner can't be reached), errors/no_client_session, or errors/maintenance with retry_at.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

Was this page helpful?