Usage tools

get_discovery_api_requests

Returns API request usage for an account, taken from the Setup > Usage > API Requests dashboard. It reports daily or monthly request_count values across the date range you request.

Use it to track quota consumption, watch traffic trends, spot anomalies by request type or environment, and audit usage across catalogs or sites. By default the report is organization-wide, so apply an account_name filter to narrow to one account. Usage is reported globally, so if you operate in more than one region, both are aggregated unless you filter to a region-specific account.

Request parameters

NameTypeRequired?Description
account_namestrYesThe account to query, for example 'your-account'.
time_period_startstrYesThe start date in YYYY-MM-DD format, for example '2026-03-01'.
time_period_endstrYesThe end date in YYYY-MM-DD format, for example '2026-04-30'.
granularitystrNoThe time granularity, either 'daily' or 'monthly'. Defaults to 'daily'.
filtersstr | nullNoA filter in the format 'dimension:value'. Prefix with - to exclude, as in -environment:staging.

The filters parameter accepts these dimensions:

DimensionDescriptionExample values
environmentProduction or staging.production, staging
status_codeHTTP status group.2xx, 4xx, 5xx
request_typeThe API request type.keyword, suggest, category, bestseller, mlt, jfy, co-viewed, trending, thematic, visual-search
catalogThe catalog name.Your catalog name
account_nameAn account within the org.An account name
data_typeThe type of data returned.product, content
regionThe geographic region.us, eu
siteA specific site.A domain key

Response parameters

The tool returns a DiscoveryUsageResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
organizationstr | nullThe parent organization resolved from account_name.
dataany | nullThe usage payload as freeform JSON.
errorstr | nullError message if the request failed.

The data.body payload includes these key fields:

FieldDescription
resultsTime-period results, each with time_period_start, time_period_end, total, and groups.
results[].total.request_count.valueThe total request count for the period.
results[].groupsThe per-group breakdown when a group-by is applied.
group_definitionsThe names of the groups in the response.

get_discovery_unique_visitors

Returns monthly unique visitor (MUV) counts for an account, taken from the Setup > Usage > Unique Visitors dashboard. It reports actual MUV per month and, for customers on MUV-based pricing plans, the contracted MUV limit.

Use it to track contract compliance, watch year-over-year visitor trends, and forecast usage against your contracted limit. MUVs are counted from unique cookie IDs captured by the tracking pixel, so missing or static cookie IDs can cause discrepancies against other tools. The dashboard keeps up to 24 months of history, and each month's data is available from the 2nd of the following month.

Request parameters

NameTypeRequired?Description
account_namestrYesThe account to query, for example 'your-account'.
time_period_startstrYesThe start month in YYYY-MM format, for example '2024-04'.
time_period_endstrYesThe end month in YYYY-MM format, for example '2026-03'.
include_contractedboolNoInclude the contracted_muv limit alongside actual muv. Meaningful only for MUV-based plans. Defaults to true.

Response parameters

The tool returns a DiscoveryUsageResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
organizationstr | nullThe parent organization resolved from account_name.
dataany | nullThe usage payload as freeform JSON.
errorstr | nullError message if the request failed.

The data.body payload includes these key fields:

FieldDescription
resultsMonthly results, each with time_period_start, time_period_end, total, and groups.
results[].total.muv.valueThe monthly unique visitor count.
results[].total.contracted_muv.valueThe contracted MUV limit, when include_contracted is true and the plan applies.

© Bloomreach, Inc. All rights reserved.