Request

Response

    Beta APIs are subject to change. Please avoid using them in production environments.

    Filtering

    The Sustainability Data API uses a consistent filter discovery and :filter pattern across datasets, baselines, EPDs, generic estimates, and activities. This page explains filter ids and fields, and how to build correct request bodies.

    Filter discovery

    For each resource, call the filter discovery endpoint (for example GET /v3/datasets/{datasetId}/product-epds/filters) before your first :filter request. The response includes:

    • actions — which surfaces (list, categories, statistics, and so on) exist and which filter ids each surface supports
    • filters — a map keyed by filter id, with metadata for each filter (label, field, operators, valueSource, and so on)

    Filter ids and fields

    Each entry under filters in the discovery response has two identifiers:

    Filter id

    • The key in the filters map (for example list_jurisdictions, category_id, supportedDataType)
    • The id on each item under actions.<action>.filters[]
    • The filterId path parameter on GET .../filters/{filterId} when you load allowed values for a dynamic filter

    Field

    • The field property on the filter definition (for example jurisdictions, id, supportedDataTypes, declaredUnit.qty)
    • The key you must use under filters in every :filter request body (POST .../list:filter, statistics, categories, impacts, and similar)

    Example (datasets list, SDA-native):

    • Filter id: supportedDataType
    • Field: supportedDataTypes

    Use supportedDataTypes as the key in POST /v3/datasets/list:filter.

    Building a :filter request

    1. Choose the action (for example list or statistics) and read actions.<action>.filters for supported filter ids.
    2. For each filter you need, look up its definition in the filters map and note field, operators, and valueSource.
    3. If valueSource.type is dynamic, call GET .../filters/{filterId} using the filter id to load allowed values.
    4. Send POST .../<action-path>:filter with a body shaped like:
    {
      "filters": {
        "<field>": {
          "op": "IN",
          "value": ["US-CA"]
        }
      }
    }
    
    Show More

    Replace <field> with the field value from discovery. Use an operator from that filter’s operators list and values that match dataType.

    Response accounting

    Successful :filter responses include:

    • appliedFilters — field keys from your request that were applied (each with requested, applied, and optional warnings)
    • ignoredFilters — field keys you sent that are not supported for this action (each with reason)

    Unsupported field keys are reported in ignoredFilters with reason Filter is not supported by this connector. and do not fail the request with 400.

    Walkthroughs

    Step-by-step examples that tie discovery, filter values, and list or statistics calls together:

    See also the Filter request handling section in the API reference overview and each operation’s request schema.