docs

    Feature API

    Query individual ENC features with filtering and pagination.

    Endpoint

    request
    GET https://api.chrt.co/v1/features?bbox={west},{south},{east},{north}&layer={layer}&limit={n}
    x-api-key: YOUR_API_KEY

    Query parameters

    ParamTypeRequiredDescription
    bboxstringYesBounding box as west,south,east,north
    layerstringNoS-57 object class (e.g. DEPARE, LIGHTS). Comma-separated for multiple.
    limitintegerNoMax features to return (default 100, max 1000)
    offsetintegerNoPagination offset

    Response

    response.json
    {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "geometry": {
            "type": "Polygon",
            "coordinates": [[[-70.86, 42.02], ...]]
          },
          "properties": {
            "layer": "DEPARE",
            "DRVAL1": 0,
            "DRVAL2": 3.5,
            "cell_id": "US5MA11M",
            "edition": 12
          }
        }
      ],
      "total_count": 847,
      "limit": 100,
      "offset": 0
    }

    Pagination

    Use offset and limit to page through large result sets. The total_count field indicates the total number of matching features.

    pagination.ts
    // Fetch all features in pages of 100
    let offset = 0;
    let allFeatures = [];
    
    while (true) {
      const res = await fetch(
        `https://api.chrt.co/v1/features?bbox=-71,42,-70,43&limit=100&offset=${offset}`,
        { headers: { 'x-api-key': API_KEY } }
      );
      const data = await res.json();
      allFeatures.push(...data.features);
      
      if (offset + data.features.length >= data.total_count) break;
      offset += 100;
    }

    Filtering by layer

    Pass multiple layers as comma-separated values:

    curl
    curl "https://api.chrt.co/v1/features?bbox=-71,42,-70,43&layer=DEPARE,DEPCNT&limit=50" \
      -H "x-api-key: YOUR_API_KEY"

    Error responses

    400-bad-request.json
    {
      "error": "bad_request",
      "message": "Invalid bbox parameter. Expected format: west,south,east,north"
    }
    401-unauthorized.json
    {
      "error": "unauthorized",
      "message": "Invalid or missing API key."
    }

    See the full Error Codes reference for all possible error responses.

    Query depth areas
    curl
    curl "https://api.chrt.co/v1/features?bbox=-71,42,-70,43&layer=DEPARE&limit=5" \
      -H "x-api-key: YOUR_API_KEY"
    response
    {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "geometry": { "type": "Polygon", "coordinates": [[...]] },
          "properties": {
            "layer": "DEPARE",
            "DRVAL1": 0,
            "DRVAL2": 3.5,
            "cell_id": "US5MA11M",
            "edition": 12
          }
        }
      ],
      "total_count": 847,
      "limit": 5,
      "offset": 0
    }

    For situational awareness only — not for primary navigation. CHRT is not an ECDIS and is not SOLAS-compliant.

    CHRT uses only the cookies and local storage the site needs to work — keeping you signed in, remembering your preferences, and protecting the forms. There is no analytics, no advertising and no cross-site tracking, so there is nothing here to opt out of. Privacy Policy