Global Fishing Watch API
ExamplesEvents

Get port visit events statistics in a region id (Senegal) (POST)

Example events statistics request for port visits in an existing region id, Senegal.

Request body

FieldValueDescription
confidences["3","4"]Confidence levels of port visits to include
datasets["public-global-port-visits-events:latest"]Port visits events dataset
startDate2018-01-01Start of the date range
endDate2019-01-31End of the date range
timeseriesIntervalYEARTimeseries aggregation interval
region.datasetpublic-eez-areasExisting region dataset
region.id8371Senegal EEZ region id

Request

# Make sure to replace [TOKEN] with your API Access Token.
curl --location --request POST 'https://gateway.api.globalfishingwatch.org/v3/events/stats' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
--header 'Content-Type: application/json' \
--data-raw '{
    "confidences": [ "3","4"],
    "datasets": [ "public-global-port-visits-events:latest"],
    "startDate": "2018-01-01",
    "endDate": "2019-01-31",
    "timeseriesInterval": "YEAR",
    "region":  {
        "dataset": "public-eez-areas",
        "id": 8371
    }
}
'

Response

{
  "numEvents": 4366,
  "numFlags": 72,
  "numVessels": 1368,
  "flags": [
    "SWE",
    "FRA",
    "unknown",
    "GIB",
    "TZA",
    "ATG",
    "PRT",
    "GRC",
    "TUV",
    "CAN",
    "THA",
    "NLD",
    "ESP",
    "NGA",
    "COK",
    "HRV",
    "MNE",
    "KNA",
    "COM",
    "BRB",
    "HKG",
    "GNB",
    "GHA",
    "CIV",
    "SOM",
    "CHN",
    "TGO",
    "LUX",
    "UKR",
    "SEN",
    "KIR",
    "CHE",
    "VNM",
    "VCT",
    "KOR",
    "SLV",
    "DNK",
    "BEL",
    "MLT",
    "TWN",
    "DEU",
    "AUS",
    "USA",
    "VUT",
    "NOR",
    "CYM",
    "TUR",
    "NIU",
    "PHL",
    "GBR",
    "POL",
    "BHS",
    "SLE",
    "SYC",
    "CYP",
    "BMU",
    "AGO",
    "PCN",
    "BLZ",
    "CPV",
    "PLW",
    "WLF",
    "SGP",
    "GIN",
    "MHL",
    "BES",
    "WSM",
    "RUS",
    "ITA",
    "GMB",
    "MAR",
    "LBR",
    "PAN"
  ],
  "timeseries": [
    {
      "date": "2018-01-01T00:00:00.000Z",
      "value": 4003
    },
    {
      "date": "2019-01-01T00:00:00.000Z",
      "value": 363
    }
  ]
}