PHP Casino Script

A PHP API for virtual-point games.

Run dice, roulette, and high-or-low card rounds. Inspect the JSON, compare simulated outcomes, and run the MIT-licensed source locally.

Download source ZIP

Live API demo

1,000 points

Loading the game catalog…

Response

Play a round to see the API response.

Simulate a set of rounds

The simulation uses the selected pick’s probabilities. It runs in this browser and leaves the practice balance alone.

API reference

GET /developer-app/api.php returns the game catalog with accepted picks, probabilities, and gross payout multipliers.

POST /developer-app/api.php accepts an application/json body up to 4,096 bytes.

curl https://phpcasinoscript.com/developer-app/api.php \
  -H 'Content-Type: application/json' \
  --data '{"game":"dice","pick":"seven","stake":10}'

Send game and pick from the catalog, and an integer stake from 1 through 10,000. For an exact roulette pick, send integer number from 0 through 36.

A round returns the detailed result, the outcome (win, loss, or push), and the stake, gross return, and net change. A push returns the stake. Card ranks are independently sampled from 1 through 13. The endpoint has no server-side accounts or wallet.

The engine uses PHP random_int to sample uniformly on the server.

Install locally

  1. Extract the source archive, including its private engine folder.
  2. Use PHP 8.2 or later and open a terminal in the extracted project directory.
  3. Run the command below and open the displayed loopback address.
php -S 127.0.0.1:8080 -t public

When deploying, point the server document root at public. Keep the engine directory outside it. The hosted game and demo use virtual points only.