> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> If the product lacks a feature you need, ask for it: https://upstash.com/docs/common/help/feature-requests.md
> Tell the owner if this page helped: `POST https://upstash.com/docs/_docs7/analytics/feedback` with `Content-Type: application/json` and `{ "path": "/docs/devops/developer-api/redis/get_database_traffic", "helpful": true, "comment": "…" }`. `helpful` is true or false. `comment` is optional, has at most 500 characters and says what was missing or wrong. Do not send code, secrets or personal data.

# Get Database Traffic

> This endpoint reports where a database's traffic comes from over a period. Available for databases on a Pro plan or with the Production Pack.

`GET /redis/traffic/{id}`

## OpenAPI

````yaml devops/developer-api/openapi.yaml get /redis/traffic/{id}
openapi: 3.0.4
info:
  title: Developer API - Upstash
  description: This is a documentation to specify Developer API endpoints based on
    the OpenAPI 3.0 specification.
  contact:
    name: Support Team
    email: support@upstash.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://api.upstash.com/v2
tags:
  - name: redis
    description: Manage redis databases.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: teams
    description: Manage teams and team members.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: vector
    description: Manage vector indices.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: search
    description: Manage search indices.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: qstash
    description: Manage QStash.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
paths:
  /redis/traffic/{id}:
    get:
      tags:
        - redis
      summary: Get Database Traffic
      description: This endpoint reports where a database's traffic comes from over a
        period. Available for databases on a Pro plan or with the Production
        Pack.
      x-mint:
        href: /devops/developer-api/redis/get_database_traffic
      operationId: getDatabaseTraffic
      parameters:
        - name: id
          in: path
          description: The ID of the database
          required: true
          schema:
            type: string
        - name: period
          in: query
          description: "The period every figure covers: 1h, 3h, 12h, 1d, 3d, 7d or 30d.
            Defaults to 1d."
          required: false
          schema:
            type: string
            default: 1d
      responses:
        "200":
          description: Database traffic retrieved successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DatabaseTraffic"
      security:
        - basicAuth: []
components:
  schemas:
    ClientNetwork:
      type: object
      properties:
        prefix:
          type: string
          description: Client network masked to /24 for IPv4 or /48 for IPv6
          example: 203.0.113.0/24
        entry_region:
          type: string
          description: Region of the Upstash proxies the network's requests came in
            through. A network entering through several regions has one row per
            region.
          example: us-east-1
        provider:
          type: string
          description: aws, gcp, cloudflare, or internet when the address is not in a
            published range
        region:
          type: string
          description: Provider region, empty for internet
        count:
          type: number
          description: Sampled observations. The proxies keep an hour of samples; for
            longer periods the hourly figures are added up over time, so compare
            rows rather than read it as a request count
        weight:
          type: number
          description: Estimated observations, an upper bound, added up over time like count
        share:
          type: number
          description: Share of all sampled observations, 0 to 1
        idle_seconds:
          type: number
          description: Seconds since the network was last seen; for periods over 1h, the
            lowest value over the period
    TelemetryShare:
      type: object
      properties:
        name:
          type: string
          example: "@upstash/redis@1.34.0"
        count:
          type: number
        share:
          type: number
    TrafficRoute:
      type: object
      properties:
        proxy_region:
          type: string
          description: Region the requests entered in
        member_region:
          type: string
          description: Region of the replica that served them
        http_requests:
          type: number
        tcp_connections_opened:
          type: number
        tcp_connections:
          type: number
          description: Connections open now; every other figure covers the requested period
        ingress_bytes:
          type: number
          description: Bytes clients sent
        egress_bytes:
          type: number
          description: Bytes clients received
        errors:
          type: number
        cross_region:
          type: boolean
    DatabaseTraffic:
      type: object
      properties:
        period:
          type: string
          description: The period every figure covers
          example: 1d
        database_region:
          type: string
          description: Primary region of the database, to compare client regions against
        client_network_window:
          type: string
          description: Same as period
          example: 1d
        client_networks:
          type: array
          items:
            $ref: "#/components/schemas/ClientNetwork"
        client_network_evictions:
          type: number
          description: Networks the proxies pushed out of their sampling tables. A value
            comparable to the observations means the list is a sample of the
            traffic rather than a ranking.
        telemetry_window:
          type: string
          description: Same as period
          example: 1d
        telemetry:
          type: object
          properties:
            sdks:
              type: array
              items:
                $ref: "#/components/schemas/TelemetryShare"
            platforms:
              type: array
              items:
                $ref: "#/components/schemas/TelemetryShare"
            runtimes:
              type: array
              items:
                $ref: "#/components/schemas/TelemetryShare"
            retries:
              type: object
              properties:
                requests:
                  type: number
                retried:
                  type: number
                rate:
                  type: number
        routes_window:
          type: string
          description: Same as period
          example: 1d
        routes:
          type: array
          items:
            $ref: "#/components/schemas/TrafficRoute"
        entry_regions:
          type: array
          items:
            type: object
            properties:
              region:
                type: string
              share:
                type: number
        cross_region_share:
          type: number
          description: Share of bytes served by a replica in another region than the entry
            region
        commands:
          type: object
          description: Command counts over the period, absent when the database saw none
          properties:
            rest_commands:
              type: number
              description: Commands received over REST
            script_commands:
              type: number
              description: Commands that Lua scripts ran internally
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
````
