Skip to main content

Mock Feature Flag Data API

MOCK DATA

Generate coherent mock feature-flag configurations and rollout evaluations with lifecycle states, weighted variants and safe contexts.

Generated test data for fixtures and development

Base URL
/api/feature-flags
Capabilities
2 routes Seedable
Last updated
July 29, 2026

GET /api/feature-flags

Live requestRuns against the public API
No key required
GET/api/feature-flags?environment=staging&state=active&strategy=percentage&count=20&seed=42

Request parameters

Constrain every flag to this environment. Omit for a mix.

Constrain lifecycle state. Inactive and archived flags are disabled.

Constrain every configuration to this strategy.

Latest lifecycle instant. Defaults to the current UTC day's end and is echoed for replay.

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/feature-flags?state=active&strategy=percentage&environment=staging&seed=42&count=20"
const res = await fetch("https://randomapi.dev/api/feature-flags?state=active&strategy=percentage&environment=staging&seed=42&count=20");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/feature-flags?state=active&strategy=percentage&environment=staging&seed=42&count=20").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/feature-flags?state=active&strategy=percentage&environment=staging&seed=42&count=20"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 4
environment enum

Constrain every flag to this environment. Omit for a mix.

allowed: development | staging | production
example: environment=staging
state enum

Constrain lifecycle state. Inactive and archived flags are disabled.

allowed: active | inactive | archived
example: state=active
strategy enum

Constrain every configuration to this strategy.

allowed: boolean | percentage | targeted | multivariate
example: strategy=percentage
asOf date

Latest lifecycle instant. Defaults to the current UTC day's end and is echoed for replay.

example: asOf=2026-07-10T23:59:59.999Z
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=key,name
exclude list

Return all fields except these (comma-separated).

example: exclude=archivedAt
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 15
key string

Unique safe flag key containing the stable record index.

example: checkout-redesign-0-a81c42

name string

Human-readable fictional feature name.

example: Checkout Redesign

description string

Short fixture description with no customer or product claim.

example: Controls the checkout redesign fixture.

environment string

development, staging or production.

example: staging

state string

active, inactive or archived.

example: active

enabled boolean

True only while state is active.

example: true

strategy string

boolean, percentage, targeted or multivariate.

example: percentage

rolloutPercentage integer

Effective global rollout percentage from 0 through 100.

example: 35

defaultVariant string

Fallback variant key present in variants.

example: off

variants object[]

Bounded variant keys and integer weights totaling 100.

example: [{"key":"on","weight":35},{"key":"off","weight":65}]

rules object[]

Strategy-specific percentage, target or split rule; boolean flags have none.

example: [{"id":"percentage-rollout","kind":"percentage","percentage":35,"variant":"on"}]

version integer

Positive fictional configuration version.

example: 7

createdAt string (ISO 8601)

Creation time no later than updatedAt.

example: 2026-03-10T09:12:00.000Z

updatedAt string (ISO 8601)

Last update time no earlier than createdAt.

example: 2026-07-01T14:22:00.000Z

archivedAt string (ISO 8601) nullable

Archive time for archived flags only; otherwise null.

example: null

Documented examples

Build-generated requests and complete responses
2
Active percentage rollouts
GET /api/feature-flags?state=active&strategy=percentage&environment=staging&seed=42&count=20
{
  "data": [
    {
      "key": "smart-search-0-8016cf",
      "name": "Smart Search",
      "description": "Controls the smart search fixture.",
      "environment": "staging",
      "state": "active",
      "enabled": true,
      "strategy": "percentage",
      "rolloutPercentage": 68,
      "defaultVariant": "off",
      "variants": [
        {
          "key": "on",
          "weight": 68
        },
        {
          "key": "off",
          "weight": 32
        }
      ],
      "rules": [
        {
          "id": "percentage-rollout",
          "kind": "percentage",
          "percentage": 68,
          "variant": "on"
        }
      ],
      "version": 22,
      "createdAt": "2026-05-18T15:48:34.150Z",
      "updatedAt": "2026-06-10T17:48:39.057Z",
      "archivedAt": null
    },
    {
      "key": "checkout-redesign-1-f248ab",
      "name": "Checkout Redesign",
      "description": "Controls the checkout redesign fixture.",
      "environment": "staging",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Archived multivariate flags
GET /api/feature-flags?state=archived&strategy=multivariate&count=10
{
  "data": [
    {
      "key": "bulk-export-0-6cfb6a",
      "name": "Bulk Export",
      "description": "Controls the bulk export fixture.",
      "environment": "staging",
      "state": "archived",
      "enabled": false,
      "strategy": "multivariate",
      "rolloutPercentage": 0,
      "defaultVariant": "control",
      "variants": [
        {
          "key": "control",
          "weight": 48
        },
        {
          "key": "treatment-a",
          "weight": 20
        },
        {
          "key": "treatment-b",
          "weight": 32
        }
      ],
      "rules": [
        {
          "id": "variant-split",
          "kind": "split",
          "percentage": 0
        }
      ],
      "version": 11,
      "createdAt": "2026-05-06T06:03:30.716Z",
      "updatedAt": "2026-05-09T12:11:54.828Z",
      "archivedAt": "2026-05-15T09:53:14.275Z"
    },
    {
      "key": "checkout-redesign-1-8abecc",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

GET /api/feature-flags/evaluations

Live requestRuns against the public API
No key required
GET/api/feature-flags/evaluations?flag=compact-navigation&environment=production&rolloutPercentage=25&count=20&seed=42

Request parameters

Safe flag key echoed in each evaluation.

Safe synthetic subject prefix; no email, name or external identifier.

Evaluation environment.

Subject is on exactly when active and bucket is below this value.

When false, every evaluation is off regardless of bucket or rollout.

Latest evaluation instant. Defaults to the current UTC day's end and is echoed for replay.

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/feature-flags/evaluations?flag=compact-navigation&environment=production&rolloutPercentage=25&seed=42&count=20"
const res = await fetch("https://randomapi.dev/api/feature-flags/evaluations?flag=compact-navigation&environment=production&rolloutPercentage=25&seed=42&count=20");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/feature-flags/evaluations?flag=compact-navigation&environment=production&rolloutPercentage=25&seed=42&count=20").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/feature-flags/evaluations?flag=compact-navigation&environment=production&rolloutPercentage=25&seed=42&count=20"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 6
flag string

Safe flag key echoed in each evaluation.

default: checkout-redesign
allowed: 1 – 64
example: flag=compact-navigation
subjectPrefix string

Safe synthetic subject prefix; no email, name or external identifier.

default: anon
allowed: 1 – 64
example: subjectPrefix=test-user
environment enum

Evaluation environment.

default: development
allowed: development | staging | production
example: environment=production
rolloutPercentage int

Subject is on exactly when active and bucket is below this value.

default: 50
allowed: 0 – 100
example: rolloutPercentage=25
active boolean

When false, every evaluation is off regardless of bucket or rollout.

default: true
example: active=false
asOf date

Latest evaluation instant. Defaults to the current UTC day's end and is echoed for replay.

example: asOf=2026-07-10T23:59:59.999Z
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=evaluationId,flagKey
exclude list

Return all fields except these (comma-separated).

example: exclude=evaluatedAt
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 12
evaluationId string

Unique evaluation identity containing stable record index.

example: eval_0_31f0a82d

flagKey string

Validated requested flag key.

example: checkout-redesign

subjectKey string

Synthetic subject key built from prefix and record index.

example: anon-0-a81c

environment string

Evaluation environment.

example: development

context object

Safe fictional country and plan targeting context.

example: {"country":"DK","plan":"pro"}

bucket integer

Deterministic integer bucket from 0 through 99.

example: 17

rolloutPercentage integer

Requested rollout threshold.

example: 50

enabled boolean

Whether active is true and bucket is below rolloutPercentage.

example: true

variant string

on when enabled; otherwise off.

example: on

reason string

flag-disabled, rollout-zero, rollout-full, rollout-match or rollout-miss.

example: rollout-match

matchedRule string nullable

percentage-rollout for active flags; null when disabled.

example: percentage-rollout

evaluatedAt string (ISO 8601)

Stable generated instant at or before resolved asOf.

example: 2026-07-10T00:00:00.412Z

Documented examples

Build-generated requests and complete responses
2
Twenty-five percent production rollout
GET /api/feature-flags/evaluations?flag=compact-navigation&environment=production&rolloutPercentage=25&seed=42&count=20
{
  "data": [
    {
      "evaluationId": "eval_0_016cfb6a",
      "flagKey": "compact-navigation",
      "subjectKey": "anon-0-a958",
      "environment": "production",
      "context": {
        "country": "FR",
        "plan": "enterprise"
      },
      "bucket": 47,
      "rolloutPercentage": 25,
      "enabled": false,
      "variant": "off",
      "reason": "rollout-miss",
      "matchedRule": "percentage-rollout",
      "evaluatedAt": "2026-07-29T23:59:59.456Z"
    },
    {
      "evaluationId": "eval_1_248abecc",
      "flagKey": "compact-navigation",
      "subjectKey": "anon-1-078f",
      "environment": "production",
      "context": {
        "country": "US",
        "plan": "pro"
      },
      "bucket": 3,
      "rolloutPercentage": 25,
      "enabled": true,
      "variant": "on",
      "reason": "rollout-match",
      "matchedRule": "percentage-rollout",
      "evaluatedAt": "2026-07-29T23:59:58.609Z"
    },
    {
      "evaluationId": "eval_2_0902c05a",
      "flagKey": "compact-navigation",
      "subjectKey": "anon-2-1579",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Disabled flag evaluations
GET /api/feature-flags/evaluations?flag=bulk-export&active=false&rolloutPercentage=100&count=10
{
  "data": [
    {
      "evaluationId": "eval_0_016cfb6a",
      "flagKey": "bulk-export",
      "subjectKey": "anon-0-a958",
      "environment": "development",
      "context": {
        "country": "FR",
        "plan": "enterprise"
      },
      "bucket": 47,
      "rolloutPercentage": 100,
      "enabled": false,
      "variant": "off",
      "reason": "flag-disabled",
      "matchedRule": null,
      "evaluatedAt": "2026-07-29T23:59:59.456Z"
    },
    {
      "evaluationId": "eval_1_248abecc",
      "flagKey": "bulk-export",
      "subjectKey": "anon-1-078f",
      "environment": "development",
      "context": {
        "country": "US",
        "plan": "pro"
      },
      "bucket": 3,
      "rolloutPercentage": 100,
      "enabled": false,
      "variant": "off",
      "reason": "flag-disabled",
      "matchedRule": null,
      "evaluatedAt": "2026-07-29T23:59:58.609Z"
    },
    {
      "evaluationId": "eval_2_0902c05a",
      "flagKey": "bulk-export",
      "subjectKey": "anon-2-1579",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates fictional feature flag fixtures for administration screens, SDK demos and rollout tests. The root route models active, inactive and archived configurations across boolean, percentage, targeted and multivariate strategies. Variant weights always total 100, percentage rules agree with their weights, and inactive or archived flags are never reported as enabled.

Lifecycle timestamps are coherent: createdAt ≤ updatedAt ≤ asOf, while only archived flags carry an archivedAt at or after the last update. The resolved asOf defaults to the current UTC day's end and is echoed for replay. Targeting contexts use synthetic anonymous keys, a short country code and a plan label—never an email, IP address, device id or secret.

/evaluations produces deterministic percentage-rollout decisions. Buckets are integers from 0 through 99, and a subject is enabled exactly when the flag is active and bucket < rolloutPercentage. Boundary values 0 and 100 therefore behave without exceptions. This is generic mock behavior, not an implementation of any vendor SDK or hashing algorithm.

Use it for

  • Populate a feature-management UI with coherent lifecycle and strategy states
  • Test percentage-rollout boundaries and enabled/off variants deterministically
  • Create safe evaluation-log fixtures without real user targeting data

Frequently asked questions

Do variant weights always add up to 100?

Yes. Every generated configuration has variant weights totaling exactly 100, including inactive and archived fixtures.

How are rollout evaluations decided?

An active evaluation is on when its integer bucket is lower than rolloutPercentage. Inactive flags are always off.

What happens at rollout percentages 0 and 100?

Zero enables no subjects and 100 enables every subject when the flag is active.

Does the context contain personal information?

No. Context keys, country codes and plans are synthetic fixture values; no emails, names, IPs or real identifiers are generated.