stj.fyi home
Search

Search stj.fyi

    All results and filters

    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.json

    From 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.

    EndpointReturns
    /places.jsonPlace summaries
    /places/{id}.jsonOne place with attributes, facts and media credits
    /places.geojsonEvery place as GeoJSON
    /places/{type}.geojsonPlaces of one type as GeoJSON
    /areas.jsonAreas with place ids
    /areas/{id}.jsonOne area
    /articles.jsonArticle index
    /articles/{id}.jsonArticle metadata, outline and plain text
    /events.jsonEvents with timing rules and confirmed occurrences
    /events.icsiCalendar of confirmed occurrences (next 18 months)
    /routes.jsonFerry, barge and inter-island routes
    /routes/{id}.jsonOne route with fares and timetable
    /media.jsonMedia metadata with credit lines
    /videos.jsonCurated video references
    /questions.jsonTop traveler questions
    /sources.jsonCitation registry
    /targets.jsonValid rating targets

    Live endpoints

    Read the worker cache on request. Limited to 120 requests a minute; cached for 30 seconds.

    EndpointReturns
    /routes/{id}/next.jsonNext scheduled departures (AST), scheduled — not live
    /changelog.jsonRefresh runs, newest first (keyset pagination: follow links.next)
    /changelog/summary.jsonPer job: last run, last success, success rates, open review items
    /status.jsonCurrent health per job, open review items with diff excerpts, content due list
    /marine.jsonSea conditions: official surf and coastal forecasts, observations and the wave model, each with its own freshness
    /tsunami.jsonOfficial tsunami messages in effect for St.
    /tropical.jsonAtlantic systems, outlook areas and official storm products for St.
    /notices.jsonFAA airport status for STT, WAPA advisories and agency press releases
    /cruise-ships.jsonCruise ships at St.
    /water-quality.jsonSt.
    /sargassum.jsonRegional sargassum products: DPNR update, NOAA inundation risk, USF outlook
    /park-programs.jsonFriends of VINP event listings for today and the next days (AST)
    /now.jsonOne-call summary: top advisory, conditions, sea, next ferries, power, tropical, sunset
    /today.jsonAlias of /now.json (backward compatibility)
    /weather.jsonCurrent (model), NWS forecast and 48-hour hourly (official), 7-day outlook (model), UV and heat
    /tides.jsonLameshur Bay tide predictions (7 days) and observed water level and temperature
    /alerts.jsonActive NWS land and marine advisories and PTWC tsunami messages, severity-sorted
    /earthquakes.jsonRegional earthquakes with distance from St.
    /power.jsonSt.
    /air-quality.jsonModeled air quality and Saharan dust (labeled model)
    /ratingsRating aggregates for up to 100 targets, in request order (zeros when unrated)
    POST /ratingsRate a target 1–5 stars, anonymously.

    Conventions

    • Envelope. data holds the answer; meta says 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.freshness is live, current, aging, stale or unavailable, the worst state of its sources. A live endpoint whose source is down answers 200 with data: null and unavailable — 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 send Last-Modified (the newest fetch time; If-Modified-Since works 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.

    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 media object 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.sources next 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).

    API changes in the site changelog