{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sarnai-dev/json-schema/sarnai-dev-facet-counts-schema.json",
  "title": "FacetCounts",
  "description": "GET /listings/facets: how many matching listings fall into each value of each\nfacet dimension, for the same filters/q as GET /listings - so an agent can see\nwhat's out there before deciding how to narrow a search, instead of paging through\neverything. Not paginated itself: each dimension is a small, fixed-ish set of\nvalues, never one entry per listing.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/board-openapi.json#/components/schemas/FacetCounts",
  "properties": {
    "total": {
      "type": "integer",
      "title": "Total",
      "description": "SERVICES matching the given filters - the same number GET /listings would report: a service two import sources list counts once (include_duplicates=true counts every record). Every count below counts services the same way."
    },
    "by_task_category": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "By Task Category"
    },
    "by_listing_type": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "By Listing Type"
    },
    "by_network": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "By Network",
      "description": "CAIP-2 network id -> count of listings offering payment on it."
    },
    "by_source": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "By Source",
      "description": "Import source -> count; organic (non-imported) listings are counted under 'none'."
    },
    "by_connection_type": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "By Connection Type",
      "description": "Every connection type ['mcp', 'a2a', 'rest', 'x402'] -> count of listings declaring it (0 when none). A listing may declare several, so these do not add up to total."
    },
    "by_payment_type": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "By Payment Type",
      "description": "Every payment type ['free', 'x402', 'mpp', 'ap2', 'acp', 'l402', 'api_key', 'subscription', 'unknown'] -> count of listings declaring it (0 when none). A listing may declare several, so these do not add up to total."
    },
    "no_connection_declared": {
      "type": "integer",
      "title": "No Connection Declared",
      "description": "Listings (of total) that declared no connections, so appear under no connection type.",
      "default": 0
    },
    "no_payment_declared": {
      "type": "integer",
      "title": "No Payment Declared",
      "description": "Listings (of total) that declared no payment methods, so appear under no payment type.",
      "default": 0
    }
  },
  "type": "object",
  "required": [
    "total",
    "by_task_category",
    "by_listing_type",
    "by_network",
    "by_source"
  ]
}