---
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/`

## Request

- Base URL: `https://agsapi.bgs.ac.uk` (the document declares no server; this is the origin it was published from)
- URL: `https://agsapi.bgs.ac.uk/v7/ags_export_by_polygon/`
- Auth: none declared

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

## Changes

- **2026-07-23** `8b53deacffa2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bgs/apis/bgs-ags4-file-utilities-tool/changes/v7/ags_export_by_polygon/get.md)

---

[API](https://skmtc.dev/bgs/apis/bgs-ags4-file-utilities-tool.md) - [All operations](https://skmtc.dev/bgs/apis/bgs-ags4-file-utilities-tool/llms.txt) - [OpenAPI document](https://skmtc.dev/bgs/apis/bgs-ags4-file-utilities-tool/revisions/8b53deacffa2?raw)
