Global Fishing Watch API
ExamplesEvents

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

Example POST request for loitering 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-loitering-events:latest"]Loitering events dataset
startDate2017-01-01Start of the date range
endDate2017-01-31End of the date range
vessels["82be6f228-8ce4-26d1-bf81-3b7979d0c72f"]Vessel id to filter events for
flags["KOR"]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-loitering-events:latest"],
    "startDate": "2017-01-01",
    "endDate": "2017-01-31",
    "vessels": ["82be6f228-8ce4-26d1-bf81-3b7979d0c72f"],
    "flags": ["KOR"],
    "duration": 60,
    "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              43.835981972515576,
              -6.785011952437713
            ],
            [
              43.83602857589722,
              -6.785011952437713
            ],
            [
              43.83602857589722,
              -6.784984652340707
            ],
            [
              43.835981972515576,
              -6.784984652340707
            ],
            [
              43.835981972515576,
              -6.785011952437713
            ]
          ]
        ]
      }
}'

Response

{
  "metadata": {
    "datasets": ["public-global-loitering-events-carriers:v20201001"],
    "vessels": ["82be6f228-8ce4-26d1-bf81-3b7979d0c72f"],
    "dateRange": {
      "from": "2017-01-01",
      "to": "2017-01-31"
    },
    "encounterTypes": [],
    "flags": ["KOR"],
    "geometry": {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "properties": {},
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [43.835981972515576, -6.785011952437713],
                [43.83602857589722, -6.785011952437713],
                [43.83602857589722, -6.784984652340707],
                [43.835981972515576, -6.784984652340707],
                [43.835981972515576, -6.785011952437713]
              ]
            ]
          }
        }
      ]
    }
  },
  "limit": 1,
  "offset": 0,
  "nextOffset": null,
  "total": 0,
  "entries": []
}