:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(customer-analytics): add value suggestions endpoint for account custom properties (#69500)
Arthur Moreira de Deus8bc5689ed696
diff --git a/products/customer_analytics/backend/facade/api.py b/products/customer_analytics/backend/facade/api.pyindex 9b2f2a7800ae..d9a13e9bf215 100644--- a/products/customer_analytics/backend/facade/api.py+++ b/products/customer_analytics/backend/facade/api.py@@ -868,6 +868,14 @@ def get_custom_property_definition(return _to_custom_property_definition_view(definition, references)+def list_custom_property_value_suggestions(team_id: int, definition_id: str, search: str | None) -> list[str]:+ """Suggested filter values for a custom property — see the logic function for the per-type+ behavior. Empty for unknown definitions."""+ return _custom_property_values_logic.list_custom_property_value_suggestions(+ team_id=team_id, definition_id=definition_id, search=search+ )++def create_custom_property_definition(*,team_id: int,diff --git a/products/customer_analytics/backend/facade/hogql.py b/products/customer_analytics/backend/facade/hogql.pyindex f45c39b26d89..acfad18b5178 100644--- a/products/customer_analytics/backend/facade/hogql.py+++ b/products/customer_analytics/backend/facade/hogql.py@@ -154,8 +154,14 @@ def _account_notebooks_select() -> ast.SelectQuery | ast.SelectSetQuery:# A custom property value is stored across four typed columns (exactly one non-null per row);# coalesce them to a single string so any display type round-trips through one column.+# Booleans render as 'true'/'false' explicitly: the federated read maps PostgreSQL boolean to+# UInt8, so toString() would yield '1'/'0' — which filters and value suggestions don't speak.+# The isNull guard keeps non-boolean rows falling through the coalesce (ClickHouse if()+# treats a NULL condition as false, which would otherwise coalesce them to 'false')._COALESCED_VALUE = (- "coalesce(cpv.value_str, toString(cpv.value_num), toString(cpv.value_bool), toString(cpv.value_datetime))"+ "coalesce(cpv.value_str, toString(cpv.value_num),"+ " if(isNull(cpv.value_bool), NULL, if(cpv.value_bool, 'true', 'false')),"+ " toString(cpv.value_datetime))")diff --git a/products/customer_analytics/backend/hogql_queries/test/test_accounts_query_runner.py b/products/customer_analytics/backend/hogql_queries/test/test_accounts_query_runner.pyindex acf00068b904..45343de2ca9b 100644--- a/products/customer_analytics/backend/hogql_queries/test/test_accounts_query_runner.py+++ b/products/customer_analytics/backend/hogql_queries/test/test_accounts_query_runner.py@@ -1,3 +1,5 @@+from datetime import UTC, datetime+from posthog.test.base import ClickhouseTestMixin, NonAtomicBaseTestfrom django.test import override_settings@@ -474,6 +476,53 @@ class TestAccountsQueryRunner(ClickhouseTestMixin, NonAtomicBaseTest):)self.assertEqual(names, ["Match"])+ def test_filter_expression_can_reference_a_custom_property_not_in_select(self):+ definition = create_custom_property_definition(team_id=self.team.id, name="Plan")+ match = create_account(team_id=self.team.id, name="Enterprise co")+ create_account(team_id=self.team.id, name="No value")+ CustomPropertyValue.objects.unscoped().create(+ team_id=self.team.id, account=match, definition=definition, value_str="enterprise"+ )+ # The custom-property filter UI compiles to filterExpression fragments like this, and the+ # filtered property is usually not a selected column — the WHERE reference alone must+ # expand the custom_properties lazy join.+ names = self._names(filterExpression=f"accounts.custom_properties.values.`{definition.id}` = 'enterprise'")+ self.assertEqual(names, ["Enterprise co"])++ @parameterized.expand(+ [+ (+ "boolean",+ {"value_bool": True},+ {"value_bool": False},+ "accounts.custom_properties.values.`{id}` = 'true'",+ ),+ (+ "datetime",+ {"value_datetime": datetime(2026, 1, 10, tzinfo=UTC)},+ {"value_datetime": datetime(2026, 6, 10, tzinfo=UTC)},+ "parseDateTimeBestEffort(accounts.custom_properties.values.`{id}`) < parseDateTimeBestEffort('2026-03-01')",+ ),+ ]+ )+ def test_typed_custom_property_filter_expression_round_trips(+ self, display_type, match_value, other_value, expression_template+ ):+ # These are the exact predicate shapes the filter UI compiles; they must match against+ # the coalesced string column as it comes back through the federated read (where e.g.+ # a PostgreSQL boolean arrives as UInt8, not as 'true'/'false').+ definition = create_custom_property_definition(team_id=self.team.id, name="Prop", display_type=display_type)+ match = create_account(team_id=self.team.id, name="Match")+ other = create_account(team_id=self.team.id, name="Other")+ CustomPropertyValue.objects.unscoped().create(+ team_id=self.team.id, account=match, definition=definition, **match_value+ )+ CustomPropertyValue.objects.unscoped().create(+ team_id=self.team.id, account=other, definition=definition, **other_value+ )+ names = self._names(filterExpression=expression_template.format(id=definition.id))+ self.assertEqual(names, ["Match"])+def test_custom_property_value_round_trips_through_a_selected_alias(self):account = create_account(team_id=self.team.id, name="A")definition = create_custom_property_definition(team_id=self.team.id, name="Plan")diff --git a/products/customer_analytics/backend/logic/custom_property_values.py b/products/customer_analytics/backend/logic/custom_property_values.pyindex 7cefbbb89865..179361616adc 100644--- a/products/customer_analytics/backend/logic/custom_property_values.py+++ b/products/customer_analytics/backend/logic/custom_property_values.py@@ -169,6 +169,70 @@ def list_active_custom_property_values(*, team_id: int, account_id: str | UUID))+VALUE_SUGGESTIONS_LIMIT = 50+++def list_custom_property_value_suggestions(*, team_id: int, definition_id: str | UUID, search: str | None) -> list[str]:+ """Suggested filter values for a custom property: a select's option labels, a boolean's+ true/false, otherwise distinct active values across the team's accounts. Empty when the+ definition doesn't exist — suggestions are best-effort, not an error surface."""+ try:+ definition = CustomPropertyDefinition.objects.for_team(team_id).get(id=definition_id)+ except (CustomPropertyDefinition.DoesNotExist, ValidationError, ValueError):+ return []++ needle = (search or "").strip().lower()++ if definition.display_type == DisplayType.SELECT:+ labels = [str(option.get("label") or "") for option in definition.options or []]+ return [label for label in labels if label and needle in label.lower()][:VALUE_SUGGESTIONS_LIMIT]+ if definition.data_type == DataType.BOOLEAN:+ return [value for value in ("true", "false") if needle in value]+ if definition.data_type == DataType.DATETIME:+ # Date filters render a date picker, not text suggestions.+ return []++ queryset = CustomPropertyValue.objects.for_team(team_id).filter(definition_id=definition.id, is_deleted=False)++ if definition.data_type == DataType.NUMERIC:+ numeric_values = (+ queryset.exclude(value_num__isnull=True)+ .values_list("value_num", flat=True)+ .distinct()+ .order_by("value_num")+ )+ # The needle matches the *formatted* numeric string, which the database can't compute —+ # filter in Python and stop once the limit fills, instead of slicing the queryset first.+ suggestions: list[str] = []+ for value in numeric_values.iterator():+ formatted = _format_numeric_suggestion(value)+ if formatted is None or needle not in formatted:+ continue+ suggestions.append(formatted)+ if len(suggestions) == VALUE_SUGGESTIONS_LIMIT:+ break+ return suggestions++ if needle:+ queryset = queryset.filter(value_str__icontains=needle)+ string_values = (+ queryset.exclude(value_str__isnull=True)+ .values_list("value_str", flat=True)+ .distinct()+ .order_by("value_str")[:VALUE_SUGGESTIONS_LIMIT]+ )+ return [value for value in string_values if value is not None]+++def _format_numeric_suggestion(value: float | None) -> str | None:+ # Integral floats render without a trailing ".0", matching how the filter column displays+ # them. Non-finite values can't pass write-path coercion; skip a stray row rather than crash.+ # None only occurs in the type, not at runtime — the caller excludes null rows.+ if value is None or not math.isfinite(value):+ return None+ return str(int(value)) if value == int(value) else str(value)++def _assert_account_in_team(*, team_id: int, account_id: str | UUID) -> None:if not Account.objects.for_team(team_id).filter(id=account_id).exists():raise Account.DoesNotExist(f"Account {account_id} not found for team {team_id}")diff --git a/products/customer_analytics/backend/presentation/views/serializers.py b/products/customer_analytics/backend/presentation/views/serializers.pyindex 31dec9649b45..19f1990c2489 100644--- a/products/customer_analytics/backend/presentation/views/serializers.py+++ b/products/customer_analytics/backend/presentation/views/serializers.py@@ -517,6 +517,27 @@ class CustomPropertyValueSerializer(serializers.Serializer):)+class CustomPropertyValueSuggestionSerializer(serializers.Serializer):+ """One suggested filter value for a custom property."""++ name = serializers.CharField(read_only=True, help_text="A suggested value for the custom property.")+++class CustomPropertyValueSuggestionsResponseSerializer(serializers.Serializer):+ """Response shape of the custom property value-suggestions endpoint.++ Matches the contract of the shared property-values picker (``propertyDefinitionsModel``+ on the frontend), which expects ``{results: [{name}], refreshing}``.+ """++ results = CustomPropertyValueSuggestionSerializer(+ many=True, read_only=True, help_text="Suggested values matching the search input."+ )+ refreshing = serializers.BooleanField(+ read_only=True, help_text="Always false — present for compatibility with the property-values consumer."+ )++class AccountRelationshipDefinitionSerializer(DataclassSerializer):"""A team-defined account relationship type (CSM, Onboarding manager, ...)."""diff --git a/products/customer_analytics/backend/presentation/views/views.py b/products/customer_analytics/backend/presentation/views/views.pyindex fe0b58035e41..a955af943ab3 100644--- a/products/customer_analytics/backend/presentation/views/views.py+++ b/products/customer_analytics/backend/presentation/views/views.py@@ -47,6 +47,7 @@ from products.customer_analytics.backend.presentation.views.serializers import (CustomPropertySourceSerializer,CustomPropertySourceUpdateSerializer,CustomPropertyValueSerializer,+ CustomPropertyValueSuggestionsResponseSerializer,CustomPropertyValueWriteSerializer,)@@ -222,6 +223,33 @@ class CustomPropertyDefinitionViewSet(return Response({"detail": "Not found."}, status=status.HTTP_404_NOT_FOUND)return Response(CustomPropertyDefinitionSerializer(instance=definition).data)+ @extend_schema(+ parameters=[+ OpenApiParameter(+ name="key",+ type=OpenApiTypes.STR,+ location=OpenApiParameter.QUERY,+ required=True,+ description="Id of the custom property definition to suggest values for.",+ ),+ OpenApiParameter(+ name="value",+ type=OpenApiTypes.STR,+ location=OpenApiParameter.QUERY,+ required=False,+ description="Case-insensitive substring to narrow the suggestions.",+ ),+ ],+ responses={200: CustomPropertyValueSuggestionsResponseSerializer},+ )+ @action(methods=["GET"], detail=False, pagination_class=None)+ def values(self, request: Request, *args, **kwargs) -> Response:+ key = request.GET.get("key")+ if not key:+ return Response({"results": [], "refreshing": False})+ suggestions = api.list_custom_property_value_suggestions(self.team_id, key, request.GET.get("value"))+ return Response({"results": [{"name": value} for value in suggestions], "refreshing": False})+def create(self, request: Request, *args, **kwargs) -> Response:serializer = CustomPropertyDefinitionSerializer(data=request.data)serializer.is_valid(raise_exception=True)diff --git a/products/customer_analytics/backend/test/test_custom_property_values.py b/products/customer_analytics/backend/test/test_custom_property_values.pyindex 4ea447b75adc..37fbe875f2e1 100644--- a/products/customer_analytics/backend/test/test_custom_property_values.py+++ b/products/customer_analytics/backend/test/test_custom_property_values.py@@ -1,5 +1,5 @@from datetime import UTC, datetime-from uuid import uuid4+from uuid import UUID, uuid4import pytestfrom posthog.test.base import BaseTest@@ -18,10 +18,12 @@ from products.customer_analytics.backend.facade import (contracts,)from products.customer_analytics.backend.logic.custom_property_values import (+ VALUE_SUGGESTIONS_LIMIT,CustomPropertyDefinitionNotFound,CustomPropertyValueConflict,InvalidCustomPropertyValue,list_active_custom_property_values,+ list_custom_property_value_suggestions,set_account_custom_properties_by_id,set_custom_property_value,)@@ -270,6 +272,91 @@ class TestSetAccountCustomPropertiesById(BaseTest):assert exc_info.value.field == str(seats.id)+class TestListCustomPropertyValueSuggestions(BaseTest):+ def setUp(self):+ super().setUp()+ self.account = create_account(team_id=self.team.id)++ def _set(self, definition: CustomPropertyDefinition, value: object, account: Account | None = None) -> None:+ set_custom_property_value(+ team_id=self.team.id,+ account_id=(account or self.account).id,+ definition_id=definition.id,+ value=value,+ )++ def _suggestions(self, definition_id: str | UUID, search: str | None = None) -> list[str]:+ return list_custom_property_value_suggestions(team_id=self.team.id, definition_id=definition_id, search=search)++ def test_select_returns_option_labels_filtered_by_search(self):+ definition = create_custom_property_definition(+ team_id=self.team.id,+ name="Tier",+ display_type=DisplayType.SELECT,+ options=[*SELECT_OPTIONS, {"id": "opt-3", "color": "preset-3"}], # unlabeled option must not suggest+ )+ assert self._suggestions(definition.id) == ["Enterprise", "Startup"]+ assert self._suggestions(definition.id, search="ENT") == ["Enterprise"]++ def test_text_returns_distinct_active_values_only(self):+ definition = create_custom_property_definition(team_id=self.team.id, name="Region")+ other_account = create_account(team_id=self.team.id, name="Other", external_id="other-ext")+ self._set(definition, "emea")+ self._set(definition, "apac") # supersedes "emea" — the soft-deleted row must not suggest+ self._set(definition, "amer", account=other_account)+ assert self._suggestions(definition.id) == ["amer", "apac"]+ assert self._suggestions(definition.id, search="ap") == ["apac"]++ def test_boolean_suggests_true_false(self):+ definition = create_custom_property_definition(+ team_id=self.team.id, name="Active", display_type=DisplayType.BOOLEAN+ )+ assert self._suggestions(definition.id) == ["true", "false"]++ def test_numeric_values_render_like_clickhouse_tostring(self):+ definition = create_custom_property_definition(+ team_id=self.team.id, name="Seats", display_type=DisplayType.NUMBER+ )+ other_account = create_account(team_id=self.team.id, name="Other2", external_id="other-ext-2")+ self._set(definition, 10.0)+ self._set(definition, 2.5, account=other_account)+ assert self._suggestions(definition.id) == ["2.5", "10"]++ def test_numeric_search_matches_values_beyond_the_limit_window(self):+ definition = create_custom_property_definition(+ team_id=self.team.id, name="Seats", display_type=DisplayType.NUMBER+ )+ accounts = Account.objects.unscoped().bulk_create(+ Account(team_id=self.team.id, name=f"Account {i}") for i in range(VALUE_SUGGESTIONS_LIMIT + 10)+ )+ CustomPropertyValue.objects.unscoped().bulk_create(+ CustomPropertyValue(team_id=self.team.id, account=account, definition=definition, value_num=float(i))+ for i, account in enumerate(accounts)+ )+ # The match sorts after the first VALUE_SUGGESTIONS_LIMIT values — the search must not be+ # applied to a pre-sliced window.+ assert self._suggestions(definition.id, search=str(VALUE_SUGGESTIONS_LIMIT + 5)) == [+ str(VALUE_SUGGESTIONS_LIMIT + 5)+ ]++ def test_non_finite_numeric_rows_are_skipped(self):+ definition = create_custom_property_definition(+ team_id=self.team.id, name="Seats", display_type=DisplayType.NUMBER+ )+ # Write-path coercion rejects non-finite values, so plant a stray row directly; it must be+ # skipped rather than crash the suggestions.+ stray_account = create_account(team_id=self.team.id, name="Stray", external_id="stray-ext")+ CustomPropertyValue.objects.unscoped().create(+ team_id=self.team.id, account=stray_account, definition=definition, value_num=float("inf")+ )+ self._set(definition, 7.0)+ assert self._suggestions(definition.id) == ["7"]++ @parameterized.expand([("unknown_uuid", str(uuid4())), ("malformed", "not-a-uuid")])+ def test_unknown_definition_returns_empty(self, _name, definition_id):+ assert self._suggestions(definition_id) == []++class TestCustomPropertyValueFacade(BaseTest):def setUp(self):super().setUp()diff --git a/products/customer_analytics/backend/test/test_views.py b/products/customer_analytics/backend/test/test_views.pyindex 9f3195c56bd2..f2b521403703 100644--- a/products/customer_analytics/backend/test/test_views.py+++ b/products/customer_analytics/backend/test/test_views.py@@ -1544,6 +1544,26 @@ class TestCustomPropertyDefinitionViewSet(APIBaseTest):payload.update(overrides)return self.client.post(self.endpoint_base, payload, format="json")+ def test_values_returns_suggestions_envelope(self):+ created = self._create(+ name="Tier",+ display_type="select",+ is_big_number=False,+ options=[+ {"label": "Enterprise", "color": "preset-1"},+ {"label": "Startup", "color": "preset-2"},+ ],+ )+ definition_id = created.json()["id"]++ response = self.client.get(f"{self.endpoint_base}values/?key={definition_id}&value=ent")+ self.assertEqual(response.status_code, status.HTTP_200_OK)+ self.assertEqual(response.json(), {"results": [{"name": "Enterprise"}], "refreshing": False})++ missing_key = self.client.get(f"{self.endpoint_base}values/")+ self.assertEqual(missing_key.status_code, status.HTTP_200_OK)+ self.assertEqual(missing_key.json(), {"results": [], "refreshing": False})+def test_create_success(self):response = self._create()diff --git a/products/customer_analytics/frontend/generated/api.schemas.ts b/products/customer_analytics/frontend/generated/api.schemas.tsindex 67e8cf78c3ea..a1c1cc8abeff 100644--- a/products/customer_analytics/frontend/generated/api.schemas.ts+++ b/products/customer_analytics/frontend/generated/api.schemas.ts@@ -625,6 +625,27 @@ export interface PatchedCustomPropertyDefinitionApi {readonly references?: readonly CustomPropertyReferenceApi[]}+/**+ * One suggested filter value for a custom property.+ */+export interface CustomPropertyValueSuggestionApi {+ /** A suggested value for the custom property. */+ readonly name: string+}++/**+ * Response shape of the custom property value-suggestions endpoint.+ *+ * Matches the contract of the shared property-values picker (``propertyDefinitionsModel``+ * on the frontend), which expects ``{results: [{name}], refreshing}``.+ */+export interface CustomPropertyValueSuggestionsResponseApi {+ /** Suggested values matching the search input. */+ readonly results: readonly CustomPropertyValueSuggestionApi[]+ /** Always false — present for compatibility with the property-values consumer. */+ readonly refreshing: boolean+}+export interface PaginatedCustomPropertySourceListApi {count: number/** @nullable */@@ -1010,6 +1031,17 @@ export type CustomPropertyDefinitionsListParams = {offset?: number}+export type CustomPropertyDefinitionsValuesRetrieveParams = {+ /**+ * Id of the custom property definition to suggest values for.+ */+ key: string+ /**+ * Case-insensitive substring to narrow the suggestions.+ */+ value?: string+}+export type CustomPropertySourcesListParams = {/*** Number of results to return per page.diff --git a/products/customer_analytics/frontend/generated/api.ts b/products/customer_analytics/frontend/generated/api.tsindex bb3151170056..735ea4805350 100644--- a/products/customer_analytics/frontend/generated/api.ts+++ b/products/customer_analytics/frontend/generated/api.ts@@ -21,10 +21,12 @@ import type {AccountsRelationshipsListParams,CustomPropertyDefinitionApi,CustomPropertyDefinitionsListParams,+ CustomPropertyDefinitionsValuesRetrieveParams,CustomPropertySourceApi,CustomPropertySourceUpdateApi,CustomPropertySourcesListParams,CustomPropertyValueApi,+ CustomPropertyValueSuggestionsResponseApi,CustomPropertyValueWriteApi,CustomerJourneyApi,CustomerJourneysListParams,@@ -612,6 +614,39 @@ export const customPropertyDefinitionsDestroy = async (})}+export const getCustomPropertyDefinitionsValuesRetrieveUrl = (+ projectId: string,+ params: CustomPropertyDefinitionsValuesRetrieveParams+) => {+ const normalizedParams = new URLSearchParams()++ Object.entries(params || {}).forEach(([key, value]) => {+ if (value !== undefined) {+ normalizedParams.append(key, value === null ? 'null' : String(value))+ }+ })++ const stringifiedParams = normalizedParams.toString()++ return stringifiedParams.length > 0+ ? `/api/projects/${projectId}/custom_property_definitions/values/?${stringifiedParams}`+ : `/api/projects/${projectId}/custom_property_definitions/values/`+}++export const customPropertyDefinitionsValuesRetrieve = async (+ projectId: string,+ params: CustomPropertyDefinitionsValuesRetrieveParams,+ options?: RequestInit+): Promise<CustomPropertyValueSuggestionsResponseApi> => {+ return apiMutator<CustomPropertyValueSuggestionsResponseApi>(+ getCustomPropertyDefinitionsValuesRetrieveUrl(projectId, params),+ {+ ...options,+ method: 'GET',+ }+ )+}+export const getCustomPropertySourcesListUrl = (projectId: string, params?: CustomPropertySourcesListParams) => {const normalizedParams = new URLSearchParams()diff --git a/products/customer_analytics/mcp/tools.yaml b/products/customer_analytics/mcp/tools.yamlindex df905613e5a5..2baa5d26bc1f 100644--- a/products/customer_analytics/mcp/tools.yaml+++ b/products/customer_analytics/mcp/tools.yaml@@ -339,6 +339,9 @@ tools:custom-property-definitions-update:operation: custom_property_definitions_updateenabled: false+ custom-property-definitions-values-retrieve:+ operation: custom_property_definitions_values_retrieve+ enabled: falsecustom-property-sources-create:operation: custom_property_sources_createenabled: falsediff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 6d3a4b81ea2d..1fbb65bf83d0 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -14939,6 +14939,27 @@ export namespace Schemas {readonly created_by_id: number | null;}+ /**+ * One suggested filter value for a custom property.+ */+ export interface CustomPropertyValueSuggestion {+ /** A suggested value for the custom property. */+ readonly name: string;+ }++ /**+ * Response shape of the custom property value-suggestions endpoint.+ *+ * Matches the contract of the shared property-values picker (``propertyDefinitionsModel``+ * on the frontend), which expects ``{results: [{name}], refreshing}``.+ */+ export interface CustomPropertyValueSuggestionsResponse {+ /** Suggested values matching the search input. */+ readonly results: readonly CustomPropertyValueSuggestion[];+ /** Always false — present for compatibility with the property-values consumer. */+ readonly refreshing: boolean;+ }+export interface CustomPropertyValueWrite {/** UUID of the custom property definition whose value to set for this account. */definition: string;@@ -58955,6 +58976,17 @@ export namespace Schemas {offset?: number;};+ export type EnvironmentsCustomPropertyDefinitionsValuesRetrieveParams = {+ /**+ * Id of the custom property definition to suggest values for.+ */+ key: string;+ /**+ * Case-insensitive substring to narrow the suggestions.+ */+ value?: string;+ };+export type EnvironmentsCustomerJourneysListParams = {/*** Number of results to return per page.@@ -65220,6 +65252,17 @@ export namespace Schemas {offset?: number;};+ export type CustomPropertyDefinitionsValuesRetrieveParams = {+ /**+ * Id of the custom property definition to suggest values for.+ */+ key: string;+ /**+ * Case-insensitive substring to narrow the suggestions.+ */+ value?: string;+ };+export type CustomPropertySourcesListParams = {/*** Number of results to return per page.