Getting started
GET /v1/profilefuse/insights
The Insights API returns metrics for a field, across a segment of records. Two inputs are required:
- An
insight
describing the fields and calculations to collect. - An optional
filter
to define the records to consider.
Available Calculations
Calculation | Description |
fill_count | Count number of records with a value filled in |
unique_count | Count number of unique values for an attribute |
value_count | Count number of available values for an attribute |
frequencies | Count number of records per value |
Filters
The filter
parameter reduces results to records matching a specified criteria, using the Filter DSL.
Fill Count
Value Count
Unique Count
Frequencies
Count the number of records per state:
curl https://qa.api.data-axle.com/v1/profilefuse/insights -X GET -d '{
"insights": {
"field": "state",
"calculations": ["frequencies"]
}
}'
The response returns a total count
of matching results, along with frequencies for each state:
{
"count": 1231,
"insights": {
"field": "state",
"frequencies": [
{
"value": "CA",
"label": "California",
"count": 1781000
},
{
"value": "TX",
"label": "Texas",
"count": 1103438
},
{
"value": "FL",
"label": "Florida",
"count": 992429
},
...
]
}
}
Nested Frequencies
Use Nested Insights to calculate inner values per frequency:
Frequency Options
Change the behavior of frequency insights with frequency_options
.
Option | Description |
ranges | Bucketize counts for numerics and dates |
sifted | Sort and sift results by specified values |
intervals | Specify calendar intervals for date buckets |
Ranges
Frequencies for numeric fields can be grouped into ranges:
Sifted
Use sifted frequencies to order distinct counts across specific values.
Intervals
Date fields are grouped by month by default. Grouping by day and year is supported with the "interval" option.
Perspective
The perspective
pivots the top level record. This changes the calculation
results for nested objects. When using a perspective with insights, insights
must use fields from the same nesting that the perspective uses.