---
title: "Take graph snapshots"
method: GET
path: "/api/v1/graph/snapshot"
tags: ["Snapshots"]
---

# Take graph snapshots

`GET /api/v1/graph/snapshot`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v1/graph/snapshot`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`

Take graph snapshots. Snapshots are PNG images generated by rendering a specified widget in a web page and capturing it once the data is available. The image is then uploaded to cloud storage.

**Note**: When a snapshot is created, there is some delay before it is available.

## Query parameters

- `metric_query` string
- `start` integer, required
- `end` integer, required
- `event_query` string
- `graph_def` string
- `title` string
- `height` integer
- `width` integer

## Response `200`

OK

- GraphSnapshot: Object representing a graph snapshot.
  - `graph_def` string: A JSON document defining the graph. `graph_def` can be used instead of `metric_query`. The JSON document uses the [grammar defined here](https://docs.datadoghq.com/graphing/graphing_json/#grammar) and should be formatted to a single line then URL encoded.
  - `metric_query` string: The metric query. One of `metric_query` or `graph_def` is required.
  - `snapshot_url` string: URL of your [graph snapshot](https://docs.datadoghq.com/metrics/explorer/#snapshot).

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v1-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/revisions/ca5871004d26?raw)
