Environmental Protection Agency UVIndex API

The UVIndex API from Environmental Protection Agency — 4 operation(s) for uvindex.

OpenAPI Specification

environmental-protection-agency-uvindex-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: EPA Data Service Envirofacts UVIndex API
  version: 1.0.0
  description: Public REST data service from the U.S. Environmental Protection Agency. Provides programmatic access to Envirofacts tables (environmental records across air, water, land) and to the UV Index forecast (hourly and daily) via simple, dynamic path-based queries. No authentication is required. Best-effort spec derived from publicly documented surfaces; not exhaustive.
  contact:
    name: EPA Envirofacts
    url: https://www.epa.gov/enviro/envirofacts-data-service-api
  license:
    name: U.S. Public Domain
servers:
- url: https://data.epa.gov
  description: EPA data services production base URL
tags:
- name: UVIndex
paths:
  /dmapservice/getEnvirofactsUVHOURLY/ZIP/{zip}/{format}:
    get:
      tags:
      - UVIndex
      summary: Hourly UV index forecast for a ZIP code
      operationId: getUvHourlyByZip
      parameters:
      - in: path
        name: zip
        required: true
        schema:
          type: string
          example: '20002'
      - in: path
        name: format
        required: true
        schema:
          type: string
          enum:
          - JSON
          - XML
          - CSV
      responses:
        '200':
          description: Hourly UV index forecast
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UvHourly'
  /dmapservice/getEnvirofactsUVHOURLY/CITY/{city}/STATE/{state}/{format}:
    get:
      tags:
      - UVIndex
      summary: Hourly UV index forecast for a city and state
      operationId: getUvHourlyByCityState
      parameters:
      - in: path
        name: city
        required: true
        schema:
          type: string
      - in: path
        name: state
        required: true
        description: Two-letter state code (e.g. `CT`).
        schema:
          type: string
          minLength: 2
          maxLength: 2
      - in: path
        name: format
        required: true
        schema:
          type: string
          enum:
          - JSON
          - XML
          - CSV
      responses:
        '200':
          description: Hourly UV index forecast
  /dmapservice/getEnvirofactsUVDAILY/ZIP/{zip}/{format}:
    get:
      tags:
      - UVIndex
      summary: Daily UV index forecast for a ZIP code
      operationId: getUvDailyByZip
      parameters:
      - in: path
        name: zip
        required: true
        schema:
          type: string
      - in: path
        name: format
        required: true
        schema:
          type: string
          enum:
          - JSON
          - XML
          - CSV
      responses:
        '200':
          description: Daily UV index forecast
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UvDaily'
  /dmapservice/getEnvirofactsUVDAILY/CITY/{city}/STATE/{state}/{format}:
    get:
      tags:
      - UVIndex
      summary: Daily UV index forecast for a city and state
      operationId: getUvDailyByCityState
      parameters:
      - in: path
        name: city
        required: true
        schema:
          type: string
      - in: path
        name: state
        required: true
        schema:
          type: string
      - in: path
        name: format
        required: true
        schema:
          type: string
          enum:
          - JSON
          - XML
          - CSV
      responses:
        '200':
          description: Daily UV index forecast
components:
  schemas:
    UvDaily:
      type: object
      properties:
        CITY:
          type: string
        STATE:
          type: string
        DATE:
          type: string
        UV_INDEX:
          type: integer
        UV_ALERT:
          type: integer
    UvHourly:
      type: object
      properties:
        ORDER:
          type: integer
        ZIP:
          type: string
        DATE_TIME:
          type: string
        UV_VALUE:
          type: integer