# Surfline API

> Surfline returns surf forecasts and current conditions for named spots as a workflow and API.

Surfline returns current conditions and five forecast days for a named surf spot; provide a spot name and optionally a region. Forecasts include ratings, wind, swell, and morning and afternoon surf heights; current conditions include tide state and water temperature.

- Page: https://fous.com/workflows/surfline
- Handle: `@surfline`
- Category: [Weather](https://fous.com/workflows/category/weather)
- Source website: https://surfline.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with Surfline.

## Methods

### Get surf forecast

Operation `get_surf_forecast`, version 1. 1 credit per call.

Get current surf conditions and the five free forecast days for a Surfline spot by name. If a name matches multiple spots, the top match is used unless a region narrows it down. Daily values represent morning (9 a.m.) and afternoon (3 p.m.) local time; other daily values are from 9 a.m.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `region` | string | no | `"California"` | Location to distinguish spots with the same name, such as Hawaii or California. |
| `spot_name` | string | yes | `"Pipeline"` | Surf spot name, such as Pipeline or Huntington Beach Pier. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "spot_name"
  ],
  "properties": {
    "region": {
      "type": "string",
      "default": "",
      "description": "Location to distinguish spots with the same name, such as Hawaii or California.",
      "examples": [
        "California"
      ]
    },
    "spot_name": {
      "type": "string",
      "description": "Surf spot name, such as Pipeline or Huntington Beach Pier.",
      "examples": [
        "Pipeline",
        "Huntington Beach Pier"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "spot_name": "Pipeline"
    },
    {
      "region": "California",
      "spot_name": "Huntington Beach Pier"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `region` | string | `"United States, Hawaii, O‘ahu, Pupukea"` |  |
| `spot_name` | string | `"Pipeline"` |  |
| `forecast_days` | array |  |  |
| `forecast_days[].date` | string | `"2026-09-28"` |  |
| `forecast_days[].rating` | string or null | `"Fair"` |  |
| `forecast_days[].wind_direction` | string or null | `"E"` |  |
| `forecast_days[].wind_speed_mph` | number or null | `18.9` |  |
| `forecast_days[].main_swell_direction` | string or null | `"NNW"` |  |
| `forecast_days[].main_swell_height_ft` | number or null | `3.1` |  |
| `forecast_days[].main_swell_period_seconds` | number or null | `14` |  |
| `forecast_days[].morning_surf_height_max_ft` | number or null | `4` |  |
| `forecast_days[].morning_surf_height_min_ft` | number or null | `3` |  |
| `forecast_days[].afternoon_surf_height_max_ft` | number or null | `4` |  |
| `forecast_days[].afternoon_surf_height_min_ft` | number or null | `3` |  |
| `surfline_link` | string | `"https://www.surfline.com/surf-report/pipeline/5842041f4e65fad6a7708890"` |  |
| `surfline_spot_id` | string | `"5842041f4e65fad6a7708890"` |  |
| `current_conditions` | object |  |  |
| `current_conditions.rating` | string or null | `"Fair"` |  |
| `current_conditions.tide_state` | string or null | `"Falling"` |  |
| `current_conditions.wind_direction` | string or null | `"E"` |  |
| `current_conditions.wind_speed_mph` | number or null | `24.2` |  |
| `current_conditions.surf_height_max_ft` | number or null | `4` |  |
| `current_conditions.surf_height_min_ft` | number or null | `3` |  |
| `current_conditions.water_temperature_f` | number or null | `80` |  |

**Example input**

```json
{
  "spot_name": "Pipeline"
}
```

**Example output**

```json
{
  "region": "United States, Hawaii, O‘ahu, Pupukea",
  "spot_name": "Pipeline",
  "forecast_days": [
    {
      "date": "2026-09-28",
      "rating": "Fair",
      "wind_direction": "E",
      "wind_speed_mph": 18.9,
      "main_swell_direction": "NNW",
      "main_swell_height_ft": 3.1,
      "main_swell_period_seconds": 14,
      "morning_surf_height_max_ft": 4,
      "morning_surf_height_min_ft": 3,
      "afternoon_surf_height_max_ft": 4,
      "afternoon_surf_height_min_ft": 3
    },
    {
      "date": "2026-09-29",
      "rating": "Poor to Fair",
      "wind_direction": "ESE",
      "wind_speed_mph": 9.3,
      "main_swell_direction": "NNW",
      "main_swell_height_ft": 2.6,
      "main_swell_period_seconds": 12,
      "morning_surf_height_max_ft": 3,
      "morning_surf_height_min_ft": 2,
      "afternoon_surf_height_max_ft": 3,
      "afternoon_surf_height_min_ft": 2
    },
    {
      "date": "2026-09-30",
      "rating": "Fair",
      "wind_direction": "SSE",
      "wind_speed_mph": 17.9,
      "main_swell_direction": "WSW",
      "main_swell_height_ft": 3.5,
      "main_swell_period_seconds": 10,
      "morning_surf_height_max_ft": 4,
      "morning_surf_height_min_ft": 3,
      "afternoon_surf_height_max_ft": 3,
      "afternoon_surf_height_min_ft": 2
    }
  ],
  "surfline_link": "https://www.surfline.com/surf-report/pipeline/5842041f4e65fad6a7708890",
  "surfline_spot_id": "5842041f4e65fad6a7708890",
  "current_conditions": {
    "rating": "Fair",
    "tide_state": "Falling",
    "wind_direction": "E",
    "wind_speed_mph": 24.2,
    "surf_height_max_ft": 4,
    "surf_height_min_ft": 3,
    "water_temperature_f": 80
  }
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@surfline",
  "visibility": "public",
  "operation": "get_surf_forecast",
  "version": 1,
  "input": {
    "spot_name": "Pipeline"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@surfline\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_surf_forecast\",\n  \"version\": 1,\n  \"input\": {\n    \"spot_name\": \"Pipeline\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@surfline",
  "visibility": "public",
  "operation": "get_surf_forecast",
  "version": 1,
  "input": {
    "spot_name": "Pipeline"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@surfline","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare forecast surf heights across named spots
- Track swell direction and period for surf planning
- Review current wind, tide, and water temperature
- Plan sessions around morning and afternoon conditions

## FAQ

### Is Fous affiliated with Surfline?

No. Fous is not affiliated with Surfline. This workflow reads the public surfline.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Surfline account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from surfline.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What are the surf conditions at a spot?

Get surf forecast returns current conditions, including rating, tide state, wind, surf height, and water temperature.

### What is the surf forecast for the next five days?

Get surf forecast returns five forecast days with ratings, wind, swell, and morning and afternoon surf heights.

## Related

- [The Weather Channel API](https://fous.com/workflows/the-weather-channel.md): The Weather Channel returns current conditions, today’s high/low, up to 15 daily forecasts (sometimes fewer), 1–48 local hourly forecasts, and active severe weather alerts.
- [AccuWeather API](https://fous.com/workflows/accuweather.md): AccuWeather provides current conditions and RealFeel, plus up to 15 available daily forecasts; shorter public forecasts may return fewer days.
- [MSN Weather API](https://fous.com/workflows/msn-weather.md): MSN Weather provides current conditions and forecasts for places worldwide, including up to 10 days ahead and optional hourly forecasts for the next 24 hours.
- [OnTheSnow API](https://fous.com/workflows/onthesnow.md): Snow reports and ski resort conditions.
- [National Weather Service API](https://fous.com/workflows/national-weather-service.md): National Weather Service provides U.S. day-and-night forecasts for seven days, hourly forecasts for up to 156 hours where available, active alerts, and latest nearby station observations.
- [NOAA Tides and Currents API](https://fous.com/workflows/noaa-tides-and-currents.md): NOAA Tides and Currents provides coastal observations and predictions: tide times within 30 miles of prediction stations, latest levels within 50 miles of reporting stations.
- [Weather Underground API](https://fous.com/workflows/weather-underground.md): Historical and current weather conditions from stations worldwide.
- [NOAA Space Weather API](https://fous.com/workflows/noaa-space-weather.md): NOAA Space Weather provides near-term aurora chances, current geomagnetic activity, a three-day Kp outlook, and NOAA alerts from the past 1–7 days.
- [All Weather workflows](https://fous.com/workflows/category/weather)
