Skip to main content

Fake Git Commit API

MOCK DATA

Fake git commits — Conventional Commits or plain messages, 40-char hashes, safe author emails, dates in your range and realistic diff stats. Fully seedable.

Generated test data for fixtures and development

Base URL
/api/git-commits
Capabilities
1 route Seedable
Last updated
July 29, 2026

GET /api/git-commits

Each record is one commit: message, hash/shortHash, author, a date uniformly drawn from [from, to], and diff stats. The resolved window — defaults included — is echoed in meta.params.

Live requestRuns against the public API
No key required
GET/api/git-commits

Request parameters

Message style: 'conventional' = `<type>(<scope>): <subject>` (commitlint-valid, lowercase subject, no trailing period); 'plain' = a capitalized imperative sentence with no prefix.

Earliest commit date, inclusive. YYYY-MM-DD (= midnight UTC) or a full ISO 8601 timestamp. Not before 1970 (git stores Unix seconds). Defaults to 90 days before today (UTC).

Latest commit date, inclusive. YYYY-MM-DD means midnight UTC — pass a timestamp to cover that whole day. Must be ≥ from. Defaults to today at UTC midnight.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/git-commits"
const res = await fetch("https://randomapi.dev/api/git-commits");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/git-commits").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/git-commits"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 3
style enum

Message style: 'conventional' = `<type>(<scope>): <subject>` (commitlint-valid, lowercase subject, no trailing period); 'plain' = a capitalized imperative sentence with no prefix.

default: conventional
allowed: conventional | plain
example: style=plain
from date

Earliest commit date, inclusive. YYYY-MM-DD (= midnight UTC) or a full ISO 8601 timestamp. Not before 1970 (git stores Unix seconds). Defaults to 90 days before today (UTC).

example: from=2026-01-01
to date

Latest commit date, inclusive. YYYY-MM-DD means midnight UTC — pass a timestamp to cover that whole day. Must be ≥ from. Defaults to today at UTC midnight.

example: to=2026-03-31
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=message,hash
exclude list

Return all fields except these (comma-separated).

example: exclude=deletions
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 8
message string

Commit message in the requested style — conventional: `<type>(<scope>): <subject>`; plain: a capitalized imperative sentence.

example: feat(api): add bulk export for audit logs

hash string (40-char hex)

Fake commit SHA-1: exactly 40 lowercase hex characters (random — not a real object hash).

example: 0f9a3c2e6d1b4a8c9f2e3d1c4a8b9f2e3d1c4a8b

shortHash string (7-char hex)

First 7 characters of `hash` — what `git log --oneline` shows.

example: 0f9a3c2

author object

Nested author: `name` and `email`. The email derives from the name and always uses an RFC 2606 reserved domain (example.com/.net/.org) — it can never deliver mail.

example: {"name":"Emily Carter","email":"emily.carter@example.com"}

date string (ISO 8601)

Author date in UTC, uniformly random within [`from`, `to`] — second precision, like real git timestamps.

example: 2026-03-14T09:26:53Z

filesChanged integer

Number of files touched, 1–20.

example: 3

insertions integer

Lines added, 0–500.

example: 124

deletions integer

Lines removed, 0–300 (0 insertions/0 deletions = renames or mode changes).

example: 38

Documented examples

Build-generated requests and complete responses
4
Ten commits from the past 90 days
GET /api/git-commits
{
  "data": [
    {
      "message": "refactor(deps): move feature flags into a single module",
      "hash": "51afe51087785ac909d5c3a5128bc76c6831d94f",
      "shortHash": "51afe51",
      "author": {
        "name": "Kaylie Gorczany-Considine",
        "email": "kaylie.gorczanyconsidine@example.org"
      },
      "date": "2026-07-23T20:53:49Z",
      "filesChanged": 15,
      "insertions": 197,
      "deletions": 193
    },
    {
      "message": "feat(db): add bulk export for audit logs",
      "hash": "86f33860fd385d942c436a0149cc3f658665349c",
      "shortHash": "86f3386",
      "author": {
        "name": "Waino Marvin",
        "email": "waino.marvin@example.net"
      },
      "date": "2026-07-05T00:36:42Z",
      "filesChanged": 18,
      "insertions": 402,
      "deletions": 238
    },
    {
      "message": "ci(auth): run tests in parallel shards",
      "hash": "776db2d8909633f7012af3ef975ee09408554904",
      "shortHash": "776db2d",
      "author": {
        "name": "Hailee Streich",
        "email": "hailee.streich@example.com"
      },
      "date": "2026-07-11T03:30:05Z",
      "filesChanged": 1,
      "insertions": 172,
      "deletions": 199"generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Reproducible conventional commits
GET /api/git-commits?seed=42&count=5
{
  "data": [
    {
      "message": "refactor(deps): move feature flags into a single module",
      "hash": "51afe51087785ac909d5c3a5128bc76c6831d94f",
      "shortHash": "51afe51",
      "author": {
        "name": "Kaylie Gorczany-Considine",
        "email": "kaylie.gorczanyconsidine@example.org"
      },
      "date": "2026-07-23T20:53:49Z",
      "filesChanged": 15,
      "insertions": 197,
      "deletions": 193
    },
    {
      "message": "feat(db): add bulk export for audit logs",
      "hash": "86f33860fd385d942c436a0149cc3f658665349c",
      "shortHash": "86f3386",
      "author": {
        "name": "Waino Marvin",
        "email": "waino.marvin@example.net"
      },
      "date": "2026-07-05T00:36:42Z",
      "filesChanged": 18,
      "insertions": 402,
      "deletions": 238
    },
    {
      "message": "ci(auth): run tests in parallel shards",
      "hash": "776db2d8909633f7012af3ef975ee09408554904",
      "shortHash": "776db2d",
      "author": {
        "name": "Hailee Streich",
        "email": "hailee.streich@example.com"
      },
      "date": "2026-07-11T03:30:05Z",
      "filesChanged": 1,
      "insertions": 172,
      "deletions": 199"generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Plain messages for a fixed two-week sprint
GET /api/git-commits?style=plain&from=2026-03-02&to=2026-03-13&count=20
{
  "data": [
    {
      "message": "Move feature flags into a single module",
      "hash": "991d58cd51afe51087785ac909d5c3a5128bc76c",
      "shortHash": "991d58c",
      "author": {
        "name": "Kaylie Gorczany-Considine",
        "email": "kaylie.gorczanyconsidine@example.net"
      },
      "date": "2026-03-10T13:33:45Z",
      "filesChanged": 19,
      "insertions": 351,
      "deletions": 118
    },
    {
      "message": "Add bulk export for audit logs",
      "hash": "7271bcd286f33860fd385d942c436a0149cc3f65",
      "shortHash": "7271bcd",
      "author": {
        "name": "Waino Marvin",
        "email": "waino.marvin@example.net"
      },
      "date": "2026-03-09T01:18:21Z",
      "filesChanged": 15,
      "insertions": 450,
      "deletions": 241
    },
    {
      "message": "Run tests in parallel shards",
      "hash": "599b5a3c776db2d8909633f7012af3ef975ee094",
      "shortHash": "599b5a3",
      "author": {
        "name": "Hailee Streich",
        "email": "hailee.streich@example.com"
      },
      "date": "2026-03-03T14:58:09Z",
      "filesChanged": 17,
      "insertions": 4,
      "deletions": 103"generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Just the messages, newline-delimited
GET /api/git-commits?fields=message&format=ndjson&count=15
{"message":"refactor(deps): move feature flags into a single module"}
{"message":"feat(db): add bulk export for audit logs"}
{"message":"ci(auth): run tests in parallel shards"}
{"message":"fix(api): return 404 instead of 500 for missing records"}
{"message":"ci(db): retry flaky integration jobs once"}
{"message":"feat(auth): introduce per-project rate limits"}
{"message":"feat(config): add optional webhook signature verification"}
{"message":"ci(db): publish coverage reports on merge"}
{"message":"refactor(config): extract validation into a shared helper"}
{"message":"chore(build): update the license year"}
{"message":"chore(docs): remove unused dependencies"}
{"message":"fix(auth): close idle connections before the pool exhausts"}
{"message":"feat(db): add a retry button to failed uploads"}
{"message":"perf(auth): lazy-load heavy dependencies"}
{"message":"build(core): fail on type errors instead of warning"}

About this API

Coverage & behavior

Generates realistic git commit metadata: a message (Conventional Commits or plain style), a 40-character lowercase-hex hash with its 7-character shortHash prefix, an author, an ISO 8601 date inside your window, and plausible filesChanged / insertions / deletions diff stats.

  • style=conventional (the default) emits <type>(<scope>): <subject> — the type is one of the 10 standard Conventional Commits types (feat, fix, docs, style, refactor, perf, test, build, ci, chore), the scope one of 10 realistic areas (api, ui, core, auth, db, deps, config, build, tests, docs), and the subject is imperative, lowercase and period-free — exactly what commitlint accepts. Subjects come from per-type pools of real-world dev tasks, so a fix reads like a fix and a chore like a chore.
  • style=plain emits a capitalized imperative sentence ("Add bulk export for audit logs") with no type/scope prefix.
  • from / to bound the commit date (both inclusive; YYYY-MM-DD means midnight UTC, full ISO timestamps work too). Omit both for the past 90 days — the resolved window is always echoed in meta.params. from > to is a 400 naming both values, and because git stores commit times as Unix seconds, dates before 1970 are rejected. Dates have second precision like real git timestamps (millisecond precision only when you request a window narrower than one second).
  • author.email always uses an RFC 2606 reserved domain (example.com/.net/.org) and derives from the author's actual name — safe to display, log or import anywhere without ever reaching a real inbox.
  • filesChanged is 1–20, insertions 0–500, deletions 0–300 (a 0/0 commit happens — think renames and mode changes).

This is mock data — the hashes are random hex, not objects in any real repository. With a seed the same query returns byte-identical commits forever.

Use it for

  • Populate repo activity feeds, commit graphs and changelog UIs in demos
  • Test Conventional Commits parsers, linters and changelog generators against valid input
  • Seed dashboards with commit stats (files changed, insertions, deletions) over a chosen date window

Frequently asked questions

What does conventional style produce?

style=conventional emits type-prefixed messages (feat:, fix:, chore:…) while plain gives natural sentences — both with hashes, authors, dates and diff stats.

Can I bound the commit dates?

Yes — from/to constrain every generated commit's date, so a demo repository timeline stays inside your range.

Are the hashes real SHAs?

They're valid 40-character hex strings with a matching 7-character shortHash, but they don't correspond to actual git objects.

Standards & references