# hole_scores

Source: https://developers.newjune.co/api-reference/hole-scores

> Your score on one hole of a round.

Your score on one hole of a round.

Scope: `rounds:read`. Base URL: `https://data.newjune.co`.

Each hole score belongs to one round. List them for one round with round_id, or across rounds with updated_after.

## Endpoints

- `GET /v1/hole_scores`: List hole scores
- `GET /v1/hole_scores/{id}`: Get a hole score

Responses carry `Request-Id`, `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`, and a `429` adds `Retry-After`. See [Headers](https://developers.newjune.co/conventions#headers).

## The hole score object

| Field | Type | Description |
| --- | --- | --- |
| `object` | string | Always "hole_score". |
| `id` | string | Unique id of the hole score. |
| `round_id` | string | The round this score belongs to. |
| `hole_number` | integer | Hole number on the course, from 1. |
| `strokes` | integer or null | Strokes taken on the hole. Null when not entered yet. |
| `putts` | integer or null | Putts taken, when entered. |
| `fairway_hit` | boolean or null | Whether the tee shot finished in the fairway. Null when not recorded or on a par 3. |
| `green_in_regulation` | boolean or null | Whether the green was reached in regulation, when recorded. |
| `penalty_strokes` | integer or null | Penalty strokes on the hole, when entered. |
| `par` | integer or null | Par of the hole, from the round scorecard when it has one, otherwise the course. Null when unknown. |
| `yardage_yards` | integer or null | Length of the hole from the tee the round was played from, in yards. Null when unknown. |
| `created_at` | string (timestamp) | When the score was first entered. |
| `updated_at` | string (timestamp) | When the score was last changed. Par and yardage come from the scorecard or course, so a change to them does not move it. |

Example hole score:

```json
{
  "object": "hole_score",
  "id": "aa311280-73b2-4a0b-8458-ced896a87627",
  "round_id": "498fe851-9796-4fcb-abbe-95e3a176e444",
  "hole_number": 7,
  "strokes": 5,
  "putts": 2,
  "fairway_hit": true,
  "green_in_regulation": false,
  "penalty_strokes": 0,
  "par": 4,
  "yardage_yards": 385,
  "created_at": "2026-06-14T16:41:27.000Z",
  "updated_at": "2026-06-14T19:12:09.000Z"
}
```

### List hole scores

`GET /v1/hole_scores`

The scores you entered, ordered by hole_number ascending, then id ascending. Pass round_id for one round, updated_after for scores changed since a time, or both; at least one is required. Scores from test rounds are not included. Needs a key with the rounds:read scope.

Scope: `rounds:read`. Operation id: `listHoleScores`.

#### Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | no | How many items to return, 1 to 100. Defaults to 25. |
| `cursor` | string | no | The next_cursor value from the previous page, passed back unchanged with the same filters. |
| `round_id` | string | no | Only hole scores from this round. Either round_id or updated_after is required. |
| `updated_after` | string (timestamp) | no | Only hole scores whose own updated_at is strictly after this time (ISO 8601, with Z or an offset). Use it to sync changes since your last run; the list order does not change. Either round_id or updated_after is required. Without round_id, scores from every round come back in the same order (hole_number, then id). |

#### Example request

curl:

```bash
curl "https://data.newjune.co/v1/hole_scores" \
  -H "Authorization: Bearer $NEW_JUNE_API_KEY"
```

TypeScript:

```ts
const response = await fetch('https://data.newjune.co/v1/hole_scores', {
  headers: { Authorization: `Bearer ${process.env.NEW_JUNE_API_KEY}` },
});
const body = await response.json();
console.log(body);
```

Python:

```python
import os
import requests

response = requests.get(
    "https://data.newjune.co/v1/hole_scores",
    headers={"Authorization": f"Bearer {os.environ['NEW_JUNE_API_KEY']}"},
    timeout=30,
)
print(response.json())
```

#### Responses

- `200`: A page of results.
- `400`: A query parameter is unknown, missing, or has an invalid value.
- `401`: The API key is missing, not valid, revoked, or expired.
- `403`: The key lacks the scope this endpoint needs, or the account is suspended.
- `429`: Too many requests. See the RateLimit and Retry-After headers.
- `500`: Something went wrong on our side.
- `503`: The API is temporarily unavailable.

### Get a hole score

`GET /v1/hole_scores/{id}`

One hole score by id. Needs a key with the rounds:read scope.

Scope: `rounds:read`. Operation id: `getHoleScore`.

#### Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The hole score's id. |

#### Example request

curl:

```bash
curl "https://data.newjune.co/v1/hole_scores/aa311280-73b2-4a0b-8458-ced896a87627" \
  -H "Authorization: Bearer $NEW_JUNE_API_KEY"
```

TypeScript:

```ts
const response = await fetch('https://data.newjune.co/v1/hole_scores/aa311280-73b2-4a0b-8458-ced896a87627', {
  headers: { Authorization: `Bearer ${process.env.NEW_JUNE_API_KEY}` },
});
const body = await response.json();
console.log(body);
```

Python:

```python
import os
import requests

response = requests.get(
    "https://data.newjune.co/v1/hole_scores/aa311280-73b2-4a0b-8458-ced896a87627",
    headers={"Authorization": f"Bearer {os.environ['NEW_JUNE_API_KEY']}"},
    timeout=30,
)
print(response.json())
```

#### Responses

- `200`: The item.
- `401`: The API key is missing, not valid, revoked, or expired.
- `403`: The key lacks the scope this endpoint needs, or the account is suspended.
- `404`: No such resource for this account.
- `429`: Too many requests. See the RateLimit and Retry-After headers.
- `500`: Something went wrong on our side.
- `503`: The API is temporarily unavailable.
