# Graphite Render API

Contents

* [Graphite Render API](/api-guides/graphite-render-api.md)
  * [Render Endpoint](#render-endpoint)
  * [Examples](#examples)

With the Graphite Render API, you can:

* View raw metric data outside of your primary dashboards.
* Apply functions to your metric data.
* Search for data within a specific or relative time frame.
* Retrieve the data in different display formats.
* Use Graphite [Access Keys](https://docs.hostedgraphite.com/account-management/access-keys) to integrate metric data into external tools or services.

### [Render Endpoint](#render-endpoint)

## Render endpoint

<mark style="color:blue;">`GET`</mark> `/YOUR-UID/ACCESS-KEY/graphite/render?target=`

To integrate Hosted Graphite data externally, [Create an Access Key](/account-management/access-keys.md) to authorize render requests. Copy the key URL and add `/render?target=`

#### Path Parameters

| Name                                     | Type   | Description                                                                                                                                                                                                                                                  |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| target<mark style="color:red;">\*</mark> | String | This parameter specifies the path to identify one or more metrics,  supports wildcards (\*), and can be used with [Data Views](https://docs.hostedgraphite.com/additional-features/data-views).                                                              |
| from/to                                  | String | These parameters accept relative or absolute times (or both). Relative Time is the length of time from the current time and is always preceded by a minus sign (-). If no time parameters are specified, the default values are `from=now-24h` and `to=now`. |
| \&format=png                             | String | Renders a graph as a 330×250 px png (default option, if the \&format parameter is left unspecified).                                                                                                                                                         |
| \&format=svg                             | String | Renders a graph as a 330×250 px svg.                                                                                                                                                                                                                         |
| \&format=raw                             | String | Line-delimited output. (target, start timestamp, end timestamp, step, data)                                                                                                                                                                                  |
| \&format=csv                             | String | Creates a CSV file to download (metric, date/time, value)                                                                                                                                                                                                    |
| \&format=json                            | String | Returns a JSON object.                                                                                                                                                                                                                                       |

{% tabs %}
{% tab title="200 " %}
OK
{% endtab %}

{% tab title="403" %}
Forbidden Invalid
{% endtab %}
{% endtabs %}

The accepted units of time are:

| Abbreviation | Unit            |
| ------------ | --------------- |
| s            | Seconds         |
| min          | Minutes         |
| h            | Hours           |
| d            | Days            |
| w            | Weeks           |
| mon          | Month (30 Days) |
| y            | Year (365 Days) |

### [Examples](#examples)

Using the **sample** metric `foo.bar`, below are some example queries and outputs:

```
https://www.hostedgraphite.com/YOUR-UID/ACCESS-KEY/graphite/render?target=foo.bar&from=now-30min
```

<figure><img src="/files/FAaLs2G14Gqm5xxa7YCw" alt="" width="331"><figcaption><p>Default png render</p></figcaption></figure>

```
https://www.hostedgraphite.com/YOUR-UID/ACCESS-KEY/graphite/render?target=alias(foo.bar,"Uptime")&from=now-30min
```

<figure><img src="/files/8hxpEnsPjOhXI08XwJXL" alt="" width="331"><figcaption><p>Render with aliased metric</p></figcaption></figure>

```
https://www.hostedgraphite.com/YOUR-UID/ACCESS-KEY/graphite/render?target=foo.bar&from=now-30min&format=json
```

<figure><img src="/files/zatZv24OwkoLAL7lhvED" alt="" width="375"><figcaption><p>Render as json</p></figcaption></figure>

**Curl Example:**

```
curl -X GET "https://www.hostedgraphite.com/YOUR-UID/ACCESS-KEY/graphite/render?target=foo.bar&from=now-30min&format=json"
```

For more information about building queries and customizing outputs, visit the [Graphite Render Docs](https://graphite.readthedocs.io/en/latest/render_api.html).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hostedgraphite.com/api-guides/graphite-render-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
