> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Graphs API

Endpoint \[`GET`]:

| Endpoint                        | Description        |
| ------------------------------- | ------------------ |
| **/api/\[app\_id]/graphs.json** | Returns graph data |

Parameters:

| Param        | Type             | Description                                                    |
| ------------ | ---------------- | -------------------------------------------------------------- |
| kind         | string           | Aggregate of provided namespace (web, background, or your own) |
| action\_name | string           | Example: BlogPostsController-hash-show                         |
| from         | string (ISO8601) | Defaults to 1 day ago if nil                                   |
| to           | string (ISO8601) | Defaults to now if nil                                         |
| timeframe    | string           | Can be: \[hour, day, month, year]                              |
| fields       | array            | Can be: \[mean, count, ex\_count, ex\_rate, pct]               |

Either provide the `action_name` or `kind` parameter.
You can either specify the from an to values, **or** the timeframe value.

Valid timeframes are: `hour`, `day`, `month` and `year`

Valid fields are:

| Field     | Description                                          |
| --------- | ---------------------------------------------------- |
| mean      | mean response time                                   |
| count     | throughput                                           |
| ex\_count | exception count                                      |
| ex\_rate  | exception rate (percentage of exceptions from count) |
| pct       | 90 percentile (for slow requests only)               |

If you want an action and exception, concatenate the strings with `:|:` as a separator

So `BlogPostsController#show` with `Mongoid::RecordNotFound` becomes:
`BlogPostsController-hash-show:|:Mongoid::RecordNotFound"`

Example request:

```shell Shell theme={null}
/api/5534f7e38c5ce90000000000/graphs.json?action_name=BlogPostsController-hash-show&fields[]=mean&fields[]=pct&timeframe=month&token=aaa&from=2013-09-03T22:00:00+01:00&to=2013-10-04T00:00:00+01:00
```

This endpoint returns a JSON object:

<CodeGroup>
  ```json JSON theme={null}
  {
    "from": "2013-09-03T22:00:00Z",
    "to": "2013-10-04T00:00:00Z",
    "resolution": "hourly",
    "data": [
      {
        "timestamp": 1378245600,
        "mean": 13.51942822948383,
        "pct": 13.213056043635918
      }
    ]
  }
  ```
</CodeGroup>
