Global Fishing Watch API
ExamplesEvents

Get encounter events with a custom polygon and duration filter (POST)

Example POST request for encounter events inside a custom GeoJSON polygon, filtered by event duration.

Query parameters

ParameterValueDescription
offset0Pagination offset
limit1Max number of events returned

Request body

FieldValueDescription
datasets["public-global-encounters-events:latest"]Encounter events dataset
startDate2017-01-01Start of the date range
endDate2017-01-31End of the date range
vessels["55d38c0ee-e0d7-cb32-ac9c-8b3680d213b3"]Vessel id to filter events for
flags["TWN"]Filter by vessel flag
duration60Minimum event duration in minutes
geometrycustom PolygonCustom region to filter events in

Request

# Make sure to replace [TOKEN] with your API Access Token.
curl --location --request POST 'https://gateway.api.globalfishingwatch.org/v3/events?offset=0&limit=1' \
--header 'Authorization: Bearer [TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
    "datasets": [ "public-global-encounters-events:latest"],
    "startDate": "2017-01-01",
    "endDate": "2017-01-31",
    "vessels": ["55d38c0ee-e0d7-cb32-ac9c-8b3680d213b3"],
    "flags": ["TWN"],
    "duration": 60,
    "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -130.9735107421875,
              -17.691128657307427
            ],
            [
              -130.4901123046875,
              -17.691128657307427
            ],
            [
              -130.4901123046875,
              -17.209017141391765
            ],
            [
              -130.9735107421875,
              -17.209017141391765
            ],
            [
              -130.9735107421875,
              -17.691128657307427
            ]
          ]
        ]
      }


}'

Response

{
  "metadata": {
    "datasets": ["public-global-encounters-events:v3.0"],
    "vessels": ["55d38c0ee-e0d7-cb32-ac9c-8b3680d213b3"],
    "dateRange": {
      "from": "2017-01-01",
      "to": "2017-01-31"
    },
    "encounterTypes": [
      "FISHING-FISHING",
      "FISHING-CARRIER",
      "FISHING-SUPPORT",
      "CARRIER-FISHING",
      "SUPPORT-FISHING"
    ],
    "flags": ["TWN"],
    "geometry": {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "properties": {},
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [-130.9735107421875, -17.691128657307427],
                [-130.4901123046875, -17.691128657307427],
                [-130.4901123046875, -17.209017141391765],
                [-130.9735107421875, -17.209017141391765],
                [-130.9735107421875, -17.691128657307427]
              ]
            ]
          }
        }
      ]
    }
  },
  "limit": 1,
  "offset": 0,
  "nextOffset": 1,
  "total": 1,
  "entries": [
    {
      "start": "2017-01-01T00:50:00.000Z",
      "end": "2017-01-01T04:30:00.000Z",
      "id": "05e5fcf80f3542a33154214f0a586f19.2",
      "type": "encounter",
      "position": {
        "lat": -17.4783,
        "lon": -130.7285
      },
      "regions": {
        "mpa": [],
        "eez": [],
        "rfmo": ["WCPFC", "ACAP", "IWC", "IATTC", "SPRFMO"],
        "fao": ["77"],
        "majorFao": ["77"],
        "eez12Nm": [],
        "highSeas": ["63203"],
        "mpaNoTakePartial": [],
        "mpaNoTake": []
      },
      "boundingBox": [-130.7285232872, -17.4782849293, -130.7285232872, -17.4782849293],
      "distances": {
        "startDistanceFromShoreKm": 602,
        "endDistanceFromShoreKm": 602,
        "startDistanceFromPortKm": 760.023188,
        "endDistanceFromPortKm": 760.023188
      },
      "vessel": {
        "id": "55d38c0ee-e0d7-cb32-ac9c-8b3680d213b3",
        "name": "JINHSIANGFA",
        "ssvid": "416077500"
      },
      "encounter": {
        "vessel": {
          "id": "46ae0e5f9-9304-7ac9-dc78-462d84320bf5",
          "flag": "TWN",
          "name": "SHUNTIANFA168",
          "type": "carrier",
          "ssvid": "416602000"
        },
        "medianDistanceKilometers": 0.016,
        "medianSpeedKnots": 1.067,
        "type": "fishing-carrier",
        "potentialRisk": false
      }
    }
  ]
}