---
title: Domain Inspector Real-time API
summary: The real-time domain metrics API allows you to programmatically retrieve per-domain delivery metrics derived from your Fastly services in one-second periods up to the last complete second.
url: https://www.fastly.com/documentation/reference/api/metrics-stats/domain-inspector/real-time
---

The real-time domain metrics API allows you to programmatically retrieve per-domain delivery metrics derived from your Fastly services in one-second periods up to the last complete second.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `AggregateDelay` | integer | Offset of entry timestamps from the current time due to processing time. |
| `Data` | array | A list of report <a href="#entry-data-model">entries</a>, each representing one second of time. |
| `Timestamp` | integer | Value to use for subsequent requests. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `bandwidth` | integer | Total bytes delivered (<code>resp_header_bytes</code> + <code>resp_body_bytes</code> + <code>bereq_header_bytes</code> + <code>bereq_body_bytes</code>). |
| `bereq_body_bytes` | integer | Total body bytes sent to origin. |
| `bereq_header_bytes` | integer | Total header bytes sent to origin. |
| `compute_bereq_body_bytes` | integer | Total body bytes sent to backends (origins) by the Compute platform. |
| `compute_bereq_errors` | integer | Number of backend request errors, including timeouts, by the Compute platform. |
| `compute_bereq_header_bytes` | integer | Total header bytes sent to backends (origins) by the Compute platform. |
| `compute_bereqs` | integer | Number of backend requests started by the Compute platform. |
| `compute_beresp_body_bytes` | integer | Total body bytes received from backends (origins) by the Compute platform. |
| `compute_beresp_header_bytes` | integer | Total header bytes received from backends (origins) by the Compute platform. |
| `compute_execution_time_ms` | integer | The amount of active CPU time used to process your requests (in milliseconds). |
| `compute_origin_status_1xx` | integer | Number of "Informational" category status codes received from origin by the Compute platform. |
| `compute_origin_status_200` | integer | Number of responses received from origin with status code 200 (Success) by the Compute platform. |
| `compute_origin_status_204` | integer | Number of responses received from origin with status code 204 (No Content) by the Compute platform. |
| `compute_origin_status_206` | integer | Number of responses received from origin with status code 206 (Partial Content) by the Compute platform. |
| `compute_origin_status_2xx` | integer | Number of "Success" status codes received from origin by the Compute platform. |
| `compute_origin_status_301` | integer | Number of responses received from origin with status code 301 (Moved Permanently) by the Compute platform. |
| `compute_origin_status_302` | integer | Number of responses received from origin with status code 302 (Found) by the Compute platform. |
| `compute_origin_status_304` | integer | Number of responses received from origin with status code 304 (Not Modified) by the Compute platform. |
| `compute_origin_status_3xx` | integer | Number of "Redirection" codes received from origin by the Compute platform. |
| `compute_origin_status_400` | integer | Number of responses received from origin with status code 400 (Bad Request) by the Compute platform. |
| `compute_origin_status_401` | integer | Number of responses received from origin with status code 401 (Unauthorized) by the Compute platform. |
| `compute_origin_status_403` | integer | Number of responses received from origin with status code 403 (Forbidden) by the Compute platform. |
| `compute_origin_status_404` | integer | Number of responses received from origin with status code 404 (Not Found) by the Compute platform. |
| `compute_origin_status_416` | integer | Number of responses received from origin with status code 416 (Range Not Satisfiable) by the Compute platform. |
| `compute_origin_status_429` | integer | Number of responses received from origin with status code 429 (Too Many Requests) by the Compute platform. |
| `compute_origin_status_4xx` | integer | Number of "Client Error" codes received from origin by the Compute platform. |
| `compute_origin_status_500` | integer | Number of responses received from origin with status code 500 (Internal Server Error) by the Compute platform. |
| `compute_origin_status_501` | integer | Number of responses received from origin with status code 501 (Not Implemented) by the Compute platform. |
| `compute_origin_status_502` | integer | Number of responses received from origin with status code 502 (Bad Gateway) by the Compute platform. |
| `compute_origin_status_503` | integer | Number of responses received from origin with status code 503 (Service Unavailable) by the Compute platform. |
| `compute_origin_status_504` | integer | Number of responses received from origin with status code 504 (Gateway Timeout) by the Compute platform. |
| `compute_origin_status_505` | integer | Number of responses received from origin with status code 505 (HTTP Version Not Supported) by the Compute platform. |
| `compute_origin_status_530` | integer | Number of responses received from origin with status code 530 by the Compute platform. |
| `compute_origin_status_5xx` | integer | Number of "Server Error" codes received from origin by the Compute platform. |
| `compute_req_body_bytes` | integer | Total body bytes received by the Compute platform. |
| `compute_req_header_bytes` | integer | Total header bytes received by the Compute platform. |
| `compute_request` | integer | The total number of requests that were received by the Compute platform. |
| `compute_request_time_billed_ms` | integer | The total amount of request processing time you will be billed for, measured in 50 millisecond increments. |
| `compute_request_time_ms` | integer | The total amount of time used to process your requests, including active CPU time (in milliseconds). |
| `compute_resp_body_bytes` | integer | Total body bytes sent from Compute to the end user. |
| `compute_resp_header_bytes` | integer | Total header bytes sent from Compute to the end user. |
| `compute_resp_status_103` | integer | Number of responses delivered with status code 103 (Early Hints) by the Compute platform. |
| `compute_resp_status_1xx` | integer | Number of 1xx "Informational" category status codes delivered by the Compute platform. |
| `compute_resp_status_200` | integer | Number of responses delivered with status code 200 (Success) by the Compute platform. |
| `compute_resp_status_204` | integer | Number of responses delivered with status code 204 (No Content) by the Compute platform. |
| `compute_resp_status_206` | integer | Number of responses delivered with status code 206 (Partial Content) by the Compute platform. |
| `compute_resp_status_2xx` | integer | Number of 2xx "Success" status codes delivered by the Compute platform. |
| `compute_resp_status_301` | integer | Number of responses delivered with status code 301 (Moved Permanently) by the Compute platform. |
| `compute_resp_status_302` | integer | Number of responses delivered with status code 302 (Found) by the Compute platform. |
| `compute_resp_status_304` | integer | Number of responses delivered with status code 304 (Not Modified) by the Compute platform. |
| `compute_resp_status_3xx` | integer | Number of 3xx "Redirection" codes delivered by the Compute platform. |
| `compute_resp_status_400` | integer | Number of responses delivered with status code 400 (Bad Request) by the Compute platform. |
| `compute_resp_status_401` | integer | Number of responses delivered with status code 401 (Unauthorized) by the Compute platform. |
| `compute_resp_status_403` | integer | Number of responses delivered with status code 403 (Forbidden) by the Compute platform. |
| `compute_resp_status_404` | integer | Number of responses delivered with status code 404 (Not Found) by the Compute platform. |
| `compute_resp_status_416` | integer | Number of responses delivered with status code 416 (Range Not Satisfiable) by the Compute platform. |
| `compute_resp_status_429` | integer | Number of responses delivered with status code 429 (Too Many Requests) by the Compute platform. |
| `compute_resp_status_4xx` | integer | Number of 4xx "Client Error" codes delivered by the Compute platform. |
| `compute_resp_status_500` | integer | Number of responses delivered with status code 500 (Internal Server Error) by the Compute platform. |
| `compute_resp_status_501` | integer | Number of responses delivered with status code 501 (Not Implemented) by the Compute platform. |
| `compute_resp_status_502` | integer | Number of responses delivered with status code 502 (Bad Gateway) by the Compute platform. |
| `compute_resp_status_503` | integer | Number of responses delivered with status code 503 (Service Unavailable) by the Compute platform. |
| `compute_resp_status_504` | integer | Number of responses delivered with status code 504 (Gateway Timeout) by the Compute platform. |
| `compute_resp_status_505` | integer | Number of responses delivered with status code 505 (HTTP Version Not Supported) by the Compute platform. |
| `compute_resp_status_530` | integer | Number of responses delivered with status code 530 by the Compute platform. |
| `compute_resp_status_5xx` | integer | Number of "Server Error" category status codes delivered by the Compute platform. |
| `edge_hit_ratio` | number | Ratio of cache hits to cache misses at the edge, between 0 and 1 (<code>edge_hit_requests</code> / (<code>edge_hit_requests</code> + <code>edge_miss_requests</code>)). |
| `edge_hit_requests` | integer | Number of requests sent by end users to Fastly that resulted in a hit at the edge. |
| `edge_miss_requests` | integer | Number of requests sent by end users to Fastly that resulted in a miss at the edge. |
| `edge_requests` | integer | Number of requests sent by end users to Fastly. |
| `edge_resp_body_bytes` | integer | Total body bytes delivered from Fastly to the end user. |
| `edge_resp_header_bytes` | integer | Total header bytes delivered from Fastly to the end user. |
| `origin_fetch_resp_body_bytes` | integer | Total body bytes received from origin. |
| `origin_fetch_resp_header_bytes` | integer | Total header bytes received from origin. |
| `origin_fetches` | integer | Number of requests sent to origin. |
| `origin_offload` | number | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((<code>edge_resp_body_bytes</code> + <code>edge_resp_header_bytes</code>) - (<code>origin_fetch_resp_body_bytes</code> + <code>origin_fetch_resp_header_bytes</code>)) / (<code>edge_resp_body_bytes</code> + <code>edge_resp_header_bytes</code>). Previously, Origin Offload used a different formula. <a href="https://www.fastly.com/documentation/reference/changes/2024/06/add-origin_offload-metric">Learn more</a>. |
| `origin_status_1xx` | integer | Number of "Informational" category status codes received from origin. |
| `origin_status_200` | integer | Number of responses received from origin with status code 200 (Success). |
| `origin_status_204` | integer | Number of responses received from origin with status code 204 (No Content). |
| `origin_status_206` | integer | Number of responses received from origin with status code 206 (Partial Content). |
| `origin_status_2xx` | integer | Number of "Success" status codes received from origin. |
| `origin_status_301` | integer | Number of responses received from origin with status code 301 (Moved Permanently). |
| `origin_status_302` | integer | Number of responses received from origin with status code 302 (Found). |
| `origin_status_304` | integer | Number of responses received from origin with status code 304 (Not Modified). |
| `origin_status_3xx` | integer | Number of "Redirection" codes received from origin. |
| `origin_status_400` | integer | Number of responses received from origin with status code 400 (Bad Request). |
| `origin_status_401` | integer | Number of responses received from origin with status code 401 (Unauthorized). |
| `origin_status_403` | integer | Number of responses received from origin with status code 403 (Forbidden). |
| `origin_status_404` | integer | Number of responses received from origin with status code 404 (Not Found). |
| `origin_status_416` | integer | Number of responses received from origin with status code 416 (Range Not Satisfiable). |
| `origin_status_429` | integer | Number of responses received from origin with status code 429 (Too Many Requests). |
| `origin_status_4xx` | integer | Number of "Client Error" codes received from origin. |
| `origin_status_500` | integer | Number of responses received from origin with status code 500 (Internal Server Error). |
| `origin_status_501` | integer | Number of responses received from origin with status code 501 (Not Implemented). |
| `origin_status_502` | integer | Number of responses received from origin with status code 502 (Bad Gateway). |
| `origin_status_503` | integer | Number of responses received from origin with status code 503 (Service Unavailable). |
| `origin_status_504` | integer | Number of responses received from origin with status code 504 (Gateway Timeout). |
| `origin_status_505` | integer | Number of responses received from origin with status code 505 (HTTP Version Not Supported). |
| `origin_status_530` | integer | Number of responses received from origin with status code 530. |
| `origin_status_5xx` | integer | Number of "Server Error" codes received from origin. |
| `requests` | integer | Number of requests processed. |
| `resp_body_bytes` | integer | Total body bytes delivered. |
| `resp_header_bytes` | integer | Total header bytes delivered. |
| `status_1xx` | integer | Number of 1xx "Informational" category status codes delivered. |
| `status_200` | integer | Number of responses delivered with status code 200 (Success). |
| `status_204` | integer | Number of responses delivered with status code 204 (No Content). |
| `status_206` | integer | Number of responses delivered with status code 206 (Partial Content). |
| `status_2xx` | integer | Number of 2xx "Success" status codes delivered. |
| `status_301` | integer | Number of responses delivered with status code 301 (Moved Permanently). |
| `status_302` | integer | Number of responses delivered with status code 302 (Found). |
| `status_304` | integer | Number of responses delivered with status code 304 (Not Modified). |
| `status_3xx` | integer | Number of 3xx "Redirection" codes delivered. |
| `status_400` | integer | Number of responses delivered with status code 400 (Bad Request). |
| `status_401` | integer | Number of responses delivered with status code 401 (Unauthorized). |
| `status_403` | integer | Number of responses delivered with status code 403 (Forbidden). |
| `status_404` | integer | Number of responses delivered with status code 404 (Not Found). |
| `status_416` | integer | Number of responses delivered with status code 416 (Range Not Satisfiable). |
| `status_429` | integer | Number of responses delivered with status code 429 (Too Many Requests). |
| `status_4xx` | integer | Number of 4xx "Client Error" codes delivered. |
| `status_500` | integer | Number of responses delivered with status code 500 (Internal Server Error). |
| `status_501` | integer | Number of responses delivered with status code 501 (Not Implemented). |
| `status_502` | integer | Number of responses delivered with status code 502 (Bad Gateway). |
| `status_503` | integer | Number of responses delivered with status code 503 (Service Unavailable). |
| `status_504` | integer | Number of responses delivered with status code 504 (Gateway Timeout). |
| `status_505` | integer | Number of responses delivered with status code 505 (HTTP Version Not Supported). |
| `status_530` | integer | Number of responses delivered with status code 530. |
| `status_5xx` | integer | Number of 5xx "Server Error" codes delivered. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `aggregated` | object | Groups <a href="#measurements-data-model">measurements</a> by backend name and then by IP address. |
| `datacenter` | object | Groups <a href="#measurements-data-model">measurements</a> by POP, then backend name, and then IP address. See the <a href="https://www.fastly.com/documentation/reference/api/utils/pops/">POPs API</a> for details about POP identifiers. |
| `recorded` | integer | The Unix timestamp at which this record's data was generated. |

## API endpoints

### Get real-time domain data from a specified time

**GET** `/v1/domains/{service_id}/ts/{start_timestamp}`

Get real-time domain data for the specified reporting period. Specify <code>0</code> to get a single entry for the last complete second. The <code>Timestamp</code> field included in the response provides the time index of the latest entry in the dataset and can be provided as the <code>start_timestamp</code> of the next request for a seamless continuation of the dataset from one request to the next.
Due to processing latency, the earliest entry in the response dataset may be earlier than <code>start_timestamp</code> by the value of <code>AggregateDelay</code>.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `start_timestamp` | integer | path | Yes | Timestamp in seconds (Unix epoch time). |

### Get real-time domain data for the last 120 seconds

**GET** `/v1/domains/{service_id}/ts/h`

Get data for the 120 seconds preceding the latest timestamp available for a service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Get a limited number of real-time domain data entries

**GET** `/v1/domains/{service_id}/ts/h/limit/{max_entries}`

Get data for the <code>max_entries</code> seconds preceding the latest timestamp available for a service, up to a maximum of 120 entries.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `max_entries` | integer | path | Yes | Maximum number of results to show. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

