The stj.fyi API
Everything on stj.fyi is also open data: places with coordinates, ferry timetables, events, guides, and the live weather, sea and alert data we cache from official sources. No key, no account, free to use with attribution.
Quick start
Base URL https://stj.fyi/api/v1. Every answer is JSON in the same envelope, except GeoJSON, iCalendar and RSS. One call gives the summary the home page shows:
curl -s https://stj.fyi/api/v1/now.jsonFrom a web page, with the rule that matters most: a missing feed is never an all-clear.
const res = await fetch('https://stj.fyi/api/v1/alerts.json');
const { data, meta } = await res.json();
if (meta.freshness === 'unavailable' || data === null) {
// Unknown, not "no alerts": link to the official source instead.
showUnknown(meta.sources);
} else {
render(data.active);
}Points for a map: /places.geojson is an RFC 7946 FeatureCollection with every place (coordinates are longitude, latitude). The event calendar subscribes as /events.ics.
Content endpoints
Guide data, rebuilt with every deploy. Not rate limited. Ids come from the list endpoints.
| Endpoint | Returns |
|---|---|
/places.json | Place summaries |
/places/{id}.json | One place with attributes, facts and media credits |
/places.geojson | Every place as GeoJSON |
/places/{type}.geojson | Places of one type as GeoJSON |
/areas.json | Areas with place ids |
/areas/{id}.json | One area |
/articles.json | Article index |
/articles/{id}.json | Article metadata, outline and plain text |
/events.json | Events with timing rules and confirmed occurrences |
/events.ics | iCalendar of confirmed occurrences (next 18 months) |
/routes.json | Ferry, barge and inter-island routes |
/routes/{id}.json | One route with fares and timetable |
/media.json | Media metadata with credit lines |
/videos.json | Curated video references |
/questions.json | Top traveler questions |
/sources.json | Citation registry |
/targets.json | Valid rating targets |
Live endpoints
Read the worker cache on request. Limited to 120 requests a minute; cached for 30 seconds.
| Endpoint | Returns |
|---|---|
/routes/{id}/next.json | Next scheduled departures (AST), scheduled — not live |
/changelog.json | Refresh runs, newest first (keyset pagination: follow links.next) |
/changelog/summary.json | Per job: last run, last success, success rates, open review items |
/status.json | Current health per job, open review items with diff excerpts, content due list |
/marine.json | Sea conditions: official surf and coastal forecasts, observations and the wave model, each with its own freshness |
/tsunami.json | Official tsunami messages in effect for St. |
/tropical.json | Atlantic systems, outlook areas and official storm products for St. |
/notices.json | FAA airport status for STT, WAPA advisories and agency press releases |
/cruise-ships.json | Cruise ships at St. |
/water-quality.json | St. |
/sargassum.json | Regional sargassum products: DPNR update, NOAA inundation risk, USF outlook |
/park-programs.json | Friends of VINP event listings for today and the next days (AST) |
/now.json | One-call summary: top advisory, conditions, sea, next ferries, power, tropical, sunset |
/today.json | Alias of /now.json (backward compatibility) |
/weather.json | Current (model), NWS forecast and 48-hour hourly (official), 7-day outlook (model), UV and heat |
/tides.json | Lameshur Bay tide predictions (7 days) and observed water level and temperature |
/alerts.json | Active NWS land and marine advisories and PTWC tsunami messages, severity-sorted |
/earthquakes.json | Regional earthquakes with distance from St. |
/power.json | St. |
/air-quality.json | Modeled air quality and Saharan dust (labeled model) |
/ratings | Rating aggregates for up to 100 targets, in request order (zeros when unrated) |
POST /ratings | Rate a target 1–5 stars, anonymously. |
Conventions
- Envelope.
dataholds the answer;metasays when it was made, how fresh it is and where it came from:
{
"data": { … },
"meta": {
"apiVersion": "1",
"generatedAt": "2026-11-24T18:02:11Z",
"freshness": "live",
"sources": [
{ "key": "nws-alerts", "name": "National Weather Service San Juan",
"url": "https://api.weather.gov/alerts/active?zone=VIZ001",
"fetchedAt": "2026-11-24T18:00:03Z", "expiresAt": "2026-11-24T18:06:03Z" }
],
"license": "…",
"docs": "https://stj.fyi/developers"
},
"links": { "self": "https://stj.fyi/api/v1/alerts.json" }
}- Freshness.
meta.freshnessislive,current,aging,staleorunavailable, the worst state of its sources. A live endpoint whose source is down answers200withdata: nullandunavailable— never an empty list that could read as "no alerts". - Official first. Blocks say whether they are official forecasts, observations or model output. Show official warnings above anything derived.
- Times are ISO 8601: instants in UTC (
Z), local times with-04:00(Atlantic Standard Time, no daylight saving). - Units are in the field name:
tempF,windMph,waveFt,rainIn,distanceMi. - Parameters are documented per endpoint in the OpenAPI document; unknown ones are ignored.
Caching and conditional requests
Every GET answer carries a strong ETag, a hash of its exact bytes. Send it back as If-None-Match and, while nothing changed, you get an empty 304:
curl -sI https://stj.fyi/api/v1/places.json | grep -i etag
# ETag: "3f1c…"
curl -s -o /dev/null -w '%{http_code}\n' \
-H 'If-None-Match: "3f1c…"' https://stj.fyi/api/v1/places.json
# 304- Content endpoints change only when we publish, at most a few times a day. Polling them hourly is plenty.
- Live endpoints are cached for 30 seconds (
Cache-Control) and sendLast-Modified(the newest fetch time;If-Modified-Sinceworks too). The sources behind them refresh every few minutes, so polling more often than once a minute gains nothing.
CORS
Every GET and HEAD under /api/v1/, including the GeoJSON and iCalendar files and error answers, sends Access-Control-Allow-Origin: * and exposes ETag, Last-Modified, Retry-After, RateLimit and RateLimit-Policy to scripts. Preflight OPTIONS requests get 204. Sending ratings (POST /ratings) is limited to stj.fyi pages.
Rate limits
Live endpoints allow 120 requests per 60 seconds per client. Each answer says where you stand: RateLimit-Policy: "live";q=120;w=60 and RateLimit: "live";r=<left>;t=<seconds to reset>. Over the limit you get 429 with Retry-After. Content endpoints and feeds are not limited. We count by a hash of your address with a salt that changes daily; the address itself is never stored.
Errors
Errors are RFC 9457 problem documents (application/problem+json) with a stable code, also for paths that do not exist. All error codes explain what happened and what to do.
Feeds
For people rather than programs, Feeds lists each of them with what it carries and how to subscribe.
- Guides RSS: new and substantially updated guides.
- Alerts RSS: every official alert update, also per category: weather, marine, power, earthquakes, tropical, tsunami.
- Changelog RSS: content updates and unusual data runs.
- Event calendar (iCalendar): confirmed dates for the next 18 months.
License and attribution
Content © stj.fyi, CC BY 4.0 unless noted; media keeps its own license and credit; live data per source terms.
- Guide text and place data: CC BY 4.0. Credit "stj.fyi" with a link to the page or record you used.
- Photos and videos keep their own license; every
mediaobject carries its credit line, license and source. Show the credit with the image. - Live data belongs to its provider (National Weather Service, NOAA, USGS, WAPA, …) and follows their terms. Name the source from
meta.sourcesnext to the data. - Ratings are anonymous aggregates. Show them with their count, and please do not publish them as structured-data review ratings.
Changelog
This is version 1. New fields and endpoints are added to it without notice in the data; removing or renaming a field needs a new version (/api/v2) and runs side by side for six months, with Deprecation and Sunset headers on the old one.
- API documentation at /developers and /developers/errors. Prerendered endpoints (places, areas, articles, events, routes, GeoJSON, iCalendar, OpenAPI) now send CORS headers and a strong content-hash ETag like the live ones, and answer If-None-Match with 304; live endpoints also answer 304 when served from their 30-second cache; preflight OPTIONS gets 204 everywhere under /api/v1; unknown API paths and unbuilt ids answer a JSON not-found problem instead of the HTML 404 page (P9.5).