View as Markdown
Amplitude icon

Amplitude ACTION

Get User Activity

Fetch the event stream for a single user by their numeric Amplitude ID from the Amplitude Dashboard REST API. Each returned event defaults to just event_type and event_time; pass fields to also get e.g. event_properties, user_properties, uuid, session_id, amplitude_id, device_id (event objects can carry many properties, so these stay opt-in). Amplitude's API caps each request at 1000 events with no cursor; this tool pages offset forward automatically to collect up to limit events (set it above 1000, up to 5000, to fetch more than one page). Use Search Users first to resolve the Amplitude ID. Example: call with user=12345678, limit=50 -> returns {events: [{event_type: "Purchase", event_time: "2024-08-05 14:22:10"}, ...], userData: {...}, truncated: false} (truncated: true means more events likely exist beyond what was returned — raise limit/offset to fetch further). See the documentation.
  • Action
  • Read only
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Amplitude account once, then configure and run Get User Activity from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "amplitude-get-user-activity",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    amplitude: { authProvisionId: "apn_xxxxxxx" },
    user: 10,
    offset: 10,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Get User Activity inputs
Property Type Description
user User integer
The numeric Amplitude ID of the user (the user param). Example: 12345678. Use Search Users to resolve this from an email or User ID.
Required
offset Offset integer
Zero-indexed starting offset into the event stream (the offset param). Min 0. Amplitude documents no upper bound — raise this to page further back into an already-fetched user's history.
Optional
direction Direction string
Chronological direction (the direction param). One of earliest, latest. Defaults to latest.
Optional
limit Limit integer
Maximum number of events to return in total (the limit param, requested in pages of up to 1000). Min 1, max 5000. Defaults to 1000. Set above 1000 to fetch more than one page; check the response's truncated flag to see if more events exist beyond what was returned.
Optional
fields Fields string[]
Field names to return for each event (event_type and event_time are always included). Also available: event_properties, user_properties, uuid, session_id, amplitude_id, device_id. Pass only what you need to keep responses small.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
amplitude-get-user-activity
Version
0.0.2
App
Amplitude
Authentication
API key
Read-only
Yes
Destructive
No
Open world
Yes