Skip to main content
POST
Stats get

Authorizations

Authorization
string
header
required

A personal API key (adside_pat_…) or a token from adside login. Either carries the permissions of the person it belongs to.

Path Parameters

workspaceId
string
required
Minimum string length: 1

Body

application/json
account_id
string

X ads account id (e.g. 18ce55xcrlv). Omit it: it defaults to the ads account this workspace is connected to, and any other account is refused.

entity
enum<string>
default:CAMPAIGN
Available options:
ACCOUNT,
FUNDING_INSTRUMENT,
CAMPAIGN,
LINE_ITEM,
PROMOTED_TWEET,
PROMOTED_ACCOUNT,
MEDIA_CREATIVE
entity_ids
string[]

Up to 20 ids of that entity (X's cap). For ACCOUNT omit it. Omit for CAMPAIGN / LINE_ITEM / PROMOTED_TWEET to use the entities active in the window (from adside x active-entities get, first 20).

Maximum array length: 20
Minimum string length: 1
preset
enum<string>

Shortcut for a date range. Default last_7d when no start_date/end_date given.

Available options:
today,
yesterday,
last_7d,
last_14d,
last_30d,
this_month,
last_month
start_date
string

First day, YYYY-MM-DD, in the account's time zone.

Pattern: ^\d{4}-\d{2}-\d{2}$
end_date
string

Last day (inclusive), YYYY-MM-DD, in the account's time zone. The exclusive end X wants is computed for you.

Pattern: ^\d{4}-\d{2}-\d{2}$
granularity
enum<string>
default:DAY

DAY buckets are midnight-to-midnight in the account's time zone; HOUR is hourly; TOTAL is one bucket.

Available options:
DAY,
HOUR,
TOTAL
placement
enum<string>
default:ALL_ON_TWITTER

One placement per stats request (X accepts a single value). Default ALL_ON_TWITTER; other placements are separate calls.

Available options:
ALL_ON_TWITTER,
PUBLISHER_NETWORK,
SPOTLIGHT,
TREND
metrics
string[]

Friendly metric names: spend, impressions, engagements, clicks, url_clicks, likes, follows, video_total_views, conversion_purchases, … plus derived ones (cpm, cpe, cplc, ctr, engagement_rate, cpv, cpa, roas) computed here. Default: the ENGAGEMENT + BILLING groups. See adside x metrics list.

metric_groups
enum<string>[]

X metric groups to request. MOBILE_CONVERSION must be requested alone.

Available options:
ENGAGEMENT,
BILLING,
VIDEO,
WEB_CONVERSION,
MOBILE_CONVERSION,
LIFE_TIME_VALUE_MOBILE_CONVERSION
format
enum<string>
default:markdown

json only when fields must be reused programmatically.

Available options:
markdown,
json

Response

200 - application/json

Success