Examples4Wings Reports
Generate fishing effort report grouped by year and by custom polygon in JSON format
Example 4Wings report for apparent fishing effort over a custom polygon, aggregated yearly and grouped by flag, as JSON.
Query parameters
| Parameter | Value | Description |
|---|---|---|
spatial-resolution | LOW | Low spatial resolution |
temporal-resolution | YEARLY | Aggregate by year |
group-by | FLAG | Group results by vessel flag |
datasets[0] | public-global-fishing-effort:latest | AIS apparent fishing effort dataset |
date-range | 2021-01-01,2022-01-01 | Filter to this time period |
format | JSON | Response format |
Request body
| Field | Value | Description |
|---|---|---|
geojson | custom Polygon | Custom region to report on |
Request
# Make sure to replace [TOKEN] with your API Access Token.
curl --location --globoff 'https://gateway.api.globalfishingwatch.org/v3/4wings/report?spatial-resolution=LOW&temporal-resolution=YEARLY&group-by=FLAG&datasets[0]=public-global-fishing-effort%3Alatest&date-range=2021-01-01%2C2022-01-01&format=JSON' \
-H "Authorization: Bearer [TOKEN]"
-H 'Content-Type: application/json' \
--data-raw '{"geojson":{"type":"Polygon","coordinates":[[[-76.11328125,-26.273714024406416],[-76.201171875,-26.980828590472093],[-76.376953125,-27.527758206861883],[-76.81640625,-28.30438068296276],[-77.255859375,-28.767659105691244],[-77.87109375,-29.152161283318918],[-78.486328125,-29.45873118535532],[-79.189453125,-29.61167011519739],[-79.892578125,-29.6880527498568],[-80.595703125,-29.61167011519739],[-81.5625,-29.382175075145277],[-82.177734375,-29.07537517955835],[-82.705078125,-28.6905876542507],[-83.232421875,-28.071980301779845],[-83.49609375,-27.683528083787756],[-83.759765625,-26.980828590472093],[-83.84765625,-26.35249785815401],[-83.759765625,-25.64152637306576],[-83.583984375,-25.16517336866393],[-83.232421875,-24.447149589730827],[-82.705078125,-23.966175871265037],[-82.177734375,-23.483400654325635],[-81.5625,-23.241346102386117],[-80.859375,-22.998851594142906],[-80.15625,-22.917922936146027],[-79.453125,-22.998851594142906],[-78.662109375,-23.1605633090483],[-78.134765625,-23.40276490540795],[-77.431640625,-23.885837699861995],[-76.9921875,-24.28702686537642],[-76.552734375,-24.846565348219727],[-76.2890625,-25.48295117535531],[-76.11328125,-26.273714024406416]]]}}'result = await gfw_client.fourwings.create_report(
datasets=["public-global-fishing-effort:latest"],
spatial_resolution="LOW",
temporal_resolution="YEARLY",
group_by="FLAG",
start_date="2021-01-01",
end_date="2022-01-01",
geojson={
"type": "Polygon",
"coordinates": [
[
[-76.11328125, -26.273714024406416],
[-76.201171875, -26.980828590472093],
[-76.376953125, -27.527758206861883],
[-76.81640625, -28.30438068296276],
[-77.255859375, -28.767659105691244],
[-77.87109375, -29.152161283318918],
[-78.486328125, -29.45873118535532],
[-79.189453125, -29.61167011519739],
[-79.892578125, -29.6880527498568],
[-80.595703125, -29.61167011519739],
[-81.5625, -29.382175075145277],
[-82.177734375, -29.07537517955835],
[-82.705078125, -28.6905876542507],
[-83.232421875, -28.071980301779845],
[-83.49609375, -27.683528083787756],
[-83.759765625, -26.980828590472093],
[-83.84765625, -26.35249785815401],
[-83.759765625, -25.64152637306576],
[-83.583984375, -25.16517336866393],
[-83.232421875, -24.447149589730827],
[-82.705078125, -23.966175871265037],
[-82.177734375, -23.483400654325635],
[-81.5625, -23.241346102386117],
[-80.859375, -22.998851594142906],
[-80.15625, -22.917922936146027],
[-79.453125, -22.998851594142906],
[-78.662109375, -23.1605633090483],
[-78.134765625, -23.40276490540795],
[-77.431640625, -23.885837699861995],
[-76.9921875, -24.28702686537642],
[-76.552734375, -24.846565348219727],
[-76.2890625, -25.48295117535531],
[-76.11328125, -26.273714024406416],
]
],
},
)// Make sure to replace [TOKEN] with your API Access Token.
const res = await fetch(
'https://gateway.api.globalfishingwatch.org/v3/4wings/report?spatial-resolution=LOW&temporal-resolution=YEARLY&group-by=FLAG&datasets[0]=public-global-fishing-effort%3Alatest&date-range=2021-01-01%2C2022-01-01&format=JSON',
{
method: 'POST',
headers: {
Authorization: 'Bearer [TOKEN]',
'Content-Type': 'application/json',
},
body: JSON.stringify({
geojson: {
type: 'Polygon',
coordinates: [
[
[-76.11328125, -26.273714024406416],
[-76.201171875, -26.980828590472093],
[-76.376953125, -27.527758206861883],
[-76.81640625, -28.30438068296276],
[-77.255859375, -28.767659105691244],
[-77.87109375, -29.152161283318918],
[-78.486328125, -29.45873118535532],
[-79.189453125, -29.61167011519739],
[-79.892578125, -29.6880527498568],
[-80.595703125, -29.61167011519739],
[-81.5625, -29.382175075145277],
[-82.177734375, -29.07537517955835],
[-82.705078125, -28.6905876542507],
[-83.232421875, -28.071980301779845],
[-83.49609375, -27.683528083787756],
[-83.759765625, -26.980828590472093],
[-83.84765625, -26.35249785815401],
[-83.759765625, -25.64152637306576],
[-83.583984375, -25.16517336866393],
[-83.232421875, -24.447149589730827],
[-82.705078125, -23.966175871265037],
[-82.177734375, -23.483400654325635],
[-81.5625, -23.241346102386117],
[-80.859375, -22.998851594142906],
[-80.15625, -22.917922936146027],
[-79.453125, -22.998851594142906],
[-78.662109375, -23.1605633090483],
[-78.134765625, -23.40276490540795],
[-77.431640625, -23.885837699861995],
[-76.9921875, -24.28702686537642],
[-76.552734375, -24.846565348219727],
[-76.2890625, -25.48295117535531],
[-76.11328125, -26.273714024406416],
],
],
},
}),
}
)
const data = await res.json()Response
{
"total": 1,
"limit": null,
"offset": null,
"nextOffset": null,
"metadata": {},
"entries": [
{
"public-global-fishing-effort:v3": [
{
"date": "2021",
"flag": "ESP",
"hours": 0.4283333333333333,
"lat": -27.3,
"lon": -82,
"vesselIDs": 1
},
{
"date": "2021",
"flag": "ESP",
"hours": 0.9591666666666667,
"lat": -24.7,
"lon": -78.6,
"vesselIDs": 2
}
]
}
]
}