Get country analytics
GET https://datafa.st/api/v1/analytics/countriesReturn analytics broken down by country β visitors, attributed revenue, and payment count per row. Combine with
filter_* parameters and date ranges to compare segments, just like dashboard breakdown tabs.Results are sorted by visitors descending. Omit
startAt and endAt for all-time data.Related: Filter your data
Request
Query parameters
fieldsstring
Comma-separated response columns. Omit to return all valid fields for this endpoint. Valid values:
country, image, visitors, revenue, payments. Example: fields=visitors,revenue,payments.websiteIdstring
Required with a
dft_ account token on Website API routes. Omit with a df_ website key. Example: ?websiteId=665f0b3c4d2e1a0012345678.startAtstring
Start of the reporting window. Use
YYYY-MM-DD for calendar days or an ISO timestamp. Must be provided together with endAt. Example: startAt=2026-05-01.endAtstring
End of the reporting window. Must be provided together with
startAt. Example: endAt=2026-05-21.timezonestring
Timezone used to interpret dates and group analytics buckets. Defaults to the website timezone. IANA timezone for dashboard periods and API date grouping. Examples:
"America/New_York", "Europe/Paris", "UTC". Defaults to the website timezone when omitted.limitnumber
Maximum rows to return. Default
100, maximum 1000 on analytics endpoints and 250 on list visitors. Example: limit=50.offsetnumber
Rows to skip before returning results. Use with
limit for pagination. Default 0. Example: offset=50.filter_countrystring
Limit results to one or more countries. Prefix with an operator:
is, is_not. Accepts country names or codes. Example: filter_country=US,Canada or filter_country=is_not:France.filter_regionstring
Limit results by region or state. Example:
filter_region=California.filter_citystring
Limit results by city. Example:
filter_city=San Francisco.filter_devicestring
Limit results by device type:
desktop, mobile, or tablet. Example: filter_device=mobile.filter_browserstring
Limit results by browser. Filtering
Safari also includes Mobile Safari. Example: filter_browser=Chrome,Safari.filter_osstring
Limit results by operating system. Example:
filter_os=iOS,Android.filter_referrerstring
Limit results by referrer domain or normalized source such as
Google or Direct/None. Example: filter_referrer=Google.filter_pagestring
Limit results to visitors who viewed a page. Operators:
is, is_not, contains, does_not_contain. Example: filter_page=contains:/docs.filter_entry_pagestring
Limit results by first page in the session. Same operators as
filter_page. Example: filter_entry_page=/pricing.filter_hostnamestring
Limit results by tracked hostname. Example:
filter_hostname=app.example.com.filter_goalstring
Limit results to visitors who completed a goal. Example:
filter_goal=signup.filter_visit_countnumber
Limit results by the all-time visitor session count tracked by the browser cookie. Operators:
is, is_not, gte, lte. Example: filter_visit_count=gte:2 for returning visitors.filter_utm_sourcestring
Limit results by UTM source. Example:
filter_utm_source=google.filter_utm_mediumstring
Limit results by UTM medium. Example:
filter_utm_medium=cpc.filter_utm_campaignstring
Limit results by UTM campaign. Example:
filter_utm_campaign=launch.filter_utm_termstring
Limit results by UTM term. Example:
filter_utm_term=brand-keyword.filter_utm_contentstring
Limit results by UTM content. Example:
filter_utm_content=hero-cta.filter_refstring
Limit results by the
ref URL parameter. Example: filter_ref=twitter.filter_sourcestring
Limit results by the
source URL parameter. Example: filter_source=newsletter.filter_viastring
Limit results by the
via URL parameter. Example: filter_via=partner.Example filters
Combine
filter_* query params with date ranges:GET /api/v1/analytics/timeseries?fields=visitors,revenue&interval=day&startAt=2026-05-01&endAt=2026-05-21&filter_device=mobile&filter_country=US
Operators:
is, is_not, contains (pages only), and gte/lte for filter_visit_count. Full reference: filter your data.Response
Returns a JSON object with
status: "success" and endpoint-specific fields in data (and pagination when the endpoint is paginated).Response fields
data[].countrystring
Country name.
data[].imagestring|null
Country flag image URL or identifier, or
null when unavailable.data[].visitorsnumber
Number of unique visitors represented by this row or time bucket. Use it to compare traffic volume across dates, pages, sources, countries, devices, or campaigns.
data[].revenuenumber
Revenue attributed to this row or time bucket, in the website currency. Use it to see which time periods or dimensions influenced paid conversions.
data[].paymentsnumber
Number of payment events attributed to this row or time bucket. Use it when you need transaction count instead of revenue amount.
pagination.limitnumber
Maximum number of rows returned in one response. Use with
offset to paginate through long result sets.pagination.offsetnumber
Number of rows to skip before returning results. Use it with
limit for pagination.pagination.totalnumber
Total rows.
Authentication
df_website API key: The website is inferred from the key. You do not need awebsiteIdquery parameter.dft_account token: Requiresanalytics:readpermission and?websiteId=on every request. The token must be allowed to access that website.
Read authentication and scopes for token creation, permission lists, and scoped tokens.
Errors
400 β Invalid
fields value, partial date range, or invalid filter.404 β Website not found.
See API errors for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.