Random Coin Flip

Coin Flip Endpoint

The Coin Flip endpoint provides a fun and easy way to flip a coin and get a very simply result!

Endpoint

  • URL: https://api.erensko.xyz/v1/coin-flip

  • Method: GET

  • Description: Flips a coin and gives a head or tails result.

URL Parameters

Key
Value

heads (optional)

The percentage chance for the coin to land on Heads.

tails (optional)

The percentage chance for the coin to land on Tails.

Headers

Key
Value

Authorization

Your own personal API key, create one by clicking here. This is required.

Request Example

GET https://api.erensko.xyz/v1/coin-flip

Response (Random)

{
  "result": "Heads",
  "description": "Heads: The coin landed on the head side.",
  "flipCount": 1,
  "timestamp": "2024-11-08T12:30:45.123Z",
  "probability": {
    "heads": "50%",
    "tails": "50%"
  },
  "flipMethod": "Simulated Randomly",
  "isValid": true
}

Response (Custom)

{
  "result": "Tails",
  "description": "Tails: The coin landed on the tails side.",
  "flipCount": 1,
  "timestamp": "2024-11-10T12:34:56.789Z",
  "probability": {
    "heads": "1%",
    "tails": "99%"
  },
  "flipMethod": "Custom Probability",
  "isValid": true
}

Last updated