> For the complete documentation index, see [llms.txt](https://taghazout.gitbook.io/taghazout-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://taghazout.gitbook.io/taghazout-docs/endpoint-reference.md).

# endpoint reference

## Get current conditions

```http
GET https://taghazout.io/weather-data/_feed.php
```

### Query parameters

| Parameter | Type   | Required                     | Description                        |
| --------- | ------ | ---------------------------- | ---------------------------------- |
| `loc`     | string | No (defaults to `taghazout`) | A spot key — see the spot registry |

### Response

`200 OK`, `application/json`.

```json
{
  "ok": true,
  "feed_type": "compact_surf_forecast_summary",
  "spot": {
    "key": "anchor-point",
    "name": "Anchor Point",
    "area": "North Taghazout",
    "route": "/weather/anchor-point/",
    "guide_route": "/surf-spots/anchor-point/"
  },
  "updated_at": "2026-08-16T16:00",
  "source_status": "live",
  "air_temp_c": 23.7,
  "water_temp_c": 21.6,
  "wind_kmh": 11.2,
  "gust_kmh": 24.1,
  "swell_m": 0.66,
  "period_s": 8.4,
  "swell_direction_deg": 319,
  "sea_state_m": 1.2,
  "wind_wave_ratio": 0.55,
  "sunrise": "2026-08-16T07:06",
  "sunset": "2026-08-16T20:18",
  "uv_index_max": 8.4,
  "surf_potential_percent": 82,
  "best_window": "08:00-11:00",
  "beginner_verdict": "...",
  "advanced_verdict": "...",
  "tide": {
    "label": "Rising tide",
    "trend": "rising",
    "height_m": 2.53,
    "time": "16:00",
    "datum": "modelled sea level (Open-Meteo), relative to this window's low"
  }
}
```

### Field notes

| Field                      | Notes                                                                                                                                                                         |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `swell_m` vs `sea_state_m` | `swell_m` is the decomposed swell component. `sea_state_m` is total sea including local wind wave. They are different numbers, and mixing them up is the most common mistake. |
| `wind_wave_ratio`          | 0–1. Higher means more of the sea state is local chop, i.e. messier.                                                                                                          |
| `surf_potential_percent`   | Composite 0–100 score for the current window.                                                                                                                                 |
| `tide.height_m`            | **Modelled sea level**, relative to the low point of this forecast window. Not a harbour gauge, not chart datum, not for navigation.                                          |
| `source_status`            | `live` when models responded; degraded values are flagged rather than hidden.                                                                                                 |

## Errors

The endpoint returns `ok: false` in the body rather than a non-200 status when a spot cannot be resolved or upstream models are unavailable.

{% hint style="warning" %}
Always check `ok` before reading values.
{% endhint %}

## Rate limiting

There is no hard limit, but please cache for a few minutes. The upstream ocean models refresh every few hours, so more frequent polling returns identical data.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://taghazout.gitbook.io/taghazout-docs/endpoint-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
