> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fullstackplus.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fullstackplus.ai/_mcp/server.

# Commits across several projects and branches

GET https://api.fullstackplus.ai/api/v1/commits

Built for a time-tracker: what was committed while a timer ran, across whatever projects and branches you name.

Commits are **deduplicated by hash** and annotated with every branch they were found on, so work merged `develop` → `main` is billed once. A project that fails carries an `error` and a zero count while the others still return their commits.

Reference: https://docs.fullstackplus.ai/api-reference/commits-across-several-projects-and-branches

## Authentication

- `X-API-Key` header (required) — Create one in the app under **Settings → API keys**. It is shown once and stored only as a hash, so it cannot be recovered — losing it means issuing a new one. A key reads the endpoints below and nothing else. It is not a session: it cannot create or delete projects, change settings, or issue another API key. It sees exactly what its owner sees, re-checked on every request, so removing someone's access to a project removes it from their key on the very next call.
- `Authorization` header (bearer token, required) — The same key, sent as `Authorization: Bearer <key>`.

## Request

### Query parameters

- `projects` (string, optional) — Comma-separated project **ids or names**. Default: every project the key can read. Maximum 60 per call. An unknown name is a 404, not an empty list — a typo that returned nothing would look exactly like a quiet week.
- `from` (string, optional) — ISO-8601. Filters on COMMIT date.
- `to` (string, optional) — ISO-8601.
- `branches` (string, optional, default: all) — `all`, or a comma-separated list such as `develop,main`. A branch a project does not have is skipped quietly. `all` cannot be combined with named branches.
- `limit` (integer, optional, default: 200) — Per project, not per response.
- `stats` (boolean, optional, default: true) — Files changed / insertions / deletions. `false` is faster.

## Response

### 200

OK

- `branches` (list of string, optional)
- `dateField` (enum, optional) — Which date the range filtered on.
  - Allowed values: `commit`
- `from` (string, optional, nullable) — The instant actually used, after a zoneless input was read as UTC.
- `projectCount` (integer, optional)
- `projects` (list of ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItems, optional)
- `to` (string, optional, nullable)
- `totalCommits` (integer, optional)

## Errors

### 400 Bad Request Error

Bad range, branch, limit, or too many projects.

- `any`

### 401 Unauthorized Error

Key problem.

- `any`

### 404 Not Found Error

A named project is unknown or not readable by this key.

- `any`

### 429 Too Many Requests Error

Rate limited.

- `any`

## Types

### ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItems

- `branches` (list of string, optional) — The requested branches this project actually has.
- `commits` (list of ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItemsCommitsItems, optional)
- `count` (integer, optional)
- `error` (string, optional, nullable) — Set when THIS project could not be read; the others still return their commits. A 200 with an error here is not the same as a quiet week — check it before billing.
- `id` (integer, optional)
- `name` (string, optional)
- `truncated` (boolean, optional) — True when `limit` was hit.

### ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItemsCommitsItems

- `author` (ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItemsCommitsItemsAuthor, optional)
- `authoredAt` (datetime, optional) — When the work was originally written. Survives a rebase.
- `body` (string, optional) — The rest of the message; empty when there is none.
- `branches` (list of string, optional) — Every requested branch this commit was found on. Commits are deduplicated by hash, so work merged develop -> main appears ONCE with both branches listed rather than twice.
- `committedAt` (datetime, optional) — When the commit was recorded. THIS is what `from`/`to` filter on, because it is what git's own --since/--until use.
- `hash` (string, optional) — Full 40-character SHA.
- `isMerge` (boolean, optional) — True when the commit has more than one parent. Merges carry no `stats` — a merge introduces no changes of its own — so a summary must not read the absence as zero work. Release merges describe no effort; filter on this before billing.
- `shortHash` (string, optional)
- `stats` (ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItemsCommitsItemsStats, optional) — Absent for merge commits, and when `stats=false`.
- `subject` (string, optional) — First line of the message.

### ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItemsCommitsItemsAuthor

- `email` (string, optional)
- `name` (string, optional)

### ApiV1CommitsGetResponsesContentApplicationJsonSchemaProjectsItemsCommitsItemsStats

Absent for merge commits, and when `stats=false`.

- `deletions` (integer, optional)
- `filesChanged` (integer, optional)
- `insertions` (integer, optional)

## Examples

**Response**

```json
{
  "branches": [
    "string"
  ],
  "dateField": "commit",
  "from": "string",
  "projectCount": 1,
  "projects": [
    {
      "branches": [
        "string"
      ],
      "commits": [
        {
          "author": {
            "email": "string",
            "name": "string"
          },
          "authoredAt": "2024-01-15T09:30:00Z",
          "body": "string",
          "branches": [
            "string"
          ],
          "committedAt": "2024-01-15T09:30:00Z",
          "hash": "string",
          "isMerge": true,
          "shortHash": "string",
          "stats": {
            "deletions": 1,
            "filesChanged": 1,
            "insertions": 1
          },
          "subject": "string"
        }
      ],
      "count": 1,
      "error": "string",
      "id": 1,
      "name": "string",
      "truncated": true
    }
  ],
  "to": "string",
  "totalCommits": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.fullstackplus.ai/api/v1/commits"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.fullstackplus.ai/api/v1/commits';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fullstackplus.ai/api/v1/commits"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fullstackplus.ai/api/v1/commits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fullstackplus.ai/api/v1/commits")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fullstackplus.ai/api/v1/commits', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.fullstackplus.ai/api/v1/commits");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fullstackplus.ai/api/v1/commits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```