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

# Get Environmental Forecast

> Precision hourly and extended daily forecast of environmental risks for a location.

Get 48-hour hourly and 8-day daily forecasts of environmental risks for a location.

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key for authentication. Format: `Bearer YOUR_API_KEY`
</ParamField>

### Query Parameters

<ParamField query="location" type="string" required>
  The latitude and longitude for the location to check, formatted as `{latitude},{longitude}`.
</ParamField>

## Response

<ResponseField name="responseId" type="string">
  A unique identifier for this response. Use this ID if submitting feedback about the forecast.
</ResponseField>

<ResponseField name="hourly" type="array">
  48 hourly entries, each containing the set of environmental risks for that hour.

  <Expandable title="child attributes">
    <ResponseField name="time" type="string">
      ISO 8601 timestamp (UTC) representing the forecast hour.
    </ResponseField>

    <ResponseField name="risks" type="array">
      The environmental risks predicted for this hour.

      <Expandable title="child attributes">
        <ResponseField name="id" type="string">
          The unique identifier for the environmental risk.
        </ResponseField>

        <ResponseField name="title" type="string">
          The human-readable title of the risk.
        </ResponseField>

        <ResponseField name="status" type="enum">
          The status of this risk assessment:

          * `applicable`: Risk is present and relevant for this location
          * `not_applicable`: Risk is not present or relevant for this location
          * `unavailable`: Risk data is unavailable for this location
          * `error`: An error occurred while assessing this risk
        </ResponseField>

        <ResponseField name="score" type="number">
          A number from 0-3 representing the risk level:

          * 0: None
          * 1: Low
          * 2: Medium
          * 3: High
        </ResponseField>

        <ResponseField name="tips" type="array">
          A collection of 1-2 sentence strings with tips and recommendations.
        </ResponseField>

        <ResponseField name="summary" type="string">
          A 1-2 sentence summary of the tips and key information.
        </ResponseField>

        <ResponseField name="error" type="string">
          Error message describing what went wrong. Only present when status is `error`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="daily" type="array">
  32 daily entries over 8 days. 4 timestamps per day: morning (06:00), noon (12:00), evening (18:00), midnight (00:00), each containing the set of environmental risks.

  <Expandable title="child attributes">
    <ResponseField name="time" type="string">
      ISO 8601 timestamp (UTC) representing the forecast time.
    </ResponseField>

    <ResponseField name="risks" type="array">
      The environmental risks predicted for this time.

      <Expandable title="child attributes">
        <ResponseField name="id" type="string">
          The unique identifier for the environmental risk.
        </ResponseField>

        <ResponseField name="title" type="string">
          The human-readable title of the risk.
        </ResponseField>

        <ResponseField name="status" type="enum">
          The status of this risk assessment:

          * `applicable`: Risk is present and relevant for this location
          * `not_applicable`: Risk is not present or relevant for this location
          * `unavailable`: Risk data is unavailable for this location
          * `error`: An error occurred while assessing this risk
        </ResponseField>

        <ResponseField name="score" type="number">
          A number from 0-3 representing the risk level:

          * 0: None
          * 1: Low
          * 2: Medium
          * 3: High
        </ResponseField>

        <ResponseField name="tips" type="array">
          A collection of 1-2 sentence strings with tips and recommendations.
        </ResponseField>

        <ResponseField name="summary" type="string">
          A 1-2 sentence summary of the tips and key information.
        </ResponseField>

        <ResponseField name="error" type="string">
          Error message describing what went wrong. Only present when status is `error`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Example

```bash theme={null}
curl "http://api.goes.health/v1/risks/environmental/forecast?location=34.0522,-118.2437" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json theme={null}
{
  "responseId": "123e4567-e89b-12d3-a456-426614174000",
  "hourly": [
    {
      "time": "2024-06-27T00:00:00Z",
      "risks": [
        {
          "id": "sunburn",
          "title": "Sunburn",
          "status": "applicable",
          "score": 2,
          "summary": "...",
          "tips": [
            "..."
          ]
        }
      ]
    }
  ],
  "daily": [
    {
      "time": "2024-06-27T06:00:00Z",
      "risks": [
        {
          "id": "sunburn",
          "title": "Sunburn",
          "status": "applicable",
          "score": 2,
          "summary": "...",
          "tips": [
            "..."
          ]
        }
      ]
    }
  ]
}
```


## OpenAPI

````yaml GET /v1/risks/environmental/forecast
openapi: 3.1.0
info:
  title: GOES Health API
  description: API for accessing outdoor health risk data.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.goes.health
security: []
paths:
  /v1/risks/environmental/forecast:
    get:
      description: >-
        Precision hourly and extended daily forecast of environmental risks for
        a location.
      parameters:
        - name: location
          in: query
          description: The latitude and longitude, formatted as `{latitude},{longitude}`.
          required: true
          schema:
            type: string
          example: 37.7485,-119.5331
        - name: ids
          in: query
          description: >-
            A comma-separated list of environmental risk IDs to include in the
            forecast.
          required: false
          schema:
            type: string
        - name: exclude
          in: query
          description: >-
            Comma-separated list of forecast types to exclude from the response.
            Options: `hourly`, `daily`
          required: false
          schema:
            type: string
          example: daily
        - name: exclude_risk_fields
          in: query
          description: >-
            Comma-separated list of sections to exclude from the response.
            Options: `tips`, `summary`, `score`
          required: false
          schema:
            type: string
          example: tips,summary
      responses:
        '200':
          description: A forecast of environmental risks with hourly and/or daily data.
          content:
            application/json:
              schema:
                type: object
                required:
                  - responseId
                properties:
                  responseId:
                    type: string
                    format: uuid
                    description: A unique identifier for this response
                  hourly:
                    type: array
                    description: >-
                      48 hourly entries, each containing the set of
                      environmental risks for that hour.
                    items:
                      $ref: '#/components/schemas/RiskForecastEntry'
                  daily:
                    type: array
                    description: >-
                      32 daily entries over 8 days. 4 timestamps per day:
                      morning (06:00), noon (12:00), evening (18:00), midnight
                      (00:00), each containing the set of environmental risks.
                    items:
                      $ref: '#/components/schemas/RiskForecastEntry'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - HTTPBearer: []
components:
  schemas:
    RiskForecastEntry:
      type: object
      required:
        - time
        - risks
      properties:
        time:
          type: string
          format: date-time
          description: ISO 8601 timestamp for the forecast hour
        risks:
          type: array
          description: The environmental risks predicted for this hour.
          items:
            $ref: '#/components/schemas/Risk'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    Risk:
      type: object
      required:
        - id
        - title
        - status
      properties:
        id:
          type: string
          description: The unique identifier for the risk
          example: sunburn
        title:
          type: string
          description: The human-readable title of the risk
          example: Sunburn
        status:
          type: string
          enum:
            - applicable
            - not_applicable
            - unavailable
            - error
          description: The status of this risk assessment
        score:
          type: integer
          minimum: 0
          maximum: 3
          description: >-
            A number from 0-3 representing the risk level (0: None, 1: Low, 2:
            Medium, 3: High).
          example: 2
        summary:
          type: string
          description: A 1-2 sentence summary of the tips and key information.
          example: <string>
        tips:
          type: array
          items:
            type: string
          description: A list of safety tips.
        error:
          type: string
          description: >-
            Error message describing what went wrong. Only present when status
            is 'error'.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Enter your API key

````