> ## 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.

# Quickstart

> Make your first GOES Health API request in minutes

## Setup

Request an API key [here](mailto:api@goes.health?subject=API%20Key%20Request)

## Basic Request

Let's check for current environmental risks at Half Dome in Yosemite:

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.goes.health/v1/risks/environmental?location=37.7325,-119.5581" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```jsx React theme={null}
  import { useEffect, useState } from 'react';

  function RiskCheck() {
    const [risks, setRisks] = useState([]);

    useEffect(() => {
      fetch(`https://api.goes.health/v1/risks/environmental?location=37.7325,-119.5581`, {
        headers: {
          'Authorization': `Bearer ${process.env.REACT_APP_GOES_API_KEY}`
        }
      })
        .then(res => res.json())
        .then(data => setRisks(data.risks));
    }, []);

    return (
      <div>
        {risks.map(risk => (
          <div key={risk.id}>
            <h3>{risk.title}</h3>
            <p>Severity: {risk.severity}</p>
          </div>
        ))}
      </div>
    );
  }
  ```

  ```jsx React Native theme={null}
  import React, { useEffect, useState } from 'react';
  import { View, Text, FlatList } from 'react-native';

  function RiskCheck() {
    const [risks, setRisks] = useState([]);

    useEffect(() => {
      fetch(`https://api.goes.health/v1/risks/environmental?location=37.7325,-119.5581`, {
        headers: {
          'Authorization': `Bearer ${process.env.GOES_API_KEY}`
        }
      })
        .then(res => res.json())
        .then(data => setRisks(data.risks));
    }, []);

    return (
      <FlatList
        data={risks}
        keyExtractor={item => item.id}
        renderItem={({ item }) => (
          <View style={{ padding: 10 }}>
            <Text>{item.title}</Text>
            <Text>Severity: {item.severity}</Text>
          </View>
        )}
      />
    );
  }
  ```

  ```js Node.js theme={null}
  const GOES_API_KEY = process.env.GOES_API_KEY;

  async function checkRisks() {
    const response = await fetch(
              `https://api.goes.health/v1/risks/environmental?location=37.7325,-119.5581`,
      {
        headers: {
          'Authorization': `Bearer ${GOES_API_KEY}`
        }
      }
    );
    
    if (!response.ok) {
      throw new Error(`API error: ${response.status}`);
    }
    
    const data = await response.json();
    console.log(data.risks);
  }
  ```

  ```python Python theme={null}
  import os
  import requests
  from typing import Dict, List

  def check_risks() -> Dict:
      response = requests.get(
          "https://api.goes.health/v1/risks/environmental",
          params={
              "location": "37.7325,-119.5581",
          },
          headers={
              "Authorization": f"Bearer {os.environ['GOES_API_KEY']}"
          },
          timeout=10,
      )
      response.raise_for_status()
      return response.json()
  ```
</CodeGroup>

All responses include an array of `risks`:

```json theme={null}
{
  "responseId": "123e4567-e89b-12d3-a456-426614174000",
  "risks": [
    {
      "id": "sunburn",
      "title": "Sunburn",
      "tips": [
        ...
      ]
    }, 
    {
      "id": "heat-illness",
      "title": "Heat Illness",
      "tips": [
        ...
      ]
    }
  ]
}
```

If a risk is not present, it will be omitted from the `risks`.

## Precise Request

Request specific risks by passing their IDs. Available risk IDs: `sunburn`, `high-altitude`, `heat-illness`, `breathing-problems`, `frostbite`, `hypothermia`, `lightning`.

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.goes.health/v1/risks/environmental?location=37.7325,-119.5581&ids=sunburn,high-altitude" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```jsx React theme={null}
  function RiskCheck() {
    const [risks, setRisks] = useState([]);
    
    useEffect(() => {
      fetch(`https://api.goes.health/v1/risks/environmental?location=37.7325,-119.5581&ids=sunburn,high-altitude`, {
        headers: {
          'Authorization': `Bearer ${process.env.REACT_APP_GOES_API_KEY}`
        }
      })
        .then(res => res.json())
        .then(data => setRisks(data.risks));
    }, []);

    return <div>{risks.map(risk => <div key={risk.id}>{risk.title}</div>)}</div>;
  }
  ```

  ```python Python theme={null}
  def check_specific_risks():
      response = requests.get(
          "https://api.goes.health/v1/risks/environmental",
          params={
              "location": "37.7325,-119.5581",
              "ids": "sunburn,high-altitude",
          },
          headers={
              "Authorization": f"Bearer {os.environ['GOES_API_KEY']}"
          },
      )
      return response.json()
  ```
</CodeGroup>

This behavior is also supported by the [/wildlife](/api-reference/wildlife) and [/plants](/api-reference/plants) endpoints.

## Complete Request

Get a comprehensive overview including all environmental risks (`sunburn`, `high-altitude`, `heat-illness`, `breathing-problems`, `frostbite`, `hypothermia`, `lightning`), wildlife risks (`bears`, `venomous-snakes`, `mosquitoes`, `ticks`), plant risks (`poison-sumac`, `poison-oak`, `poison-ivy`), national alerts, and a personalized AI summary.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.goes.health/v1/risks/overview" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "location": "37.7325,-119.5581",
      "profile": {
        "activity": "hiking"
      }
    }'
  ```

  ```jsx React theme={null}
  function CompleteOverview() {
    const [data, setData] = useState({});
    
    useEffect(() => {
      fetch(`https://api.goes.health/v1/risks/overview`, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${process.env.REACT_APP_GOES_API_KEY}`
        },
        body: JSON.stringify({
          location: "37.7325,-119.5581",
          profile: {
            activity: "hiking"
          }
        })
      })
        .then(res => res.json())
        .then(setData);
    }, []);

    return (
      <div>
        <p>{data.summary}</p>
        {data.risks?.map(risk => <div key={risk.id}>{risk.title}</div>)}
      </div>
    );
  }
  ```

  ```python Python theme={null}
  def get_complete_overview():
      response = requests.post(
          "https://api.goes.health/v1/risks/overview",
          json={
              "location": "37.7325,-119.5581",
              "profile": {
                  "activity": "hiking"
              }
          },
          headers={
              "Authorization": f"Bearer {os.environ['GOES_API_KEY']}"
          },
      )
      return response.json()
  ```
</CodeGroup>

## Next Steps

* Explore the full **[API Reference](/api-reference/risks)** for optional parameters

<Callout icon="lightbulb" color="black">
  Need help or have questions? Email us at <a href="mailto:api@goes.health?subject=API%20Support">[api@goes.health](mailto:api@goes.health)</a>.
</Callout>
