Fastly Real-Time Analytics API

Real-time analytics endpoints providing second-by-second stats for Fastly services, served from rt.fastly.com.

Operations 3

GET /v1/channel/{service_id}/ts/{start_timestamp} Get real-time analytics #
GET /v1/channel/{service_id}/ts/h Get real-time analytics for the last 120 seconds #
GET /v1/channel/{service_id}/ts/h/limit/{max_entries} Get real-time analytics with a limit #

Documentation

📖
Documentation
https://www.fastly.com/documentation/reference/api/services/
📖
Documentation
https://www.fastly.com/documentation/reference/api/purging/
📖
Documentation
https://www.fastly.com/documentation/reference/api/logging/
📖
Documentation
https://www.fastly.com/documentation/reference/api/metrics-stats/
📖
Documentation
https://www.fastly.com/documentation/reference/api/tls/
📖
Documentation
https://www.fastly.com/documentation/reference/api/vcl-services/
📖
Documentation
https://www.fastly.com/documentation/reference/api/account/
📖
Documentation
https://www.fastly.com/documentation/reference/api/auth-tokens/
📖
Documentation
https://www.fastly.com/documentation/reference/api/acls/
📖
Documentation
https://www.fastly.com/documentation/reference/api/dictionaries/
📖
Documentation
https://www.fastly.com/documentation/guides/compute/
📖
Documentation
https://www.fastly.com/documentation/reference/api/ngwaf/
📖
Documentation
https://www.fastly.com/documentation/reference/api/domain-management/
📖
Documentation
https://www.fastly.com/documentation/reference/api/products/
📖
Documentation
https://www.fastly.com/documentation/reference/api/observability/
📖
Documentation
https://www.fastly.com/documentation/reference/api/api-security/
📖
Documentation
https://www.fastly.com/documentation/reference/api/ddos-protection/
📖
Documentation
https://www.fastly.com/documentation/reference/api/client-side-protection/
📖
Documentation
https://www.fastly.com/documentation/reference/api/publishing/
📖
Documentation
https://www.fastly.com/documentation/reference/api/load-balancing/
📖
Documentation
https://www.fastly.com/documentation/reference/api/utils/
📖
Documentation
https://www.fastly.com/products/ai
📖
Documentation
https://www.fastly.com/products/object-storage

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/fastly-real-time-analytics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

fastly-real-time-analytics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Fastly Metrics and Stats Real-Time Analytics API
  description: The Fastly Metrics and Stats API provides access to both real-time and historical analytics data for Fastly services. The real-time analytics endpoint, served on rt.fastly.com, delivers second-by-second stats including request counts, bandwidth, cache hit ratios, and error rates. Historical stats provide aggregated data over longer time periods. The API also includes the Domain Inspector for per-domain metrics and the Origin Inspector for origin-level performance data.
  version: '1.0'
  contact:
    name: Fastly Support
    url: https://support.fastly.com
  termsOfService: https://www.fastly.com/terms
servers:
- url: https://rt.fastly.com
  description: Fastly Real-Time Analytics Server
- url: https://api.fastly.com
  description: Fastly API Production Server
security:
- apiKeyAuth: []
tags:
- name: Real-Time Analytics
  description: Real-time analytics endpoints providing second-by-second stats for Fastly services, served from rt.fastly.com.
paths:
  /v1/channel/{service_id}/ts/{start_timestamp}:
    get:
      operationId: getRealtimeStats
      summary: Get real-time analytics
      description: Retrieves real-time analytics data for a Fastly service starting from the specified Unix timestamp. Returns a list of records, each representing one second of time, with measurement data grouped in various ways. The real-time analytics API is rate limited internally and is cached behind Fastly with a 1-second expiration time.
      tags:
      - Real-Time Analytics
      servers:
      - url: https://rt.fastly.com
        description: Fastly Real-Time Analytics Server
      parameters:
      - $ref: '#/components/parameters/serviceId'
      - name: start_timestamp
        in: path
        required: true
        description: The Unix timestamp to start retrieving analytics data from.
        schema:
          type: integer
      responses:
        '200':
          description: Successfully retrieved real-time analytics data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeResponse'
        '401':
          description: Unauthorized. The API token is missing or invalid.
        '404':
          description: Service not found.
  /v1/channel/{service_id}/ts/h:
    get:
      operationId: getRealtimeStatsLast120Seconds
      summary: Get real-time analytics for the last 120 seconds
      description: Retrieves real-time analytics data for the last 120 seconds for the specified Fastly service.
      tags:
      - Real-Time Analytics
      servers:
      - url: https://rt.fastly.com
        description: Fastly Real-Time Analytics Server
      parameters:
      - $ref: '#/components/parameters/serviceId'
      responses:
        '200':
          description: Successfully retrieved real-time analytics data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeResponse'
        '401':
          description: Unauthorized. The API token is missing or invalid.
        '404':
          description: Service not found.
  /v1/channel/{service_id}/ts/h/limit/{max_entries}:
    get:
      operationId: getRealtimeStatsLastSecond
      summary: Get real-time analytics with a limit
      description: Retrieves real-time analytics data for the specified Fastly service limited to the most recent entries up to the specified maximum.
      tags:
      - Real-Time Analytics
      servers:
      - url: https://rt.fastly.com
        description: Fastly Real-Time Analytics Server
      parameters:
      - $ref: '#/components/parameters/serviceId'
      - name: max_entries
        in: path
        required: true
        description: The maximum number of entries to return.
        schema:
          type: integer
          minimum: 1
      responses:
        '200':
          description: Successfully retrieved real-time analytics data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeResponse'
        '401':
          description: Unauthorized. The API token is missing or invalid.
        '404':
          description: Service not found.
components:
  schemas:
    RealtimeResponse:
      type: object
      description: A response containing real-time analytics data with records representing one-second time intervals.
      properties:
        Timestamp:
          type: integer
          description: The Unix timestamp of the latest data point.
        AggregateDelay:
          type: integer
          description: The offset of the latest data point from the current time.
        Data:
          type: array
          description: A list of analytics records, each representing one second of data.
          items:
            $ref: '#/components/schemas/RealtimeRecord'
    RealtimeMeasurements:
      type: object
      description: A set of measurements for a specific time period and data center or aggregated across all data centers.
      properties:
        requests:
          type: integer
          description: The total number of requests received.
        hits:
          type: integer
          description: The number of cache hits.
        miss:
          type: integer
          description: The number of cache misses.
        pass:
          type: integer
          description: The number of requests that passed through to origin.
        errors:
          type: integer
          description: The total number of errors.
        bandwidth:
          type: integer
          description: The total bandwidth in bytes.
        header_size:
          type: integer
          description: The total header size in bytes.
        body_size:
          type: integer
          description: The total body size in bytes.
        status_1xx:
          type: integer
          description: The number of responses with 1xx status codes.
        status_2xx:
          type: integer
          description: The number of responses with 2xx status codes.
        status_3xx:
          type: integer
          description: The number of responses with 3xx status codes.
        status_4xx:
          type: integer
          description: The number of responses with 4xx status codes.
        status_5xx:
          type: integer
          description: The number of responses with 5xx status codes.
        hit_ratio:
          type: number
          format: float
          description: The ratio of cache hits to total requests.
    RealtimeRecord:
      type: object
      description: A single second of real-time analytics data with measurements grouped by data center.
      properties:
        datacenter:
          type: object
          description: A map of data center names to their respective measurement data.
          additionalProperties:
            $ref: '#/components/schemas/RealtimeMeasurements'
        aggregated:
          $ref: '#/components/schemas/RealtimeMeasurements'
        recorded:
          type: integer
          description: The Unix timestamp when this record was recorded.
  parameters:
    serviceId:
      name: service_id
      in: path
      required: true
      description: The alphanumeric string identifying the Fastly service.
      schema:
        type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Fastly-Key
      description: API token used to authenticate requests to the Fastly API.
externalDocs:
  description: Fastly Metrics and Stats API Documentation
  url: https://www.fastly.com/documentation/reference/api/metrics-stats/