Magicseaweed APImagicseaweed.com ↗
Access surf forecasts, wave heights, wind, tides, and weather for any surf spot worldwide via the Magicseaweed API. Search spots and get up to 16-day forecasts.
What is the Magicseaweed API?
The Magicseaweed API covers 3 endpoints that expose surf spot discovery, detailed multi-day forecasts, and popular spot conditions. The get_spot_forecast endpoint returns hourly wave, wind, tide, and weather data for up to 16 days at any spot ID, while search_spots resolves location names — from "Malibu" to "Pipeline" — into the numeric IDs those forecasts require. A third endpoint surfaces a curated list of popular breaks with current conditions and camera details.
curl -X GET 'https://api.parse.bot/scraper/bdd16c83-771c-411b-b9e9-b7de50f4ec1a/search_spots?query=Malibu' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace magicseaweed-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
Surfline API Scraper - Access global surf reports, forecasts, and spot data.
Get your API key from: https://parse.bot/settings
"""
import os
import requests
from datetime import datetime
from typing import Any, Optional
class ParseClient:
"""Client for Surfline API Scraper via Parse API."""
def __init__(self, api_key: Optional[str] = None):
"""Initialize the Parse client with API credentials."""
self.base_url = "https://api.parse.bot"
self.scraper_id = "bdd16c83-771c-411b-b9e9-b7de50f4ec1a"
self.api_key = api_key or os.getenv("PARSE_API_KEY")
if not self.api_key:
raise ValueError("API key must be provided or set in PARSE_API_KEY environment variable")
def _call(self, endpoint: str, method: str = "POST", **params) -> dict[str, Any]:
"""Make API call to the Parse scraper endpoint."""
url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
headers = {
"X-API-Key": self.api_key,
"Content-Type": "application/json"
}
if method.upper() == "GET":
response = requests.get(url, headers=headers, params=params)
elif method.upper() == "POST":
response = requests.post(url, headers=headers, json=params)
else:
raise ValueError(f"Unsupported HTTP method: {method}")
response.raise_for_status()
return response.json()
def search_spots(self, query: str) -> dict[str, Any]:
"""
Search for surf spots by name.
Args:
query: The name of the beach or surf spot (e.g., 'Malibu', 'Pipeline')
Returns:
Dictionary containing search results with spot IDs and details
"""
return self._call("search_spots", method="GET", query=query)
def get_spot_forecast(self, spot_id: str, days: int = 5) -> dict[str, Any]:
"""
Retrieve detailed surf forecast for a specific spot.
Args:
spot_id: The unique Surfline spot ID (found via search_spots)
days: Number of days to forecast (1-16, default: 5)
Returns:
Dictionary containing wave, wind, tides, and weather forecast data
"""
return self._call("get_spot_forecast", method="GET", spot_id=spot_id, days=days)
def get_popular_spots(self) -> dict[str, Any]:
"""
Retrieve a list of popular surf spots in the US.
Returns:
Dictionary containing array of popular spots with current conditions
"""
return self._call("get_popular_spots", method="GET")
def format_timestamp(timestamp: int, utc_offset: int = 0) -> str:
"""Convert Unix timestamp to readable date/time."""
return datetime.fromtimestamp(timestamp).strftime("%Y-%m-%d %H:%M:%S")
def print_wave_conditions(wave_data: dict[str, Any]) -> str:
"""Format wave condition data into a readable string."""
surf = wave_data.get("surf", {})
min_height = surf.get("min", "?")
max_height = surf.get("max", "?")
human_relation = surf.get("humanRelation", "Unknown")
swells = wave_data.get("swells", [])
swell_info = ""
if swells:
primary_swell = swells[0]
height = primary_swell.get("height", "?")
period = primary_swell.get("period", "?")
swell_info = f" (Swell: {height}ft @ {period}s)"
return f"{min_height}-{max_height}ft {human_relation}{swell_info}"
def print_forecast_summary(forecast: dict[str, Any], spot_name: str) -> None:
"""Print a formatted summary of the surf forecast."""
print(f"\n{'='*70}")
print(f"🏄 SURF FORECAST FOR: {spot_name}")
print(f"{'='*70}")
# Wave forecast
if forecast.get("wave"):
print("\n📊 WAVE FORECAST (Next 24-48 hours):")
for i, wave_data in enumerate(forecast["wave"][:6], 1):
ts = wave_data.get("timestamp")
conditions = print_wave_conditions(wave_data)
probability = wave_data.get("probability", 100)
print(f" [{i}] {format_timestamp(ts)} | {conditions} ({probability}% probability)")
# Wind data
if forecast.get("wind"):
print("\n💨 WIND CONDITIONS:")
for i, wind_data in enumerate(forecast["wind"][:4], 1):
ts = wind_data.get("timestamp")
speed = wind_data.get("speed", "?")
direction = wind_data.get("direction", "?")
direction_type = wind_data.get("directionType", "")
gust = wind_data.get("gust", speed)
print(f" [{i}] {format_timestamp(ts)} | {speed:.1f} mph @ {direction:.0f}° {direction_type} (Gust: {gust:.1f})")
# Weather
if forecast.get("weather"):
print("\n🌤️ WEATHER CONDITIONS:")
for i, weather_data in enumerate(forecast["weather"][:4], 1):
ts = weather_data.get("timestamp")
temp = weather_data.get("temperature", "?")
condition = weather_data.get("condition", "Unknown")
pressure = weather_data.get("pressure", "?")
condition_display = condition.replace("_", " ").title()
print(f" [{i}] {format_timestamp(ts)} | {temp:.0f}°F, {condition_display} ({pressure}mb)")
# Tide information
if forecast.get("tides"):
print("\n🌊 TIDE INFORMATION:")
for i, tide_data in enumerate(forecast["tides"][:4], 1):
ts = tide_data.get("timestamp")
height = tide_data.get("height", "?")
tide_type = tide_data.get("type", "NORMAL")
print(f" [{i}] {format_timestamp(ts)} | {height:.2f}ft ({tide_type})")
def main():
"""Main execution: comprehensive workflow combining multiple API calls."""
# Initialize client
try:
client = ParseClient()
except ValueError as e:
print(f"Error: {e}")
return
print("\n🏄 SURFLINE FORECAST ANALYZER")
print("=" * 70)
print("Searching for popular surf spots and analyzing conditions...")
# Step 1: Get popular spots overview
print("\n\n📍 DISCOVERING POPULAR SURF SPOTS")
print("-" * 70)
popular_spots_data = None
try:
popular_response = client.get_popular_spots()
popular_spots_data = popular_response.get("data", {}).get("spots", [])
if popular_spots_data:
print(f"\n✅ Found {len(popular_spots_data)} popular spots")
print("\nTop 5 Popular Spots:")
for i, spot in enumerate(popular_spots_data[:5], 1):
spot_name = spot.get("name", "Unknown")
conditions = spot.get("conditions", {}).get("value", "N/A")
surf_min = spot.get("surf", {}).get("min", "?")
surf_max = spot.get("surf", {}).get("max", "?")
wind_speed = spot.get("wind", {}).get("speed", "?")
print(f" {i}. {spot_name:25} | Condition: {conditions:8} | Surf: {surf_min:.1f}-{surf_max:.1f}ft | Wind: {wind_speed:.1f}mph")
else:
print("⚠️ No popular spots data returned")
except Exception as e:
print(f"⚠️ Error fetching popular spots: {e}")
# Step 2: Search for specific destinations and get detailed forecasts
print("\n\n🔍 DETAILED FORECAST ANALYSIS")
print("-" * 70)
destinations = ["Malibu", "Pipeline", "Rincon"]
forecasts_retrieved = 0
for destination in destinations:
try:
print(f"\n\n📡 Searching for: {destination}")
search_result = client.search_spots(destination)
spots = search_result.get("spots", [])
if not spots:
print(f" ❌ No spots found for '{destination}'")
continue
# Get the first matching spot
spot = spots[0]
spot_id = spot.get("id")
spot_name = spot.get("name")
location = spot.get("location", {})
breadcrumbs = spot.get("breadCrumbs", [])
spot_type = spot.get("type", "spot")
print(f" ✅ Found: {spot_name} (Type: {spot_type})")
if breadcrumbs:
location_str = " > ".join(breadcrumbs)
print(f" 📍 Location: {location_str}")
if location:
lat = location.get("lat", 0)
lon = location.get("lon", 0)
print(f" 🧭 Coordinates: {lat:.4f}, {lon:.4f}")
# Get detailed forecast
print(f" ⏳ Fetching 3-day forecast...")
forecast = client.get_spot_forecast(spot_id, days=3)
# Display formatted forecast
print_forecast_summary(forecast, spot_name)
forecasts_retrieved += 1
except requests.exceptions.RequestException as e:
print(f" ❌ Network error for {destination}: {e}")
except (KeyError, ValueError, TypeError) as e:
print(f" ❌ Data processing error for {destination}: {e}")
except Exception as e:
print(f" ❌ Unexpected error for {destination}: {e}")
# Summary
print(f"\n\n{'='*70}")
print(f"✨ ANALYSIS COMPLETE")
print(f"Successfully retrieved {forecasts_retrieved} detailed forecasts")
print(f"{'='*70}\n")
if __name__ == "__main__":
main()Search for surf spots by name to find their unique IDs. Returns matching spots, geonames, and travel destinations.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | The name of the beach or surf spot to search for (e.g. 'Malibu', 'Pipeline'). |
{
"type": "object",
"fields": {
"query": "string — the search query echoed back",
"spots": "array of objects containing id, name, breadCrumbs, location (lat/lon), and type (spot, geoname, editorial, travel)"
},
"sample": {
"data": {
"query": "Malibu",
"spots": [
{
"id": "5842041f4e65fad6a7708e1b",
"name": "Baja Malibu",
"type": "spot",
"location": {
"lat": 32.417,
"lon": -117.096
},
"breadCrumbs": [
"Mexico",
"Estado de Baja California",
"Tijuana"
]
},
{
"id": "584204214e65fad6a7709b9f",
"name": "Malibu First Point",
"type": "spot",
"location": {
"lat": 34.03577735818882,
"lon": -118.67668
},
"breadCrumbs": [
"United States",
"California",
"Los Angeles County"
]
}
]
},
"status": "success"
}
}About the Magicseaweed API
Spot Search and Discovery
The search_spots endpoint accepts a query string and returns an array of matching results, each carrying an id, name, breadCrumbs for context, a location object with latitude and longitude, and a type field that distinguishes between surf spots, geonames, editorial features, and travel destinations. This makes it the correct starting point when you have a place name but need the spot_id required by the forecast endpoint.
The get_popular_spots endpoint requires no parameters and returns a data object containing a spots array with current conditions, surf, wind, swells, tide, and cameras fields for each featured break. An associated object carries unit configuration, and a permissions object surfaces any access restrictions. This endpoint is suited for overview dashboards that need a snapshot of well-known breaks without prior knowledge of individual spot IDs.
Forecast Data
The get_spot_forecast endpoint takes a required spot_id and an optional days integer (1–16) and returns four parallel arrays: wave (timestamp, surf min/max, swell breakdown, power), wind (timestamp, speed, direction, directionType, gust), tides (timestamp, type, height), and weather (timestamp, temperature, condition, pressure). Each array uses consistent timestamps so records at the same index can be aligned across forecast types. An associated object provides units, UTC offset, location metadata, and forecast metadata to frame the raw numbers correctly.
Coverage Notes
Magicseaweed indexes thousands of named surf spots globally. The breadCrumbs field in search results helps disambiguate spots that share names across regions. Forecast depth extends to 16 days, though confidence naturally decreases at the outer range. Tide data uses type and height fields rather than a continuous water-level series, which suits session planning but not precision marine modeling.
The Magicseaweed API is a managed, monitored endpoint for magicseaweed.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when magicseaweed.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official magicseaweed.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a surf session planner that resolves a beach name via
search_spotsand displays a 7-day wave height and wind chart fromget_spot_forecast. - Create a travel itinerary tool that cross-references
get_popular_spotsconditions with flight and accommodation availability. - Power a surf alert system that monitors swell
min/maxand gust values and notifies users when thresholds are met at a saved spot. - Render a tide table widget using the
tidesarray (type and height fields) for any spot ID. - Display a regional conditions map by resolving spot
locationlat/lon fromsearch_spotsand layering current conditions fromget_popular_spots. - Aggregate historical forecast accuracy by storing timestamped
waveandweatherresponses and comparing them against later actuals. - Enrich a surf camp booking platform with live break conditions and camera availability from the
get_popular_spotscameras field.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Magicseaweed have an official developer API?+
What does `get_spot_forecast` return and how do I control the time range?+
wave, wind, tides, and weather — each containing objects with a timestamp field for alignment. You control the horizon using the days parameter, which accepts integers from 1 to 16. Omitting days returns the default forecast window. The associated object in the response provides the UTC offset and units needed to interpret raw timestamps and measurement values correctly.Does the API return surf spot user reviews or crowd ratings?+
Can I retrieve historical forecast or observed wave data?+
How do I find the correct spot_id for a location like 'Jeffreys Bay' or 'Uluwatu'?+
query parameter to search_spots. The response returns an array of matching objects, each with an id, name, breadCrumbs (which shows the region and country hierarchy), and a type field. Use type: spot results and match on breadCrumbs to resolve ambiguity when multiple spots share a name. The id from that object is the spot_id value for get_spot_forecast.