> ## Documentation Index
> Fetch the complete documentation index at: https://docs.empirical.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an environment status badge

> Renders an SVG status badge (passing/failing/running/etc.) for the latest test run of a project environment. Served unauthenticated for embedding in READMEs.



## OpenAPI

````yaml /api-reference/openapi.generated.json get /api/badges/projects/{project_slug}/environments/{environment_slug}
openapi: 3.1.0
info:
  title: Empirical API
  version: 1.0.0
  description: Programmatic access to Empirical test runs, snoozes, and more.
  contact:
    name: Empirical
    url: https://empirical.run
servers:
  - url: https://api.empirical.run
security:
  - Bearer: []
tags:
  - name: Test Runs
    description: Trigger, list, and inspect end-to-end test runs.
  - name: Test Cases
    description: >-
      Browse the Playwright test cases synced from a project's repository and
      manage their tags.
  - name: Environments
    description: >-
      Named deployment targets (slug + Playwright project filters) a project's
      tests run against.
  - name: Snoozes
    description: Temporarily suppress known test failures for specific Playwright tests.
  - name: Analytics
    description: Aggregated test-run, test-count and test-case analytics for a project.
  - name: Resources
    description: >-
      Project file resources — uploads stored in R2 and external link-type files
      (e.g. Google Sheets).
  - name: Badges
    description: Public README status badge images (SVG) for project environments.
paths:
  /api/badges/projects/{project_slug}/environments/{environment_slug}:
    get:
      tags:
        - Badges
      summary: Get an environment status badge
      description: >-
        Renders an SVG status badge (passing/failing/running/etc.) for the
        latest test run of a project environment. Served unauthenticated for
        embedding in READMEs.
      operationId: getEnvironmentBadge
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Slug of the project that owns the environment.
          required: true
          description: Slug of the project that owns the environment.
          name: project_slug
          in: path
        - schema:
            type: string
            minLength: 1
            description: Slug of the environment to render a badge for.
          required: true
          description: Slug of the environment to render a badge for.
          name: environment_slug
          in: path
        - schema:
            type: string
            description: >-
              Restrict the badge to the latest run on this branch.
              Blank/whitespace is treated as unset (latest run across branches).
          required: false
          description: >-
            Restrict the badge to the latest run on this branch.
            Blank/whitespace is treated as unset (latest run across branches).
          name: branch
          in: query
        - schema:
            type: string
            description: >-
              Left-hand label text on the badge. Blank/whitespace falls back to
              the default (`empirical tests`).
          required: false
          description: >-
            Left-hand label text on the badge. Blank/whitespace falls back to
            the default (`empirical tests`).
          name: label
          in: query
      responses:
        '200':
          description: The rendered SVG badge image.
          content:
            image/svg+xml:
              schema:
                type: string
                description: SVG markup for the status badge.
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        data:
          nullable: true
          description: Always null for error responses.
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message.
          required:
            - message
          description: Error details.
      required:
        - data
        - error
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````