# Generate report with total fishing hours per Lat/Lon grid cell using existing regions (MPA Dorsal de Nasca) in JSON format and buffer of 4 nautical miles (/docs/examples/report/report-example4)



> To get details of existing regions, check [Regions in the Reference data section](/docs/v3/general-api-doc/reference-data)

## GET [#get]

**Query parameters**

| Parameter             | Value                                 | Description                               |
| --------------------- | ------------------------------------- | ----------------------------------------- |
| `spatial-resolution`  | `LOW`                                 | Low spatial resolution                    |
| `temporal-resolution` | `ENTIRE`                              | Aggregate over the entire date range      |
| `spatial-aggregation` | `false`                               | Don't aggregate spatially (per grid cell) |
| `datasets[0]`         | `public-global-fishing-effort:latest` | AIS apparent fishing effort dataset       |
| `date-range`          | `2022-05-01,2022-12-01`               | Filter to this time period                |
| `format`              | `JSON`                                | Response format                           |
| `region-id`           | `555745302`                           | MPA Dorsal de Nasca region id             |
| `region-dataset`      | `public-mpa-all`                      | Existing region dataset                   |
| `buffer-value`        | `4`                                   | Buffer distance around the region         |
| `buffer-unit`         | `NAUTICALMILES`                       | Unit for the region buffer                |

**Request**

<Tabs items="['cURL', 'Python', 'JavaScript']">
  <Tab value="cURL">
    ```shell
    # Make sure to replace [TOKEN] with your API Access Token.
    curl --location -g --request GET 'https://gateway.api.globalfishingwatch.org/v3/4wings/report?spatial-resolution=LOW&temporal-resolution=ENTIRE&spatial-aggregation=false&datasets[0]=public-global-fishing-effort:latest&date-range=2022-05-01,2022-12-01&format=JSON&region-id=555745302&region-dataset=public-mpa-all&buffer-value=4&buffer-unit=NAUTICALMILES'\
    --header 'Authorization: Bearer [TOKEN]' \
    --header 'Content-Type: application/json' \
    --output 'report-grouped.json'
    ```
  </Tab>

  <Tab value="Python">
    ```python
    result = await gfw_client.fourwings.create_report(
        datasets=["public-global-fishing-effort:latest"],
        spatial_resolution="LOW",
        temporal_resolution="ENTIRE",
        spatial_aggregation=False,
        start_date="2022-05-01",
        end_date="2022-12-01",
        region={
            "dataset": "public-mpa-all",
            "id": 555745302,
            "bufferUnit": "NAUTICALMILES",
            "bufferValue": 4,
        },
    )
    ```
  </Tab>

  <Tab value="JavaScript">
    ```js
    // 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=ENTIRE&spatial-aggregation=false&datasets[0]=public-global-fishing-effort:latest&date-range=2022-05-01,2022-12-01&format=JSON&region-id=555745302&region-dataset=public-mpa-all&buffer-value=4&buffer-unit=NAUTICALMILES',
      { headers: { Authorization: 'Bearer [TOKEN]' } }
    )
    const data = await res.blob()
    ```
  </Tab>
</Tabs>

## POST [#post]

**Query parameters**

| Parameter             | Value                                 | Description                               |
| --------------------- | ------------------------------------- | ----------------------------------------- |
| `spatial-resolution`  | `LOW`                                 | Low spatial resolution                    |
| `temporal-resolution` | `ENTIRE`                              | Aggregate over the entire date range      |
| `spatial-aggregation` | `false`                               | Don't aggregate spatially (per grid cell) |
| `datasets[0]`         | `public-global-fishing-effort:latest` | AIS apparent fishing effort dataset       |
| `date-range`          | `2022-05-01,2022-12-01`               | Filter to this time period                |
| `format`              | `JSON`                                | Response format                           |

**Request body**

| Field                | Value            | Description                       |
| -------------------- | ---------------- | --------------------------------- |
| `region.dataset`     | `public-mpa-all` | Existing region dataset           |
| `region.id`          | `555745302`      | MPA Dorsal de Nasca region id     |
| `region.bufferUnit`  | `NAUTICALMILES`  | Unit for the region buffer        |
| `region.bufferValue` | `4`              | Buffer distance around the region |

**Request**

<Tabs items="['cURL', 'Python', 'JavaScript']">
  <Tab value="cURL">
    ```shell
    # Make sure to replace [TOKEN] with your API Access Token.
    curl --location -g --request POST 'https://gateway.api.globalfishingwatch.org/v3/4wings/report?spatial-resolution=LOW&temporal-resolution=ENTIRE&spatial-aggregation=false&datasets[0]=public-global-fishing-effort:latest&date-range=2022-05-01,2022-12-01&format=JSON'\
    --header 'Authorization: Bearer [TOKEN]' \
    --header 'Content-Type: application/json' \
    --output 'report-grouped.json' \
    --data-raw '{
        "region": {
            "dataset": "public-mpa-all",
            "id": 555745302,
            "bufferUnit": "NAUTICALMILES",
            "bufferValue": 4
        }
    }'
    ```
  </Tab>

  <Tab value="Python">
    ```python
    result = await gfw_client.fourwings.create_report(
        datasets=["public-global-fishing-effort:latest"],
        spatial_resolution="LOW",
        temporal_resolution="ENTIRE",
        spatial_aggregation=False,
        start_date="2022-05-01",
        end_date="2022-12-01",
        region={
            "dataset": "public-mpa-all",
            "id": 555745302,
            "bufferUnit": "NAUTICALMILES",
            "bufferValue": 4,
        },
    )
    ```
  </Tab>

  <Tab value="JavaScript">
    ```js
    // 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=ENTIRE&spatial-aggregation=false&datasets[0]=public-global-fishing-effort:latest&date-range=2022-05-01,2022-12-01&format=JSON',
      {
        method: 'POST',
        headers: {
          Authorization: 'Bearer [TOKEN]',
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          region: {
            dataset: 'public-mpa-all',
            id: 555745302,
            bufferUnit: 'NAUTICALMILES',
            bufferValue: 4,
          },
        }),
      }
    )
    const data = await res.blob()
    ```
  </Tab>
</Tabs>

## Response [#response]
