Python — gfw-api-python-client
gfw-api-python-client gives Python users direct access to API v3, built for Jupyter notebooks and data scripts alongside pandas and geopandas.
The gfw-api-python-client package provides Python users with direct access to Global Fishing Watch API v3. It enables seamless integration into Python-based workflows, including Jupyter notebooks and data scripts.
📌 Important: gfw-api-python-client version 1 corresponds to Global Fishing Watch API version 3. As of April 30, 2024, API v3 is the standard.
Features
- Built-in functions for Vessels identity, Events, Vessel Insights, apparent Fishing Effort (4Wings), and SAR vessel detections APIs.
- Simple authentication and token management.
- Jupyter notebook examples for quick testing and exploration.
- Support for filtering, pagination, and spatial/temporal parameters.
- Compatible with
pandas,geopandas, andJupyter.
Installation
Requires Python ≥ 3.11. A virtual environment is recommended.
pip install gfw-api-python-clientAuthentication
Request an API token from the GFW API Portal, then set it as the GFW_API_ACCESS_TOKEN environment variable before instantiating the client.
import os
import gfwapiclient as gfw
access_token = os.environ.get(
"GFW_API_ACCESS_TOKEN",
"<OR_PASTE_YOUR_GFW_API_ACCESS_TOKEN_HERE>",
)
gfw_client = gfw.Client(
access_token=access_token,
)Quick start
The client is async-first — API methods are called with await.
vessel_search_result = await gfw_client.vessels.search_vessels(
query="412331038",
)To learn more, visit the GitHub python-client official page.