Python SDK

Accounts

Manage connected social media accounts with the Late Python SDK

The Accounts resource provides access to your connected social media accounts. Accounts are the individual platform connections (e.g., a Twitter account, an Instagram account) that belong to profiles.

List Accounts

List All Accounts

from late import Late

client = Late(api_key="your_api_key")

# Get all connected accounts
response = client.accounts.list()

for account in response.accounts:
    print(f"{account.platform}: {account.username} ({account.field_id})")

# Check analytics access
if response.hasAnalyticsAccess:
    print("Analytics add-on is active")

Filter by Profile

# Get accounts for a specific profile
response = client.accounts.list(profile_id="prof_123")

for account in response.accounts:
    print(f"{account.platform}: {account.username}")

Get a Single Account

response = client.accounts.get("acc_123")

print(f"Platform: {response.account.platform}")
print(f"Username: {response.account.username}")
print(f"Connected: {response.account.connected}")
print(f"Profile ID: {response.account.profileId}")

Get Follower Statistics

Follower statistics require the Analytics add-on. Check hasAnalyticsAccess in the list response.

# Get follower stats for all accounts
response = client.accounts.get_follower_stats()

for account in response.accounts:
    print(f"{account.field_id}: {account.followers} followers")

# Get stats for specific accounts
response = client.accounts.get_follower_stats(
    account_ids=["acc_123", "acc_456"]
)

Async Methods

All methods have async versions:

import asyncio
from late import Late

async def manage_accounts():
    async with Late(api_key="your_api_key") as client:
        # List accounts
        result = await client.accounts.alist()

        # Filter by profile
        result = await client.accounts.alist(profile_id="prof_123")

        # Get single account
        account = await client.accounts.aget("acc_123")

        # Get follower stats
        stats = await client.accounts.aget_follower_stats()

asyncio.run(manage_accounts())

API Reference

accounts.list()

List connected accounts.

ParameterTypeRequiredDefaultDescription
profile_idstrNoNoneFilter by profile ID

Returns: AccountsListResponse

response = client.accounts.list()

response.accounts              # list[SocialAccount]
response.hasAnalyticsAccess    # bool

accounts.get()

Get a single account by ID.

ParameterTypeRequiredDescription
account_idstrYesThe account ID

Returns: AccountGetResponse

response = client.accounts.get("acc_123")

response.account.field_id
response.account.platform
response.account.username
response.account.connected

accounts.get_follower_stats()

Get follower statistics for accounts. Requires Analytics add-on.

ParameterTypeRequiredDefaultDescription
account_idslist[str]NoNoneFilter to specific account IDs

Returns: FollowerStatsResponse

response = client.accounts.get_follower_stats()

for account in response.accounts:
    print(account.followers)

SocialAccount Object

FieldTypeDescription
field_idstringUnique account identifier
platformstringPlatform type (twitter, instagram, etc.)
usernamestringAccount username/handle
displayNamestringDisplay name
profileImageUrlstringAvatar URL
connectedboolWhether the account is currently connected
profileIdstringParent profile ID
createdAtdatetimeWhen the account was connected
lastUsedAtdatetimeLast time the account was used for posting