ExamplesEvents
Get fishing events within an existing region (Senegal EEZ) (POST)
Example POST request for apparent fishing events inside an existing region, the Senegal EEZ.
Query parameters
| Parameter | Value | Description |
|---|---|---|
offset | 0 | Pagination offset |
limit | 1 | Max number of events returned |
Request body
| Field | Value | Description |
|---|---|---|
datasets | ["public-global-fishing-events:latest"] | Fishing events dataset |
startDate | 2020-10-01 | Start of the date range |
endDate | 2020-12-31 | End of the date range |
flags | ["CHN"] | Filter by vessel flag |
region.dataset | public-eez-areas | Existing region dataset |
region.id | 8371 | Senegal 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?offset=0&limit=1' \
--header 'Authorization: Bearer [TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
"datasets": [ "public-global-fishing-events:latest"],
"startDate": "2020-10-01",
"endDate": "2020-12-31",
"flags": ["CHN"],
"region": {
"dataset": "public-eez-areas",
"id": 8371
}
}'result = await gfw_client.events.get_all_events(
datasets=["public-global-fishing-events:latest"],
start_date="2020-10-01",
end_date="2020-12-31",
flags=["CHN"],
region={
"dataset": "public-eez-areas",
"id": 8371,
},
)// Make sure to replace [TOKEN] with your API Access Token.
const res = await fetch('https://gateway.api.globalfishingwatch.org/v3/events?offset=0&limit=1', {
method: 'POST',
headers: {
Authorization: 'Bearer [TOKEN]',
'Content-Type': 'application/json',
},
body: JSON.stringify({
datasets: ['public-global-fishing-events:latest'],
startDate: '2020-10-01',
endDate: '2020-12-31',
flags: ['CHN'],
region: {
dataset: 'public-eez-areas',
id: 8371,
},
}),
})
const data = await res.json()Response
{
"metadata": {
"datasets": ["public-global-fishing-events:v3.0"],
"dateRange": {
"from": "2020-10-01",
"to": "2020-12-31"
},
"encounterTypes": [],
"flags": ["CHN"],
"region": {
"dataset": "public-eez-areas",
"id": 8371
}
},
"limit": 1,
"offset": 0,
"nextOffset": 1,
"total": 627572,
"entries": [
{
"start": "2020-09-26T01:43:25.000Z",
"end": "2020-10-07T06:33:31.000Z",
"id": "d2a6b63ea4b654c038194a3fc88ba7ac",
"type": "fishing",
"position": {
"lat": 39.6907,
"lon": 124.0237
},
"regions": {
"mpa": [],
"eez": ["8486"],
"rfmo": ["ACAP", "IWC", "PICES", "WCPFC"],
"fao": ["61"],
"majorFao": ["61"],
"eez12Nm": ["8486"],
"highSeas": [],
"mpaNoTakePartial": [],
"mpaNoTake": []
},
"boundingBox": [124.0155016667, 39.6785533333, 124.035055, 39.6993483333],
"distances": {
"startDistanceFromShoreKm": 16,
"endDistanceFromShoreKm": 14,
"startDistanceFromPortKm": 2.382918,
"endDistanceFromPortKm": 4.529377
},
"vessel": {
"id": "d320fba36-69f1-1feb-849b-a03829f8860c",
"name": "LIAODANYU23523",
"ssvid": "412223961"
},
"fishing": {
"totalDistanceKm": 9.705851662418958,
"averageSpeedKnots": 0.21297844288636178,
"averageDurationHours": 0.11517397789514866,
"potentialRisk": false
}
}
]
}Get port visit events with a custom polygon and duration filter (POST)
Example POST request for port visit events inside a custom GeoJSON polygon, filtered by event duration.
Get encounter events statistics filtered by flag and duration (POST)
Example events statistics request for carrier-fishing encounters, filtered by vessel type and date range.