amplitude
Amplitude product analytics API. Use when user mentions "Amplitude", "product analytics", "event export", "funnel analysis", "user retention", "behavioral cohorts", or "event ingestion".
What this skill does
## Troubleshooting
If requests fail, run `zero doctor check-connector --env-name AMPLITUDE_API_KEY` or `zero doctor check-connector --url https://amplitude.com/api/2/events/segmentation --method GET`
## How to Use
All examples below assume `AMPLITUDE_API_KEY` and `AMPLITUDE_SECRET_KEY` are set. Amplitude's dashboard REST and Export APIs use HTTP Basic Auth with the API key as the username and the secret key as the password. The ingestion API (HTTP V2) embeds the API key in the request body instead.
- Dashboard + Export host: `https://amplitude.com` (EU: `https://analytics.eu.amplitude.com`)
- Ingestion host: `https://api2.amplitude.com` (EU: `https://api.eu.amplitude.com`)
Pass credentials to curl with `-u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY"`.
### 1. Export Raw Events
Export all events for a time range. Start and end use `YYYYMMDDTHH` format (hourly, UTC). Returns a ZIP archive of gzipped JSON lines.
```bash
curl -s -X GET "https://amplitude.com/api/2/export?start=20260101T00&end=20260101T23" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY" -o /tmp/amplitude_export.zip
```
Limits: max 365-day window; data available 2+ hours after ingestion.
### 2. Event Segmentation (Dashboard Chart Data)
Get counts or uniques for an event over a date range. Parameters `e`, `start`, `end` are required; `i` sets the interval (1 = daily, -300000 = realtime 5-min, etc.).
Write to `/tmp/amplitude_event.json`:
```json
{
"event_type": "Song Played"
}
```
Then run. `--data-urlencode` reads the JSON from the file so special characters in event names don't break the URL:
```bash
curl -s -G "https://amplitude.com/api/2/events/segmentation" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY" --data-urlencode "e@/tmp/amplitude_event.json" --data-urlencode "start=20260101" --data-urlencode "end=20260107" --data-urlencode "i=1"
```
### 3. Funnel Analysis
Compute conversion across a sequence of events. Each `e` parameter is a JSON event definition; repeat `e` for each step.
Write to `/tmp/amplitude_step1.json`:
```json
{
"event_type": "View Product"
}
```
Write to `/tmp/amplitude_step2.json`:
```json
{
"event_type": "Add to Cart"
}
```
Write to `/tmp/amplitude_step3.json`:
```json
{
"event_type": "Purchase"
}
```
Then run:
```bash
curl -s -G "https://amplitude.com/api/2/funnels" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY" --data-urlencode "e@/tmp/amplitude_step1.json" --data-urlencode "e@/tmp/amplitude_step2.json" --data-urlencode "e@/tmp/amplitude_step3.json" --data-urlencode "start=20260101" --data-urlencode "end=20260107"
```
### 4. Retention Analysis
Compute retention between a starting event and a returning event.
Write to `/tmp/amplitude_start.json`:
```json
{
"event_type": "Sign Up"
}
```
Write to `/tmp/amplitude_return.json`:
```json
{
"event_type": "Active User"
}
```
Then run:
```bash
curl -s -G "https://amplitude.com/api/2/retention" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY" --data-urlencode "se@/tmp/amplitude_start.json" --data-urlencode "re@/tmp/amplitude_return.json" --data-urlencode "start=20260101" --data-urlencode "end=20260107"
```
### 5. User Search
Look up a user by Amplitude ID, user ID, device ID, or email.
```bash
curl -s -G "https://amplitude.com/api/2/usersearch" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY" --data-urlencode "[email protected]"
```
### 6. User Activity Stream
Get a single user's recent events. Replace `<amplitude-id>` with the numeric Amplitude ID from the user search response:
```bash
curl -s -G "https://amplitude.com/api/2/useractivity" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY" --data-urlencode "user=<amplitude-id>"
```
### 7. Behavioral Cohorts
List all cohorts for the project:
```bash
curl -s -X GET "https://amplitude.com/api/3/cohorts" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY"
```
Download cohort membership. Replace `<cohort-id>` with an ID from the list response:
```bash
curl -s -X GET "https://amplitude.com/api/5/cohorts/request/<cohort-id>" -u "$AMPLITUDE_API_KEY:$AMPLITUDE_SECRET_KEY"
```
### 8. Ingest Events (HTTP V2)
Send events directly to Amplitude. The HTTP V2 endpoint does **not** use Basic auth — the API key goes in the JSON body as `api_key`.
Write to `/tmp/amplitude_ingest.json`:
```json
{
"api_key": "REPLACE_WITH_AMPLITUDE_API_KEY",
"events": [
{
"user_id": "user-123",
"event_type": "Button Clicked",
"event_properties": {
"button_name": "signup"
},
"time": 1767225600000
}
]
}
```
Substitute the env var into the file before posting, then ingest:
```bash
sed -i "s/REPLACE_WITH_AMPLITUDE_API_KEY/$AMPLITUDE_API_KEY/" /tmp/amplitude_ingest.json
curl -s -X POST "https://api2.amplitude.com/2/httpapi" --header "Content-Type: application/json" -d @/tmp/amplitude_ingest.json
```
## Guidelines
1. **Basic auth credential order**: always `api_key:secret_key` (API key is the username, secret key is the password). Reversing the order silently returns 401.
2. **Two distinct credentials**: the API key alone is enough for ingestion; dashboard/export endpoints require **both** the API key and the secret key.
3. **EU data residency**: if your project is on the EU cluster, swap `amplitude.com` → `analytics.eu.amplitude.com` and `api2.amplitude.com` → `api.eu.amplitude.com`.
4. **Rate limits**: dashboard REST is ~1000 queries/hour per project; Export tops out at 4 GB per call; ingestion accepts up to 1000 events per request.
5. **Timestamp formats**: dashboard endpoints take `YYYYMMDD`; Export takes `YYYYMMDDTHH` (UTC hours); ingestion takes Unix milliseconds in `time`.
6. **Never expose the secret key** client-side — it grants full project-read access to raw events.
## API Reference
- Authentication: https://amplitude.com/docs/apis/authentication
- Export API: https://amplitude.com/docs/apis/analytics/export
- Dashboard REST: https://amplitude.com/docs/apis/analytics/dashboard-rest
- HTTP V2 Ingestion: https://amplitude.com/docs/apis/analytics/http-v2
- Behavioral Cohorts: https://amplitude.com/docs/apis/analytics/behavioral-cohorts
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".