Skip to main content

Fake File Metadata API

MOCK DATA

Fake file metadata — kebab-case names, the correct MIME type for every extension, plausible per-kind sizes, unix paths and seeded SHA-256-style checksums.

Generated test data for fixtures and development

Base URL
/api/files
Capabilities
1 route Seedable
Last updated
July 30, 2026

GET /api/files

Live requestRuns against the public API
No key required
GET/api/files

Request parameters

Only generate files of this kind. Each kind has its own extension pool and realistic size range; 'any' mixes all six.

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/files"
const res = await fetch("https://randomapi.dev/api/files");
const { data, meta } = await res.json();
import requests

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

Only generate files of this kind. Each kind has its own extension pool and realistic size range; 'any' mixes all six.

default: any
allowed: image | document | video | audio | archive | code | any
example: kind=image
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=fileName,extension
exclude list

Return all fields except these (comma-separated).

example: exclude=path
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
fileName string

Kebab-case base name (2–3 dictionary words) plus a kind-appropriate extension.

example: polished-invoice.pdf

extension string

File extension without the dot, drawn from the kind's pool.

example: pdf

mimeType string

MIME type matching the extension, resolved from the platform's shared MIME dataset (IANA registry; de-facto types labelled there).

example: application/pdf

sizeBytes integer

File size in bytes, log-uniform within the kind's plausible range (e.g. code 200 B – 200 kB, video 1 MB – 1.5 GB).

example: 482133

sizeHuman string

sizeBytes in decimal units (1 kB = 1000 B): whole bytes below 1000, otherwise one decimal with kB/MB/GB.

example: 482.1 kB

createdAt string (ISO 8601)

Creation timestamp within the past two years, relative to request time.

example: 2025-09-18T07:42:13.519Z

sha256 string (64 hex chars)

Seed-derived FAKE checksum — formatted like SHA-256 but not the hash of any real content.

example: 9b74c9897bac770ffc029102a200c5de3f78bd2d8c9464b1c1e8d6ab2f1b9c3a

path string

Absolute unix-style path in a kind-appropriate directory, always ending in fileName.

example: /home/maria/documents/polished-invoice.pdf

Documented examples

Build-generated requests and complete responses
4
Ten files of any kind
GET /api/files
{
  "data": [
    {
      "fileName": "puzzled-programme.mov",
      "extension": "mov",
      "mimeType": "video/quicktime",
      "sizeBytes": 10314770,
      "sizeHuman": "10.3 MB",
      "createdAt": "2025-07-08T16:45:45.422Z",
      "sha256": "1268c7f1b364a45dcc8b51e2abcf538ecddcdb4f05f1bb1b5f816136c61ad914",
      "path": "/home/wm/videos/puzzled-programme.mov"
    },
    {
      "fileName": "thorough-technologist.png",
      "extension": "png",
      "mimeType": "image/png",
      "sizeBytes": 470655,
      "sizeHuman": "470.7 kB",
      "createdAt": "2024-08-06T22:14:38.672Z",
      "sha256": "4986a4bbe6cdcab4aa63f1d14156def79315cf386e647934ee8afecfa8e09000",
      "path": "/home/dewey/pictures/thorough-technologist.png"
    },
    {
      "fileName": "trained-monster-haircut.js",
      "extension": "js",
      "mimeType": "text/javascript",
      "sizeBytes": 5019,
      "sizeHuman": "5.0 kB",
      "createdAt": "2025-06-12T16:50:44.293Z",
      "sha256": "970825cd0258a9c981338df2eac8f905b493c543106965f496607e055b5c55ac",
      "path": "/home/saige/projects/app/src/trained-monster-haircut.js"
    },
    {
      "fileName": "sad-governance-ravioli.webp",
      "extension": "webp",
      "mimeType": "image/webp",
      "sizeBytes": 57573,
      "sizeHuman": "57.6 kB",
      "createdAt": "2024-08-31T02:57:26.385Z",
      "sha256": "af5123ed11ebf426fef2b77507a9744d6899155fc0060b9b426255f362c6969c",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Reproducible image files
GET /api/files?kind=image&count=5&seed=42
{
  "data": [
    {
      "fileName": "puzzled-programme.webp",
      "extension": "webp",
      "mimeType": "image/webp",
      "sizeBytes": 720000,
      "sizeHuman": "720.0 kB",
      "createdAt": "2025-12-09T01:32:23.456Z",
      "sha256": "091268c7f1b364a45dcc8b51e2abcf538ecddcdb4f05f1bb1b5f816136c61ad9",
      "path": "/srv/cdn/assets/img/puzzled-programme.webp"
    },
    {
      "fileName": "thorough-technologist-violin.png",
      "extension": "png",
      "mimeType": "image/png",
      "sizeBytes": 291257,
      "sizeHuman": "291.3 kB",
      "createdAt": "2025-07-10T04:21:14.295Z",
      "sha256": "2c4986a4bbe6cdcab4aa63f1d14156def79315cf386e647934ee8afecfa8e090",
      "path": "/data/media/photos/thorough-technologist-violin.png"
    },
    {
      "fileName": "trained-monster-haircut.gif",
      "extension": "gif",
      "mimeType": "image/gif",
      "sizeBytes": 162862,
      "sizeHuman": "162.9 kB",
      "createdAt": "2025-08-23T10:36:40.802Z",
      "sha256": "01970825cd0258a9c981338df2eac8f905b493c543106965f496607e055b5c55",
      "path": "/srv/cdn/assets/img/trained-monster-haircut.gif"
    },
    {
      "fileName": "sad-governance.png",
      "extension": "png",
      "mimeType": "image/png",
      "sizeBytes": 24694,
      "sizeHuman": "24.7 kB",
      "createdAt": "2026-03-23T04:13:56.121Z",
      "sha256": "d8af5123ed11ebf426fef2b77507a9744d6899155fc0060b9b426255f362c696",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Big video files as CSV
GET /api/files?kind=video&count=20&format=csv
fileName,extension,mimeType,sizeBytes,sizeHuman,createdAt,sha256,path
puzzled-programme.webm,webm,video/webm,79365734,79.4 MB,2025-12-09T01:32:23.456Z,091268c7f1b364a45dcc8b51e2abcf538ecddcdb4f05f1bb1b5f816136c61ad9,/var/www/uploads/video/puzzled-programme.webm
thorough-technologist-violin.mp4,mp4,video/mp4,26294519,26.3 MB,2025-07-10T04:21:14.295Z,2c4986a4bbe6cdcab4aa63f1d14156def79315cf386e647934ee8afecfa8e090,/data/recordings/thorough-technologist-violin.mp4
trained-monster-haircut.mov,mov,video/quicktime,12933524,12.9 MB,2025-08-23T10:36:40.802Z,01970825cd0258a9c981338df2eac8f905b493c543106965f496607e055b5c55,/var/www/uploads/video/trained-monster-haircut.mov
sad-governance.mp4,mp4,video/mp4,1293465,1.3 MB,2026-03-23T04:13:56.121Z,d8af5123ed11ebf426fef2b77507a9744d6899155fc0060b9b426255f362c696,/data/recordings/sad-governance.mp4
sophisticated-riser.mov,mov,video/quicktime,24505291,24.5 MB,2026-01-27T00:18:20.828Z,b3ece5da48d388bb10d8a95b8df1f024dc1251123f771f5f3ca8c8e3e9c9a694,/home/mac/videos/sophisticated-riser.mov
jumbo-summer.mp4,mp4,video/mp4,16195256,16.2 MB,2026-01-07T08:46:53.765Z,7defc27f4fc4cebabb16f912943b5b47f192649d0a14755622032be9a37b1621,/home/giovani/videos/jumbo-summer.mp4
blond-longboat-negotiation.mp4,mp4,video/mp4,89868351,89.9 MB,2025-01-26T17:15:28.450Z,64c236fd0c6883072defcadbebae133c395c3a42006fa00843c24c8c232f8a87,/var/www/uploads/video/blond-longboat-negotiation.mp4
variable-convection.mov,mov,video/quicktime,34194349,34.2 MB,2024-10-07T08:52:31.017Z,7dc5aac601d514fafa2eef83c28da9b90ee0e57c052c8f284dac40f44e50c083,/data/recordings/variable-convection.mov
gifted-ribbon-drug.webm,webm,video/webm,134188449,134.2 MB,2026-05-14T18:39:36.979Z,79140e2fe8b377412de1ca4f2c1ff7af5fff9e6a301bf56f3bea269ba21cbd01,/var/www/uploads/video/gifted-ribbon-drug.webm
enchanting-tenant.mov,mov,video/quicktime,292843090,292.8 MB,2025-07-07T06:45:56.630Z,7307713cc6c1e09cdd1754a3b5ea5d63527419df473ff2deaf1ff7b12efdf6d7,/data/recordings/enchanting-tenant.mov
entire-sideboard-academics.mov,mov,video/quicktime,1442369243,1.4 GB,2024-12-07T02:11:54.374Z,c0ab4bb1131f28ffaccc69c240a7abf70adf580e584f04f3f74669b404fa62a3,/srv/media/video/entire-sideboard-academics.mov
pastel-soup.mp4,mp4,video/mp4,18425680,18.4 MB,2025-05-02T06:51:21.063Z,e0950fba5941278295de2def8fb1753aa9168c578d242bb8d42054b943a6e852,/srv/media/video/pastel-soup.mp4
legal-effector.mp4,mp4,video/mp4,37229088,37.2 MB,2024-12-07T02:47:57.768Z,5ac5cc1e678c94d1c8b6824f9a77f11b91bcdd757324ef1528c88e25dd156ec6,/data/recordings/legal-effector.mp4
thorough-tribe.webm,webm,video/webm,12381908,12.4 MB,2025-04-16T14:19:20.961Z,146a7906daff4bade53f8e09d0ea5e91e54d1db0724ae65db788618f0070f1e3,/var/www/uploads/video/thorough-tribe.webm
jagged-plumber.mov,mov,video/quicktime,5017409,5.0 MB,2025-05-16T10:55:31.900Z,ac2efe7351fac9f9b44d2f328d59c3d984d6dbeef8de7bd7e6d0a1e78760d3fa,/var/www/uploads/video/jagged-plumber.mov
celebrated-depot-supplier.mov,mov,video/quicktime,4679071,4.7 MB,2026-06-01T01:47:17.810Z,c2afe0bad24bc590cf8189dd58236ac0f551691139d7bbcf74be9c921524853a,/srv/media/video/celebrated-depot-supplier.mov
svelte-label.mp4,mp4,video/mp4,38549696,38.5 MB,2025-02-26T08:02:18.240Z,6107790cd5a7eeccc45960100a293ee64973415d2c8099b5f6614db9ff675977,/data/recordings/svelte-label.mp4
odd-horde.webm,webm,video/webm,1117522194,1.1 GB,2024-10-13T12:55:25.811Z,d215e1a4924bf4c7bc3e22a0f1b6976bdcc74a6b0f9d33f1c9ed17dc8e74b512,/data/recordings/odd-horde.webm
triangular-mousse-slipper.webm,webm,video/webm,5640112,5.6 MB,2025-08-08T04:53:06.581Z,648f06d944fc969f223b270e993c738dd8ca99d4994dd2dd40d9ad497b3654ed,/var/www/uploads/video/triangular-mousse-slipper.webm
immediate-lobster.webm,webm,video/webm,60366342,60.4 MB,2024-11-21T09:27:19.708Z,54007ce9101c721eaee2ce3a13a3c12527805349d508f03b7fee0c152f7bfa2d,/var/www/uploads/video/immediate-lobster.webm
Code files, name + MIME only
GET /api/files?kind=code&fields=fileName,mimeType&count=10
{
  "data": [
    {
      "fileName": "puzzled-programme.py",
      "mimeType": "text/x-python"
    },
    {
      "fileName": "thorough-technologist-violin.js",
      "mimeType": "text/javascript"
    },
    {
      "fileName": "trained-monster-haircut.css",
      "mimeType": "text/css"
    },
    {
      "fileName": "sad-governance.js",
      "mimeType": "text/javascript"
    },
    {
      "fileName": "sophisticated-riser.css",
      "mimeType": "text/css"
    },
    {
      "fileName": "jumbo-summer.js",
      "mimeType": "text/javascript"
    },
    {
      "fileName": "blond-longboat-negotiation.js",
      "mimeType": "text/javascript"
    },
    {
      "fileName": "variable-convection.css",
      "mimeType": "text/css"
    },
    {
      "fileName": "gifted-ribbon-drug.py",
      "mimeType": "text/x-python"
    },
    {
      "fileName": "enchanting-tenant.css",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

About this API

Coverage & behavior

Generates believable file metadata for six kinds of files — no actual file exists, but every record is internally consistent:

  • fileName is 2–3 kebab-cased dictionary words plus an extension drawn from the kind's pool, and extension, path and mimeType always agree with it.
  • mimeType is resolved from the platform's shared MIME dataset, so .pdf is always application/pdf and .svg is image/svg+xml — and yes, .ts resolves to video/mp2t, because that is the IANA registration (TypeScript has no official MIME type).
  • sizeBytes is log-uniform within the kind's plausible range (small files are as common as huge ones), and sizeHuman is the same number in decimal units (1 kB = 1000 B; whole bytes, otherwise one decimal).
  • createdAt falls within the past two years of the request, and sha256 is a seed-derived fake checksum — 64 hex characters that are not the hash of any real content.
kind extensions size range
image png, jpg, webp, svg, gif 20 kB – 8 MB
document pdf, docx, xlsx, txt, md 5 kB – 3 MB
video mp4, webm, mov 1 MB – 1.5 GB
audio mp3, wav, ogg 500 kB – 15 MB
archive zip, tar, gz 10 kB – 500 MB
code js, ts, py, json, html, css 200 B – 200 kB

The default kind=any mixes all six kinds, each record still honoring its own kind's extensions and size range. With a seed the same request returns byte-identical listings forever.

Use it for

  • Populate file-manager, cloud-drive or attachment UIs with realistic listings
  • Test upload validation (size limits, extension/MIME allow-lists) against consistent metadata
  • Seed storage-service fixtures with reproducible names and checksums via seed

Frequently asked questions

Does the extension match the MIME type?

Yes — fileName, extension and mimeType are generated together so they agree (a .png is image/png), and sizeBytes/sizeHuman describe the same size.

Can I generate only one kind of file?

Yes — kind=image|document|video|audio|archive|code (or any) constrains the type family.

Are the SHA-256 hashes real?

They're valid 64-hex-character strings for realistic display, but they're not the digest of any actual file contents — there is no file.

Standards & references