# 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/tools/surfline
- Handle: `@surfline`
- Category: [Weather](https://fous.com/tools/category/weather)
- Source website: https://surfline.com
- Last verified: Sep 29, 2026

## Methods

### Get surf forecast

Operation `get_surf_forecast`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_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.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

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=180) 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.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_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);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/surfline`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_surf_forecast`: Get surf forecast. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-surfline https://api.fous.com/mcp/tools/surfline --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

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

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Surfline tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. 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. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified 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/tools/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/tools/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/tools/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/tools/onthesnow.md): Snow reports and ski resort conditions.
- [National Weather Service API](https://fous.com/tools/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/tools/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/tools/weather-underground.md): Historical and current weather conditions from stations worldwide.
- [NOAA Space Weather API](https://fous.com/tools/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 tools](https://fous.com/tools/category/weather)
