API

API

What is the Scout API for?

The Scout API supports third-party dashboards and exporting summary data from your applications. It provides access to application metrics via HTTP endpoints.

How do I get an API token?

  1. Log into Scout APM
  2. Go to your organization’s settings
  3. Enter a name for the token and generate it

How do I authenticate API requests?

Include your API key via one of these methods: - HTTP header: X-SCOUT-API: your_key - JSON request body: {"key": "your_key"} - Query string: ?key=your_key

What’s the API response format?

All endpoints return JSON with a header and results:

{"header":{"status":{"code":200,"message":"OK"},"apiVersion":"0.1"},"results":{...}}

How do I list my applications?

curl-H"X-SCOUT-API: your_key""https://scoutapm.com/api/v0/apps"

Returns:

{"results":{"apps":[{"name":"MyApp Production","id":101}]}}

How do I get application details?

curl-H"X-SCOUT-API: your_key""https://scoutapm.com/api/v0/apps/101"

What metrics are available?

Get available metrics for an app:

curl-H"X-SCOUT-API: your_key""https://scoutapm.com/api/v0/apps/101/metrics"

Available metrics include: - response_time - response_time_95th - errors - throughput - queue_time - apdex

How do I get metric data?

curl-H"X-SCOUT-API: your_key"\"https://scoutapm.com/api/v0/apps/101/metrics/response_time?from=2021-03-20T22:00:00Z&to=2021-03-27T21:00:00Z"

Parameters: - from: Start time (ISO8601 format) - to: End time (ISO8601 format)

The time range must not exceed 2 weeks.

What time steps does the API return?

Time steps vary based on duration:

Duration Time Step
30 min 1 minute
60 min 1 minute
3 hours 2 minutes
6 hours 5 minutes
12 hours 5 minutes
1 day 10 minutes
3 days 30 minutes
7 days 1 hour
14 days 2 hours