Skip to main content

Overview

Faceting gives you total counts for any field in your results. It helps you build filters and understand how your data is grouped. You can:
  • Count transactions per currency
  • See how many transactions are in each status
  • Group balances by ledger or identity
  • Break transactions into date or amount ranges

Quick start

Here’s a basic faceting request that shows the total counts for the status and currency fields:
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "facet_by": "status,currency"
  }'
FieldDescription
field_nameThe field being faceted.
valueA unique value found in that field.
countNumber of documents that have this value.
countsThe full list of values and their counts.
total_valuesHow many unique values exist for this field.

Combining faceting with filters

Faceting becomes more powerful when combined with filters. You can facet on one field while filtering on others to analyze specific subsets of your data.
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "currency:=USD",
    "facet_by": "status"
  }'
The example above allows you to answer questions like:
  • “Of all my USD transactions, how many are in each status?”
  • “For this specific customer, how many balances do they have in each currency?""

Faceting on metadata fields

You can also facet on metadata objects.
Facet on metadata fields
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "facet_by": "meta_data.transaction_type,meta_data.payment_method"
  }'
Always use dot notation to access nested metadata fields: meta_data.field_name

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.
Tip: Connect to Blnk Cloud to see your Core data.You can view your transactions, manage identities, create custom reports, invite other team members to collaborate, and perform operations on your Core — all in one dashboard.Check out Blnk Cloud →