---
title: "Export a number of boreholes in .ags format in a polygon"
method: GET
path: "/v7/ags_export_by_polygon/"
tags: ["ags_export_by_polygon"]
---

# Export a number of boreholes in .ags format in a polygon

`GET /v7/ags_export_by_polygon/`

Export a number of boreholes in .ags format from AGS data held by the National Geoscience Data Centre, using a polygon using Well-Known-Text.

## Query parameters

- `polygon` string, required — A polygon expressed in Well Known Text
- `count_only` boolean — Return count of found boreholes only

## Response `200`

Return a zip containing .ags file and metadata .txt file or a json response containing the borehole ID count

- BoreholeCountResponse
  - `msg` string, required
  - `type` string, required
  - `self` string, required
  - `count` integer, required

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `422` — Unprocessable Content
- `500` — Internal Server Error

---

[API](https://skmtc.net/bgs/apis/bgs-ags4-file-utilities-tool.md) · [All operations](https://skmtc.net/bgs/apis/bgs-ags4-file-utilities-tool/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bgs/bgs-ags4-file-utilities-tool/revisions/8b53deacffa2/schema)
