> ## Documentation Index
> Fetch the complete documentation index at: https://data.ornn.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LLM Coding Analytics

> Daily public-GitHub activity — PRs opened, merge rates, and commits — for Claude Code, Codex, Copilot, Cursor, and Devin.

**LLM Coding Analytics** tracks daily public-GitHub activity for the major AI coding tools. For each tool, Ornn measures pull requests opened, the share of those PRs that eventually merged, and (for Claude Code) commits attributed via co-author trailer. Use it to compare adoption and code-acceptance trends across tools over time.

## Tracked tools

The index covers five AI coding tools:

`claude` (Claude Code) · `codex` · `copilot` (GitHub Copilot) · `cursor` · `devin` (Cognition)

PRs and merge rates are tracked for all five. Commits are tracked for `claude` only, since it is the only tool that consistently attributes commits via a co-author trailer on public GitHub.

## Metrics

Each daily row in `llm_coding_daily_metrics` carries one set of values per tool:

| Field        | Meaning                                                               |
| ------------ | --------------------------------------------------------------------- |
| `date`       | The day the activity was observed (YYYY-MM-DD, UTC)                   |
| `tool`       | One of `claude`, `codex`, `copilot`, `cursor`, `devin`                |
| `commits`    | Public-GitHub commits attributed to the tool that day (`claude` only) |
| `prs`        | Pull requests opened that day from the tool's branch namespace        |
| `merged`     | Of those PRs, how many have merged so far                             |
| `merge_rate` | `100 × merged / prs`, as a percentage with one decimal                |

PR counts are stable once posted. `merged` and `merge_rate` for recent days continue to update as in-flight PRs land, then settle once activity tails off.

<Note>
  These are **public-GitHub** signals only. Private repos, self-hosted instances, and IDE-side telemetry are out of scope. Treat the values as a directional measure of open-source adoption, not total usage.
</Note>

## Products

The API exposes pre-built **products** — a tool plus a metric — so you can fetch one series at a time without picking columns by hand. Each product has an `id`, a human-readable `label`, and a `kind`:

* `kind: "count"` — a whole-number count (PRs or commits per day).
* `kind: "pct"` — a percentage (the daily merge rate).

| Product ID          | Label                 | Metric                  |
| ------------------- | --------------------- | ----------------------- |
| `cc-prs`            | Claude PRs            | PRs opened              |
| `codex-prs`         | Codex PRs             | PRs opened              |
| `copilot-prs`       | Copilot PRs           | PRs opened              |
| `cursor-prs`        | Cursor PRs            | PRs opened              |
| `devin-prs`         | Devin PRs             | PRs opened              |
| `cc-commits`        | Claude Commits        | Commits                 |
| `cc-merge`          | Claude Merge          | Merge rate              |
| `codex-merge`       | Codex Merge           | Merge rate              |
| `copilot-merge`     | Copilot Merge         | Merge rate              |
| `cursor-merge`      | Cursor Merge          | Merge rate              |
| `devin-merge`       | Devin Merge           | Merge rate              |
| `cc-vs-codex`       | Claude vs Codex       | PRs opened (two series) |
| `cc-vs-codex-merge` | Claude vs Codex Merge | Merge rate (two series) |

Products whose ID starts with a `vs` pairing (for example `cc-vs-codex`) return two series in a single response, ready to plot on one chart. They are only valid on `/api/llm-coding/history` — the single-day `/api/llm-coding/index` endpoint rejects them.

## Update frequency

Values are refreshed once per day after a backfill-and-catch-up scrape. New days appear within roughly 24 hours of UTC midnight. Re-fetching the same `date` later may return a higher `merged` count as previously open PRs land.

## Reading the latest value

`GET /api/llm-coding/index?product={id}` returns the most recent daily value for a single (non-compare) product, with the day-over-day percent change. LLM coding analytics require an API key — there is no free tier:

```bash theme={null}
curl "https://api.ornnai.com/api/llm-coding/index?product=cc-prs" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json theme={null}
{
  "success": true,
  "data": {
    "product": "cc-prs",
    "label": "Claude PRs",
    "kind": "count",
    "value": 1000,
    "changePct": 0.00,
    "date": "2026-01-01",
    "updatedAt": "2026-01-01T00:00:00.000Z"
  }
}
```

`changePct` is `null` when there is no previous day on file or the previous value was zero.

## Pulling a historical series

`GET /api/llm-coding/history?product={id}` returns the daily series for a product, oldest first. Pass `startDate` and `endDate` (both `YYYY-MM-DD`, inclusive) to bound the window, or `limit` to cap the row count (default `2000`).

This endpoint requires an API key — LLM coding analytics have no free tier. Anonymous requests return `401`.

For a single-tool product, each row carries one `value`:

```bash theme={null}
curl "https://api.ornnai.com/api/llm-coding/history?product=copilot-merge&startDate=2026-05-01&endDate=2026-06-21" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json theme={null}
{
  "success": true,
  "product": "copilot-merge",
  "compare": false,
  "data": [
    { "date": "2026-01-01", "value": 70.0 },
    { "date": "2026-01-02", "value": 70.0 }
  ]
}
```

For a compare product, each row carries both tools side by side as `value` and `value2`, ordered to match `seriesLabels`:

```bash theme={null}
curl "https://api.ornnai.com/api/llm-coding/history?product=cc-vs-codex&startDate=2026-05-01&endDate=2026-06-21" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json theme={null}
{
  "success": true,
  "product": "cc-vs-codex",
  "compare": true,
  "seriesLabels": ["Claude PRs", "Codex PRs"],
  "data": [
    { "date": "2026-01-01", "value": 1000, "value2": 1000 },
    { "date": "2026-01-02", "value": 1000, "value2": 1000 }
  ]
}
```

An unknown `product` returns `400`. A valid product with no rows in the requested window returns `200` with an empty `data` array — history never returns `404` (unlike [the index endpoint](#reading-the-latest-value), which returns `404` when a known product has no current value).

## Listing available products

If you want to drive a selector from the live product list rather than hard-coding IDs, call `GET /api/llm-coding/products`. This catalog endpoint is public — no API key required:

```bash theme={null}
curl "https://api.ornnai.com/api/llm-coding/products"
```

```json theme={null}
{
  "success": true,
  "data": [
    { "id": "cc-prs", "label": "Claude PRs", "category": "prs", "kind": "count", "compare": false, "seriesLabels": null },
    { "id": "cc-vs-codex", "label": "Claude vs Codex", "category": "prs", "kind": "count", "compare": true, "seriesLabels": ["Claude PRs", "Codex PRs"] }
  ]
}
```

See the [LLM Coding API reference](/docs/api-reference/llm-coding/get-the-latest-value-for-an-llm-coding-product) for the full schema and code samples in every supported language.

## Notes

* LLM coding analytics require an API key — the latest value (`/api/llm-coding/index`) and history (`/api/llm-coding/history`) both return `401` without one. Only the products catalog (`/api/llm-coding/products`) is public. See [Authentication](/docs/authentication).
* History rows come back **oldest first** — the opposite of the OTPI and GPU history endpoints. You can plot them directly without re-sorting.
* Merge rates and merged counts for the last few days will keep ticking up as PRs land. Pin to a settled date if you need a stable value.
