# Recipes

import {
  Search,
  CloudSun,
  CalendarClock,
  CalendarDays,
  Zap,
  CloudLightning,
  History,
} from "zudoku/icons";
import { ApiLink } from "../../src/components/ApiLink.tsx";

Recipes are interactive, end-to-end walkthroughs that show you exactly how to accomplish common weather data tasks with the AccuWeather Enterprise API. Each recipe walks through the full request-response cycle with working code examples in multiple languages.

:::note
**These recipes are teaching examples — not production code.**

- **Host:** examples use the development host **apidev.accuweather.com**. Switch to **api.accuweather.com** for production.
- **Production hardening:** GZIP compression, caching, retries with exponential backoff, and error handling are not included. See the [Best Practices](/developers/best-practices) guide.
:::

## What's a recipe?

Unlike reference documentation, recipes are goal-oriented. They start with a real-world scenario, guide you through the necessary API calls step by step, explain the key response fields, and highlight common pitfalls.

## Prerequisites

All recipes assume you have:

- **An API key** — contact [sales@accuweather.com](mailto:sales@accuweather.com) to obtain one
- **Basic HTTP knowledge** — familiarity with REST APIs and JSON responses
- **A location key** — most weather endpoints require an AccuWeather `LocationKey`; see the [Location Search recipe](/recipes/location-search) if you don't have one yet

:::tip
Every recipe uses `{YOUR_API_KEY}` as a placeholder. Substitute your real API key before running any request.
:::

## Available recipes

<div className="grid sm:grid-cols-2 gap-1 not-prose">
  <ApiLink icon={<Search size={20} />} title="Location Search" href="/recipes/location-search">
    Find a LocationKey for any city, postal code, or point of interest.
  </ApiLink>
  <ApiLink icon={<CloudSun size={20} />} title="Current Conditions" href="/recipes/current-conditions">
    Fetch real-time temperature, weather phrase, and precipitation data.
  </ApiLink>
  <ApiLink icon={<CalendarClock size={20} />} title="Hourly Forecast" href="/recipes/hourly-forecast">
    Retrieve 1–12 hour-by-hour forecasts with precipitation probabilities.
  </ApiLink>
  <ApiLink icon={<CalendarDays size={20} />} title="5-Day Daily Forecast" href="/recipes/daily-forecast">
    Get daily high/low temperatures and day/night summaries.
  </ApiLink>
  <ApiLink icon={<Zap size={20} />} title="Real-Time Lightning" href="/recipes/lightning-realtime">
    Search for recent lightning strikes near a location.
  </ApiLink>
  <ApiLink icon={<CloudLightning size={20} />} title="Lightning Forecast" href="/recipes/lightning-forecast">
    Check lightning probability for the next 2 hours.
  </ApiLink>
  <ApiLink icon={<History size={20} />} title="Historical Lightning" href="/recipes/lightning-historical">
    Look up past lightning strikes for a specific date.
  </ApiLink>
</div>

