Websonic

Statistical Data and API Page

The Population Island API

The Population Island API is a public interface that provides real-time access to the simulation's data. It's designed to be simple, fast, and easy to integrate into your own applications. Whether you're building a dashboard, a data visualization, or a game, the API gives you the tools to interact with the world of Population Island.

The API is built on a RESTful architecture, returning all data in a standard JSON format. You can fetch data for individual households, get global statistics, or even pull historical data to see how the population has changed over time.

This powerful and flexible tool allows you to bring the story and data of Population Island to life in your own unique way.

Household Data API Documentation

A service for fetching simulation data, including households and individual character profiles.

Endpoint: Fetch Random Households

This endpoint retrieves a random selection of households (families or single people) that are currently alive in the simulation.

GET /endpoint.php
Parameters (Optional)
Parameter Type Description
families Integer The number of random households to return. If omitted, it defaults to **1**. The maximum allowed value is **50**.
Default Behavior
  • If the families parameter is not provided, it returns a single random family or single person.
  • If families are not found, it attempts to return single people instead.
Success Response Example (JSON)
[
  {
    "household_name": "Alvarez Family",
    "members": [
      {
        "first_name": "Patsy",
        "last_name": "Alvarez",
        "gender": "female",
        "age": 95
      },
      {
        "first_name": "Elliott",
        "last_name": "Alvarez",
        "gender": "male",
        "age": 93
      }
    ]
  },
  {
    "household_name": "Single Person",
    "members": [
      {
        "first_name": "Victor",
        "last_name": "Austin",
        "gender": "male",
        "age": 18
      }
    ]
  }
]

Endpoint: Fetch Detailed Character Profile and History

This endpoint retrieves comprehensive data, current stats, and event logs for a specific character using their public identifier (UID). **The API assumes the file is named api_mycharacter.php.**

GET /api_mycharacter.php?uid={public_uid}
Required Parameters
Parameter Type Description
uid String The unique ID (UID) of the character to retrieve (e.g., 101909).
Success Response Example (JSON)
{
  "success": true,
  "error": null,
  "data": {
    "simDay": 2345,
    "name": "Jane Doe",
    "age": 35,
    "gender": "female",
    "status": "Alive",
    "career": "Software Engineer",
    "wealth": 5500.5,
    "stats": {
      "mentalHealth": 75.2,
      "intelligenceScore": 88.0,
      "physicalAbility": 65.5,
      "innateIntelligence": 80.0,
      "innateMentalHealth": 70.0,
      "innatePhysicality": 60.0
    },
    "traits": {
      "education": "University",
      "salaryModifier": 1.25
    },
    "family": {
      "partner": null,
      "children": []
    },
    "dailyEventsLog": [
      {
        "category": "Work",
        "name": "Solved a complex bug",
        "mods": { "phy": 0, "int": 0.5, "mhealth": 0.2, "wealth": 10 }
      }
    ],
    "recentEvents": [
      {
        "day": "3 days ago",
        "description": "Jane Doe received a promotion at work."
      },
      {
        "day": "1 month ago",
        "description": "Jane Doe moved to a new house."
      }
    ]
  }
}

Endpoint: Campsite Job Candidates

This endpoint retrieves random candidate profiles for campsite job positions. Each candidate includes their basic details, appearance, personality traits, and core stats. Filter by career to find candidates for specific roles — for example, pull only unemployed candidates (career ID 7) who are looking for work.

GET /api_campsite_candidates.php
Parameters (Optional)
Parameter Type Description
count Integer Number of candidates to return. Defaults to 5. Maximum is 50.
career_id Integer Filter candidates by career ID. Use 7 for unemployed candidates. Common IDs: 1=Trader, 2=Shopkeeper, 6=Scientist, 7=Unemployed, 8=Farmer, 9=Rancher.
Success Response Example (JSON)
[
  {
    "id": 12345,
    "first_name": "Jane",
    "last_name": "Doe",
    "gender": "female",
    "age": 33,
    "wealth": 1250.50,
    "career_id": 7,
    "career_name": "Unemployed",
    "appearance": {
      "head": "long",
      "face": "smile",
      "facial_hair": "none",
      "accessories": "glasses2",
      "skin_color": "ffdbb4",
      "clothing_color": "8fa7df"
    },
    "traits": {
      "social_drive_extrovert": true,
      "motivation_ambitious": false,
      "stress_response_stoic": true,
      "education": "Higher Education",
      "salary_modifier": 1.25,
      "personality": { "ext": 45, "amb": 20, "sto": 78 }
    },
    "stats": {
      "mental_health": 75.0,
      "intelligence_score": 88.0,
      "physical_ability": 65.5,
      "innate_intelligence": 80.0,
      "innate_mental_health": 70.0,
      "innate_physicality": 60.0
    }
  }
]

Endpoint: Campsite Visitors

This endpoint generates visitor groups for the campsite simulation. Visitors arrive as singles, couples, or families. Each group includes member profiles plus campsite-specific derived data: budget per day, stay duration, pitch preference, and behavioral traits that drive satisfaction and complaints.

GET /api_campsite_visitors.php
Parameters (Optional)
Parameter Type Description
singles Integer Number of single-person visitor groups to generate.
couples Integer Number of couple visitor groups to generate. Each couple is two real partnered people from the simulation.
families Integer Number of family visitor groups to generate. Families include parents and children from the simulation.
groups Integer Generate a random mixture of singles, couples, and families (~30% singles, ~35% couples, ~35% families). Maximum 20 per type.
free_pitches Integer Number of currently unoccupied pitches. When provided, the API calculates how many groups to generate from: floor(free_pitches × occupancy) × (avg_satisfaction / 100). Occupancy is randomly chosen between 60–90% per request. Defaults to 75% satisfaction if avg_satisfaction is omitted.
avg_satisfaction Float Average campsite satisfaction score (0–100). Acts as a reputation multiplier on group arrivals. Higher satisfaction = more visitors via word-of-mouth. Minimum 1 group if any free pitches exist (prevents dead campsites from never recovering). Only used when free_pitches is provided.
sim_day Integer Required to enable stateful mode. The current simulation day. When provided alongside total_pitches, the API manages guest arrivals and departures in a database table, returning departing and arriving arrays with timestamps.
total_pitches Integer Required for stateful mode alongside sim_day. The total number of pitches at the campsite. The API calculates available capacity as total_pitches minus currently occupied pitches and generates arrivals accordingly.
Stateful vs Stateless Mode
  • Stateless (sim_day not provided) — Returns a flat array of visitor groups. Backwards compatible with existing code.
  • Stateful (sim_day + total_pitches provided) — Returns a structured object with departing, arriving, and summary arrays. Guests are tracked in the campsite_guests table: departing guests leave at 10:00, new arrivals check in at 12:00.
  • Explicit parameters (singles, couples, families, groups) always take precedence and bypass stateful/pitch-based logic.
Default Behaviour & Priority
  • If singles, couples, families, or groups are provided — those explicit counts are used and pitch/satisfaction logic is skipped entirely.
  • If free_pitches is provided — pitch-based calculation: groups = ceil(floor(free_pitches × random(0.6–0.9)) × (avg_satisfaction / 100)), minimum 1 group.
  • If no parameters are provided — returns 1 random group (single, couple, or family).
  • Maximum of 20 groups per type.
Example Calculations
ParamsOccupancy (random)Base GroupsSatisfactionFinal Groups
free_pitches=100.7070.75 (default)ceil(7×0.75)=6
free_pitches=10&avg_satisfaction=600.7070.60ceil(7×0.60)=5
free_pitches=10&avg_satisfaction=800.8580.80ceil(8×0.80)=7
free_pitches=5&avg_satisfaction=100.7030.10max(1, ceil(3×0.10))=1
Derived Stats Explained
StatRangeDriven By
cleanliness_expectation0–100Education, extrovert (+5), stoic (−10), mental health, group type
noise_tolerance0–100Extrovert (+20), stoic (+10), ambitious (−10), intelligence, group type
comfort_expectation0–100Wealth ratio, ambitious (+10), Higher Ed (+10), physical ability, group type
hygiene_decay_ratefloatBase: single 0.7, couple 1.0, family 1.5 × cleanliness modifier
hunger_decay_ratefloatBase: single 0.8, couple 1.0, family 1.3 × physical ability modifier
fun_decay_ratefloatBase: single 0.7, couple 0.9, family 1.4; extroverts ×1.2
prefers_quiet_areabooleanStoic, introverted, or high intelligence(prefers quiet)
prefers_entertainmentbooleanExtroverted, family groups, or ambitious(prefers entertainment)
prefers_naturebooleanStoic, high physical ability, or introverted(prefers nature)
Budget & Pitch Preferences
  • budget_per_day: £30 base/person/day scaled by (wealth / avg_wealth). Clamped £15–£150/person.
  • preferred_pitch_type: Budget <£25: tent, <£45: caravan, ≥£45: static
  • stay_duration: Singles 1–3 nights, Couples 2–5, Families 4–10
  • has_dog: 20% singles, 30% couples, 40% families
Stateful Mode Response (JSON)
{
  "departing": [
    {
      "group_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "group_type": "family",
      "family_name": "Hail Family",
      "members": [...],
      "member_count": 3,
      "has_dog": true,
      "stay_duration": 7,
      "arrival_day": 1,
      "departure_day": 8,
      "departure_time": "10:00"
    }
  ],
  "arriving": [
    {
      "group_uuid": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
      "group_type": "couple",
      "members": [...],
      "member_count": 2,
      "has_dog": false,
      "stay_duration": 4,
      "preferred_pitch_type": "caravan",
      "budget_per_day": 85.50,
      "group_traits": {
        "cleanliness_expectation": 72,
        "noise_tolerance": 63,
        "comfort_expectation": 58,
        "hygiene_decay_rate": 1.29,
        "hunger_decay_rate": 1.04,
        "fun_decay_rate": 1.08,
        "prefers_quiet_area": false,
        "prefers_entertainment": true,
        "prefers_nature": false
      },
      "arrival_time": "12:00"
    }
  ],
  "summary": {
    "sim_day": 8,
    "total_pitches": 20,
    "pitches_occupied_before": 15,
    "pitches_freed": 1,
    "pitches_occupied_after": 16,
    "pitches_available": 4,
    "guests_departing": 1,
    "guests_arriving": 1
  }
}
Stateless Response — Single Group (JSON)
[
  {
    "group_type": "family",
    "family_name": "Hail Family",
    "members": [
      {
        "id": 66214,
        "first_name": "Jimmie",
        "last_name": "Wiley",
        "gender": "male",
        "age": 36,
        "wealth": 63321.77,
        "career_id": 55,
        "career_name": "Drone Operator",
        "appearance": { "head": null, "face": null, "facial_hair": null, "accessories": null, "skin_color": null, "clothing_color": null },
        "traits": {
          "social_drive_extrovert": true,
          "motivation_ambitious": false,
          "stress_response_stoic": true,
          "education": "Higher Education",
          "salary_modifier": 1.3,
          "personality": { "ext": 95, "amb": 14, "sto": 99 }
        },
        "stats": {
          "mental_health": 85.4,
          "intelligence_score": 68.7,
          "physical_ability": 73.1,
          "innate_intelligence": 72.66,
          "innate_mental_health": 99.85,
          "innate_physicality": 77.75
        }
      }
    ],
    "member_count": 3,
    "has_dog": true,
    "stay_duration": 7,
    "preferred_pitch_type": "static",
    "budget_per_day": 180.50,
    "group_traits": {
      "cleanliness_expectation": 63,
      "noise_tolerance": 78,
      "comfort_expectation": 55,
      "hygiene_decay_rate": 1.32,
      "hunger_decay_rate": 1.37,
      "fun_decay_rate": 1.68,
      "prefers_quiet_area": false,
      "prefers_entertainment": true,
      "prefers_nature": true
    }
  }
]

Live Examples & Testing

Example 1: Default Request (1 Random Household)

Call the API without any parameters to get one random household.

/endpoint.php
Example 2: Request 3 Random Households

Use the ?families=3 parameter to get three random households.

/endpoint.php?families=3
Example 3: Fetch Character Profile (Placeholder UID)

Get the full profile and event history for a specific character. (Note: A real UID is required for live data - this can be found from the households endpoint.php API).

/api_mycharacter.php?uid=101909
Example 4: Campsite Candidates (Default 5)

Fetch 5 random candidates for campsite job positions. Use ?count=3 or &career_id=7 to filter.

/api_campsite_candidates.php
Example 5: Campsite Visitors (1 Random Group)

Get a single random visitor group (single, couple, or family). Use ?groups=3 or ?families=2&couples=1 for more.

/api_campsite_visitors.php

Live API Result

Click an "Execute Example" button to see the JSON output here...