Quick Start
Register, create an API access token, and make your first Global Fishing Watch API request in four steps.
-
Register for a Global Fishing Watch account.
-
Create an API Access Token
-
Agree to the terms of use and attribute Global Fishing Watch in anything you publish.
-
Submit HTTP request - Search a fishing vessel and get the fishing events
SEARCH A FISHING VESSEL
curl --location -g --request GET 'https://gateway.api.globalfishingwatch.org/v3/vessels/search?query=7831410&datasets[0]=public-global-vessel-identity:latest' \
-H "Authorization: Bearer [TOKEN]"# pip install gfw-api-python-client
import os
import gfwapiclient as gfw
gfw_client = gfw.Client(
access_token=os.environ["GFW_API_ACCESS_TOKEN"],
)
result = await gfw_client.vessels.search_vessels(
query="7831410",
datasets=["public-global-vessel-identity:latest"],
)# install.packages("gfwr")
library(gfwr)
gfw_vessel_info(query = 7831410,
search_type = "search")// Make sure to replace [TOKEN] with your API Access Token.
const res = await fetch(
'https://gateway.api.globalfishingwatch.org/v3/vessels/search?query=7831410&datasets[0]=public-global-vessel-identity:latest',
{ headers: { Authorization: 'Bearer [TOKEN]' } }
)
const data = await res.json()Make sure to replace [TOKEN] with your API Access Token. If the request is successful, the response includes the vessels matching your query.
{
"limit": 20,
"since": null,
"total": 1,
"entries": [
{
"dataset": "public-global-vessel-identity:v20231026",
"registryInfoTotalRecords": 1,
"registryInfo": [
{
"id": "72f191cf1cb981cefc7733d32abba37e",
"recordId": "IMO-7831410",
"sourceCode": ["IMO"],
"ssvid": "701000948",
"flag": "ARG",
"shipname": "CLAUDINA",
"nShipname": "CLAUDINA",
"callsign": "LW3058",
"imo": "7831410",
"latestVesselInfo": true,
"transmissionDateFrom": "2013-01-01T07:26:04Z",
"transmissionDateTo": "2023-04-13T14:15:39Z",
"geartype": ["FISHING"],
"lengthM": 53.6,
"tonnageGt": 369,
"vesselInfoReference": "ce19d2b7-e5a6-43bf-b439-4070f10fe74e"
}
],
"registryOwners": [
{
"name": "DESEADO PESQUERA",
"flag": "ARG",
"ssvid": "701000948",
"sourceCode": ["IMO"],
"dateFrom": "2013-01-01T07:26:04Z",
"dateTo": "2023-04-13T14:15:39Z"
}
],
"registryAuthorizations": [],
"combinedSourcesInfo": [
{
"vesselId": "e9efd1586-61cf-74a8-757d-e8b4c0664c20",
"geartypes": [
{
"name": "SQUID_JIGGER",
"source": "COMBINATION_OF_REGISTRY_AND_AIS_INFERRED_NN_INFO",
"yearFrom": 2013,
"yearTo": 2016
},
{
"name": "OTHER",
"source": "COMBINATION_OF_REGISTRY_AND_AIS_INFERRED_NN_INFO",
"yearFrom": 2012,
"yearTo": 2012
}
],
"shiptypes": [
{
"name": "FISHING",
"source": "COMBINATION_OF_REGISTRY_AND_AIS_INFERRED_NN_INFO",
"yearFrom": 2013,
"yearTo": 2016
},
{
"name": "OTHER",
"source": "COMBINATION_OF_REGISTRY_AND_AIS_INFERRED_NN_INFO",
"yearFrom": 2012,
"yearTo": 2012
}
]
},
{
"vesselId": "9b3e9019d-d67f-005a-9593-b66b997559e5",
"geartypes": [
{
"name": "SQUID_JIGGER",
"source": "COMBINATION_OF_REGISTRY_AND_AIS_INFERRED_NN_INFO",
"yearFrom": 2016,
"yearTo": 2023
}
],
"shiptypes": [
{
"name": "FISHING",
"source": "COMBINATION_OF_REGISTRY_AND_AIS_INFERRED_NN_INFO",
"yearFrom": 2016,
"yearTo": 2023
}
]
}
],
"selfReportedInfo": [
{
"id": "9b3e9019d-d67f-005a-9593-b66b997559e5",
"ssvid": "701000948",
"shipname": "CLAUDINA",
"nShipname": "CLAUDINA",
"flag": "ARG",
"callsign": "LW3058",
"imo": "7831410",
"messagesCounter": 616714906,
"positionsCounter": 1914662,
"sourceCode": ["AIS"],
"matchFields": "SEVERAL_FIELDS",
"transmissionDateFrom": "2016-12-20T20:27:39Z",
"transmissionDateTo": "2023-04-13T18:19:16Z"
},
{
"id": "e9efd1586-61cf-74a8-757d-e8b4c0664c20",
"ssvid": "701000948",
"shipname": "CLAUDINA",
"nShipname": "CLAUDINA",
"flag": "ARG",
"callsign": "LW3058",
"imo": "0",
"messagesCounter": 8313445,
"positionsCounter": 73907,
"sourceCode": ["AIS"],
"matchFields": "SEVERAL_FIELDS",
"transmissionDateFrom": "2012-01-01T04:38:08Z",
"transmissionDateTo": "2016-09-15T15:07:46Z"
}
]
}
],
"metadata": {
"query": "7831410",
"normalizedQuery": "7831410",
"didYouMean": {
"shipname": {}
}
}
}GET FISHING EVENTS
curl --location -g --request GET 'https://gateway.api.globalfishingwatch.org/v3/events?vessels[0]=9b3e9019d-d67f-005a-9593-b66b997559e5&datasets[0]=public-global-fishing-events:latest&start-date=2017-03-01&end-date=2017-03-31&limit=1&offset=0' \
-H "Authorization: Bearer [TOKEN]"result = await gfw_client.events.get_all_events(
datasets=["public-global-fishing-events:latest"],
vessels=["9b3e9019d-d67f-005a-9593-b66b997559e5"],
start_date="2017-03-01",
end_date="2017-03-31",
limit=1,
offset=0,
)gfw_event(event_type = "FISHING",
vessels = "9b3e9019d-d67f-005a-9593-b66b997559e5",
start_date = "2017-03-01",
end_date = "2017-03-31")// Make sure to replace [TOKEN] with your API Access Token.
const res = await fetch(
'https://gateway.api.globalfishingwatch.org/v3/events?vessels[0]=9b3e9019d-d67f-005a-9593-b66b997559e5&datasets[0]=public-global-fishing-events:latest&start-date=2017-03-01&end-date=2017-03-31&limit=1&offset=0',
{ headers: { Authorization: 'Bearer [TOKEN]' } }
)
const data = await res.json()Make sure to replace [TOKEN] with your API Access Token. If the request is successful, the response includes the fishing events from the vessel id found in the previous request.
{
"metadata": {
"datasets": ["public-global-fishing-events:v20231026"],
"vessels": ["9b3e9019d-d67f-005a-9593-b66b997559e5"],
"dateRange": {
"from": "2017-03-01",
"to": "2017-03-31"
}
},
"limit": 1,
"offset": 0,
"nextOffset": 1,
"total": 160,
"entries": [
{
"start": "2017-02-28T23:09:29.000Z",
"end": "2017-03-01T04:25:22.000Z",
"id": "49c5ab5a5ba4139b15ca9c039b0ea4f7",
"type": "fishing",
"position": {
"lat": -47.1439,
"lon": -62.7624
},
"regions": {
"mpa": [],
"eez": ["8466"],
"rfmo": ["ACAP", "ICCAT", "IWC", "CCSBT"],
"fao": ["41", "41.3.1", "41.3"],
"majorFao": ["41"],
"eez12Nm": [],
"highSeas": [],
"mpaNoTakePartial": [],
"mpaNoTake": []
},
"boundingBox": [-62.752836666700006, -47.16, -62.768585, -47.1277183333],
"distances": {
"startDistanceFromShoreKm": 226,
"endDistanceFromShoreKm": 225,
"startDistanceFromPortKm": 241.536047,
"endDistanceFromPortKm": 241.137141
},
"vessel": {
"id": "9b3e9019d-d67f-005a-9593-b66b997559e5",
"name": "CLAUDINA",
"ssvid": "701000948"
},
"fishing": {
"totalDistanceKm": 3.9377160441499495,
"averageSpeedKnots": 0.9047619104333333,
"averageDurationHours": 0.263236111111111,
"potentialRisk": false
}
}
]
}Search a fishing vessel by IMO = 7831410 using Vessel API
Get one fishing event from the fishing vessel searched in the previous request (first id in the selfReportedInfo object) and filter by Start Date=2017-03-01 and End Date=2017-03-31 using Events API