Skip to main content

For AI agents: a Markdown version of this page is at https://docs.snowplow.io/docs/signals/applications/retrieve-attributes.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt, and the index for this section is at https://docs.snowplow.io/docs/signals/llms.txt.

Retrieve attributes in your application

Calculated attribute values are stored in the Profiles Store and consumed by your applications via the Python SDK, Node.js SDK, or API. If you'd rather an agent chose what to read at runtime, it can fetch attribute values itself through the Signals MCP server.

Start by connecting to Signals to create a Signals client object.

Use a service​

The preferred way to retrieve attributes is via a service, which lets you fetch attributes from multiple groups in one call. See Services to define one using the Console or Python SDK.

Use get_service_attributes() to retrieve attributes from a service.

python
calculated_values = sp_signals.get_service_attributes(
name="my_service",
attribute_key="domain_userid",
identifier="218e8926-3858-431d-b2ed-66da03a1cbe5",
)
ArgumentDescriptionTypeRequired?
nameThe name of the servicestring✅
attribute_keyThe attribute key to retrieve attributes for. Use the key the service's attribute groups are calculated on.string✅
identifierThe specific attribute key valuestring✅

Retrieve individual attributes​

You can also retrieve attributes directly from a specific attribute group, without a service. This is useful when you want a small subset of attributes or haven't defined a service yet.

Use get_group_attributes() to retrieve specific attributes.

python
calculated_values = sp_signals.get_group_attributes(
name="my_attribute_group",
version=1,
attributes=["page_view_count"],
attribute_key="domain_userid",
identifier="218e8926-3858-431d-b2ed-66da03a1cbe5",
)
ArgumentDescriptionTypeRequired?
nameThe name of the attribute groupstring✅
versionThe attribute group versionint✅
attributesThe names of the attributes to retrievestring or list of string✅
attribute_keyThe attribute key name. Use the key the attribute group is calculated on.string✅
identifierThe specific attribute key valuestring✅

Handle the response​

A read returns an object with one entry per attribute. For example, a service with session attributes returns:

json
{
"page_views_count": 12,
"unique_pages_viewed": 5,
"first_event_timestamp": "2026-04-09T14:23:01.000Z",
"last_event_timestamp": "2026-04-09T14:41:03.000Z"
}

When you handle the response:

  • If Signals hasn't seen the identifier on an event yet, each attribute is null.
  • Read with the attribute key that the attribute groups in the service are calculated on. For attributes keyed on snowplow_id, reading by any key other than snowplow_id or one of its lookup identifiers returns an HTTP 400 error.
  • Reads need an API key, so they run on your backend. A web app passes domain_userid or domain_sessionid from the browser to its server, for example as a request parameter. Read the session ID with the browser tracker's getDomainSessionId method.

To use retrieved attributes in a demo app, follow Build a personalized travel agent or Score prospects in real time.

Was this page helpful?