Skip to main content

Filter Builder

Overview

getFilterBuilderData returns everything you need to build a filter UI — or to programmatically pick valid facets.include / facets.exclude values when composing an Advanced Strategy. For a given asset type it hands back:

  • The list of facet fields that exist on that asset type (e.g. asset_data.subcategory, config_data.rarity)
  • For any facet fields you ask about: every value seen in the catalog plus the product count behind it
  • A live product preview so you can sanity-check that your filter resolves to real inventory

It accepts the same fv* knobs that GroupedStrategyConfig.filterCriteria does, so you can preview exactly what a strategy would match before saving it.

Get Filter Builder Data

query GetFilterBuilderData($input: FilterBuilderInput!) {
getFilterBuilderData(input: $input) {
availableFacetFields
facets {
fieldName
totalValues
counts {
value
count
}
}
totalProducts
preview {
id
assetTypeName
name
slug
primaryImageUrl
}
error { message code }
}
}

Input Fields

FieldTypeRequiredDescription
assetTypeIdIDYesAsset type to explore — see Asset Types
facetFields[String]NoSubset of facet fields to expand value counts for. Omit to get all available fields (heavier)
activeFiltersJSONNoMap of { field → [values] } to apply before counting. Use to preview "if I filtered by X, what's left?"
facetRangesJSONNoMap of { numericField → bound } to apply before counting, e.g. { "asset_data.release_year": { "greaterThanOrEqual": 2015, "lessThanOrEqual": 2020 } }. Bound keys: greaterThan / greaterThanOrEqual / lessThan / lessThanOrEqual / equalTo. Same shape a strategy's filterCriteria.facetRanges accepts
queryStringNoText query narrowing results
fvMinCentsIntNoInclusive lower bound on fair value
fvMaxCentsIntNoInclusive upper bound on fair value
fvKeyIds[String]NoRestrict to specific product variants (e.g. PSA 10 vs PSA 9)
fvModelConfigIdStringNoFair-value model config to evaluate against — see Fair Value → Model Configs
fvConfidenceMinFloatNoConfidence floor (0–1)
maxFacetValuesIntNoCap on values returned per facet (default 50)
previewLimitIntNoNumber of products in preview (default 12)
previewOffsetIntNoPagination offset for preview (default 0)
skipFacetsBooleanNoSkip facet computation and only return preview + totalProducts. Faster when you only need a count or list

Discover All Facet Fields for an Asset Type

Use this when you don't yet know what fields are available. The response's availableFacetFields lists every facet field that exists on the asset type; you can then drill into specific ones with a follow-up call.

{
"query": "query GetFilterBuilderData($input: FilterBuilderInput!) { getFilterBuilderData(input: $input) { availableFacetFields totalProducts error { message code } } }",
"variables": {
"input": {
"assetTypeId": "550e8400-e29b-41d4-a716-446655440000",
"skipFacets": true
}
}
}

Expand Specific Facet Values

Once you know the field names, request value counts for just the ones you care about.

{
"query": "query GetFilterBuilderData($input: FilterBuilderInput!) { getFilterBuilderData(input: $input) { facets { fieldName counts { value count } } totalProducts error { message code } } }",
"variables": {
"input": {
"assetTypeId": "550e8400-e29b-41d4-a716-446655440000",
"facetFields": ["asset_data.subcategory", "config_data.rarity"]
}
}
}

Preview What a Strategy Would Match

Pass the same fv* and activeFilters you intend to use in an Advanced Strategy. totalProducts tells you how many products the strategy would target right now, and preview shows a sample.

{
"query": "query GetFilterBuilderData($input: FilterBuilderInput!) { getFilterBuilderData(input: $input) { totalProducts preview { id name } error { message code } } }",
"variables": {
"input": {
"assetTypeId": "550e8400-e29b-41d4-a716-446655440000",
"fvModelConfigId": "660e8400-e29b-41d4-a716-446655440000",
"fvMinCents": 5000,
"fvMaxCents": 50000,
"fvConfidenceMin": 0.7,
"activeFilters": {
"asset_data.subcategory": ["POKEMON_CARDS"]
},
"previewLimit": 24
}
}
}

FilterBuilderPayload Type

FieldTypeDescription
availableFacetFields[String!]!Every facet field name available for this asset type. Use these as keys in facets.include / facets.exclude
availableFacetFieldDefs[FacetFieldDef!]!The same fields, each paired with a human-readable label for a filter UI. Render label; key facets.include / facets.exclude on field
facets[FacetFieldResult!]!Value counts for the fields you requested
totalProductsInt!Total product count after applying filters
preview[ProductSearchResult!]!Sample products matching the filters
errorErrorSet when the request failed

FacetFieldResult

FieldTypeDescription
fieldNameString!Facet field name (matches a key in availableFacetFields)
totalValuesInt!Total distinct values seen (may exceed counts.length when maxFacetValues truncates)
counts[FacetValueCount!]!Per-value counts

FacetValueCount

FieldTypeDescription
valueString!Facet value (pass this through to facets.include / facets.exclude in a strategy)
countInt!Number of products carrying that value under the current filters

FacetFieldDef

FieldTypeDescription
fieldString!Facet field path — the value to key facets.include / facets.exclude on (matches an entry in availableFacetFields)
labelString!Human-readable display name for the field, resolved per asset type. Distinct fields that share a leaf name (e.g. an asset-level vs config-level name) get distinct labels

Using Filter Builder Data with Advanced Strategies

fieldName and value returned here map directly onto filterCriteria.facets in a grouped strategy. Discover, then save:

{
"input": {
"groupId": "770e8400-e29b-41d4-a716-446655440000",
"name": "PSA 10 Pokémon — $50 to $500",
"strategyConfig": {
"filter_criteria": {
"fv_model_config_id": "660e8400-e29b-41d4-a716-446655440000",
"fv_min_cents": 5000,
"fv_max_cents": 50000,
"facets": {
"include": { "asset_data.subcategory": ["POKEMON_CARDS"] },
"exclude": { "config_data.rarity": ["Common", "Uncommon"] }
}
},
"variance": { "below_fv": { "unit": "PCT", "value": 0.20 } },
"target_quantity": 100
}
}
}

See Advanced Strategies for the full GroupedStrategyConfig reference.


← Catalog | Advanced Strategies →

© 2026 Tradepost Markets Inc. All rights reserved.