Loading...
Loading...
Query Scout APM performance data via REST API. Use when investigating app performance, slow endpoints, error groups, traces, or insights like N+1 queries and memory bloat.
npx skill4agent add buildrtech/dotagents scout-apiexport SCOUT_API_KEY="your-token-here"https://scoutapm.com/api/v0X-SCOUT-API: $SCOUT_API_KEY?key=$SCOUT_API_KEY# List apps
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" "https://scoutapm.com/api/v0/apps"
# App details
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" "https://scoutapm.com/api/v0/apps/{id}"
# Available metrics for an app
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" "https://scoutapm.com/api/v0/apps/{id}/metrics"
# Metric time-series (requires from/to)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/metrics/{metric_type}?from=2026-02-18T00:00:00Z&to=2026-02-19T00:00:00Z"
# List endpoints (requires from/to)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/endpoints?from=2026-02-18T00:00:00Z&to=2026-02-19T00:00:00Z"
# Endpoint metrics (endpoint is base64-url-encoded)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/endpoints/{endpoint_b64}/metrics/{metric_type}?from=...&to=..."
# List traces for endpoint (max 100, within 7 days)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/endpoints/{endpoint_b64}/traces?from=...&to=..."
# Trace detail (includes spans)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/traces/{trace_id}"
# Error groups (max 100, within 30 days)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/error_groups?from=...&to=..."
# Error group detail (includes latest_error with stacktrace)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/error_groups/{error_id}"
# Individual errors in a group (max 100)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/error_groups/{error_id}/errors"
# All insights (cached 5 min)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/insights"
# Insights by type: n_plus_one | memory_bloat | slow_query
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/insights/{type}?limit=20"
# Insights history (cursor-paginated)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/insights/history?from=...&to=...&limit=10"
# Insights history by type
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/insights/history/{type}?from=...&to=...&limit=10"| Method | Path | Description |
|---|---|---|
| GET | | List all apps |
| GET | | Get app details |
| Method | Path | Params | Description |
|---|---|---|---|
| GET | | — | List available metric types |
| GET | | | Time-series data for a metric |
apdexresponse_timeresponse_time_95therrorsthroughputqueue_time| Method | Path | Params | Description |
|---|---|---|---|
| GET | | | List endpoints with stats |
| GET | | | Metric data for one endpoint |
{endpoint}# Encode "UsersController#index" → base64
echo -n "UsersController#index" | base64
# VXNlcnNDb250cm9sbGVyI2luZGV4| Method | Path | Params | Description |
|---|---|---|---|
| GET | | | List traces (max 100, 7-day window) |
| GET | | — | Trace detail with spans |
idtimetotal_call_timemem_deltametric_nameuricontextgit_shaallocations_countlimitedspans[]transaction_idhostname| Method | Path | Params | Description |
|---|---|---|---|
| GET | | | List error groups (max 100, 30-day window) |
| GET | | — | Error group detail + latest error |
| GET | | — | Individual errors (max 100) |
messagecreated_atrequest_paramsrequest_urilocationrequest_sessiontracecontext| Method | Path | Params | Description |
|---|---|---|---|
| GET | | | All insight types (cached 5 min) |
| GET | | | Single insight type |
| GET | | | Historical insights |
| GET | | (same as above) | Historical insights by type |
n_plus_onememory_bloatslow_querypagination.has_morepagination.pagination_cursorpagination.next_pagination_pagepagination_direction=forwardbackward| Duration | Step |
|---|---|
| ≤ 60 min | 1 minute |
| ≤ 3 hrs | 2 minutes |
| ≤ 12 hrs | 5 minutes |
| ≤ 1 day | 10 minutes |
| ≤ 3 days | 30 minutes |
| ≤ 7 days | 1 hour |
| ≤ 14 days | 2 hours |
{
"header": {
"status": { "code": 200, "message": "OK" },
"apiVersion": "0.1"
},
"results": { ... }
}403404422# 1. Find the app
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" "https://scoutapm.com/api/v0/apps" | jq '.results.apps[] | {id, name}'
# 2. List endpoints sorted by response time (last 24h)
FROM=$(date -u -v-1d +%Y-%m-%dT%H:%M:%SZ) # macOS
TO=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/endpoints?from=$FROM&to=$TO" \
| jq '.results | sort_by(-.response_time) | .[:10] | .[] | {name, response_time, throughput, error_rate}'
# 3. Get p95 response time series for the slowest endpoint
ENDPOINT_B64=$(echo -n "Controller#action" | base64)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/endpoints/$ENDPOINT_B64/metrics/response_time_95th?from=$FROM&to=$TO"
# 4. Pull traces to find the slow requests
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/endpoints/$ENDPOINT_B64/traces?from=$FROM&to=$TO" \
| jq '.results.traces | sort_by(-.total_call_time) | .[:5]'
# 5. Inspect the slowest trace's spans
TRACE_ID=12345
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/traces/$TRACE_ID" \
| jq '.results.trace.spans'# 1. List error groups (last 7 days)
FROM=$(date -u -v-7d +%Y-%m-%dT%H:%M:%SZ)
TO=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/error_groups?from=$FROM&to=$TO" \
| jq '.results.error_groups | sort_by(-.errors_count) | .[:10] | .[] | {id, name, message, errors_count, last_error_at}'
# 2. Get detail + latest stacktrace
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/error_groups/{error_id}" \
| jq '.results.error_group | {name, message, status, errors_count, latest_error}'# Quick overview — are there N+1s, memory bloat, or slow queries?
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/insights" \
| jq '.results.insights | to_entries[] | {type: .key, count: .value.count, new: .value.new_count}'
# Drill into N+1 queries
curl -sS -H "X-SCOUT-API: $SCOUT_API_KEY" \
"https://scoutapm.com/api/v0/apps/{id}/insights/n_plus_one?limit=10"fromto{endpoint}Users#indexfromto