# Build with AI

Source: https://developers.newjune.co/build-with-ai

> Plain-text versions of these docs for coding agents, the OpenAPI document, and a prompt to paste into your agent.

Every page on this site is also available as markdown, and the whole site is available as one file. Point a coding agent at these instead of the HTML pages: they are smaller, and they carry every endpoint, parameter, and field.

| URL | What it is |
| --- | --- |
| [`/llms.txt`](https://developers.newjune.co/llms.txt) | An index of every page with a one-line description, in the [llms.txt](https://llmstxt.org) format. Start here. |
| [`/llms-full.txt`](https://developers.newjune.co/llms-full.txt) | Every page as markdown in one file, in sidebar order. |
| `<any page>.md` | One page as markdown, for example [`/quickstart.md`](https://developers.newjune.co/quickstart.md) or [`/api-reference/rounds.md`](https://developers.newjune.co/api-reference/rounds.md). |
| [`/openapi.json`](https://developers.newjune.co/openapi.json) | The OpenAPI 3.1 document. Also served by the API at `https://data.newjune.co/v1/openapi.json`. |

Every page also has a **Copy as Markdown** button under its title.

The API reference markdown is built from the OpenAPI document, so it always matches the live contract. If an agent's answer disagrees with `openapi.json`, trust `openapi.json`.

## A prompt for coding agents

Paste this into Claude Code, Cursor, Copilot, or any agent before asking it to write code against the API. Fill in the last line.

```text title="Prompt"
You are writing code against the New June Data API, a read-only REST API that
returns one golf player's own data.

Read these before writing code:
- https://developers.newjune.co/llms.txt (index of the docs)
- https://developers.newjune.co/openapi.json (the contract; it wins over anything else)
- https://developers.newjune.co/pagination.md and https://developers.newjune.co/errors.md

Rules:
- Base URL https://data.newjune.co/v1. Every endpoint is a GET.
- Read the key from the NEW_JUNE_API_KEY environment variable and send it as
  "Authorization: Bearer <key>". Never hard-code or log the key.
- Run on a server or script, never in browser code: the API sends no CORS headers.
- Lists return {"object":"list","data":[...],"has_more":bool,"next_cursor":string|null}.
  Use limit=100 and pass next_cursor back as cursor until has_more is false.
- Only use query parameters listed in openapi.json; unknown ones are a 400.
- Related objects are linked by *_id fields and query filters (?round_id=...), never nested paths.
- Fields are snake_case, always present, and null when unknown. Timestamps are ISO 8601 UTC.
- On 429, wait Retry-After seconds and retry. Retry 500 and 503 with backoff.
  Do not retry other 4xx; branch on error.code.
- Request only the scopes the task needs: rounds:read, reports:read, plans:read, clubs:read.

Task: <describe what you want to build>
```

## Tips

- **Give the agent a key with narrow scopes.** A key for a scoring dashboard needs only `rounds:read`.
- **Let it check the key first.** `GET /v1/me` returns the key's scopes, so an agent can confirm it has what it needs before it starts.
- **Ask for the samples' language.** Every page has curl, TypeScript (Node 20+, built-in `fetch`), and Python (`requests`) versions of the same request. Ask the agent to match one.
