๐ŸŽฒ Random Generator API

Generate random numbers, dice rolls, coin flips, and card draws

๐Ÿ“– Overview

The Random Generator API provides cryptographically secure random generation for various use cases including numbers, dice rolls, coin flips, and card draws. Perfect for games, statistical sampling, or any application requiring reliable randomness.

๐Ÿ”ข Number Generation

Generate random integers and floats within specified ranges

๐ŸŽฒ Dice Rolling

Simulate rolling various dice types (D4, D6, D8, D10, D12, D20, D100)

๐Ÿช™ Coin Flipping

Generate random coin flips with customizable options

๐Ÿƒ Card Drawing

Draw random playing cards from a standard 52-card deck

๐Ÿ”’ Cryptographically Secure โšก High Performance ๐ŸŽฏ Multiple Types

๐ŸŽฏ Generation Types

๐Ÿ”ข Numbers

Integers and decimals

๐ŸŽฒ Dice

D4, D6, D8, D10, D12, D20, D100

๐Ÿช™ Coins

Heads or Tails

๐Ÿƒ Cards

52-card deck

๐ŸŒ Base URL

https://api.lorwongam.com/api/randomizer/

๐Ÿ” Authentication

No authentication required. This is a public API that can be accessed without any API keys or tokens.

๐Ÿ“ก API Endpoints

POST / Generate Random Values

Generate random values based on the specified type and parameters.

Request Parameters

Parameter Type Required Description
type string Required Generation type: "number", "dice", "coin", "card", "all"
min integer Optional* Minimum value (for number type, default: 1)
max integer Optional* Maximum value (for number type, default: 100)
sides integer Optional* Number of sides on dice (for dice type, 2-100, default: 6)
count integer Optional Number of items to generate (dice: 1-10, coin: 1-10, card: 1-52, default: 1)
with_jokers boolean Optional Include jokers in card deck (for card type, default: false)
coin_count integer Optional Number of coins to flip (1-10)
card_count integer Optional Number of cards to draw (1-52)
count integer Optional Number of results to generate (1-100)

Example Request - Random Number

curl -X POST "https://api.lorwongam.com/api/randomizer/" \ -H "Content-Type: application/json" \ -d '{ "type": "number", "min": 1, "max": 100 }'

Example Request - Dice Roll

curl -X POST "https://api.lorwongam.com/api/randomizer/" \ -H "Content-Type: application/json" \ -d '{ "type": "dice", "sides": 20, "count": 3 }'

Example Request - Coin Flip

curl -X POST "https://api.lorwongam.com/api/randomizer/" \ -H "Content-Type: application/json" \ -d '{ "type": "coin", "count": 5 }'

Example Request - Card Draw

curl -X POST "https://api.lorwongam.com/api/randomizer/" \ -H "Content-Type: application/json" \ -d '{ "type": "card", "count": 5, "with_jokers": true }'

Example Request - Generate All Types

curl -X POST "https://api.lorwongam.com/api/randomizer/" \ -H "Content-Type: application/json" \ -d '{ "type": "all" }'

๐Ÿ“Š Response Format

Success Response Examples

Random Numbers Response

{ "success": true, "data": { "type": "number", "results": [42, 17, 89, 3, 76], "count": 5, "settings": { "min": 1, "max": 100, "decimal_places": 0 } }, "message": "Random numbers generated successfully", "timestamp": "2025-09-09T12:00:00Z" }

Dice Roll Response

{ "success": true, "data": { "type": "dice", "results": [ { "die": 1, "value": 18, "dice_type": "d20" }, { "die": 2, "value": 7, "dice_type": "d20" }, { "die": 3, "value": 20, "dice_type": "d20" } ], "total": 45, "dice_count": 3, "dice_type": "d20" }, "message": "Dice rolled successfully", "timestamp": "2025-09-09T12:00:00Z" }

Coin Flip Response

{ "success": true, "data": { "type": "coin", "results": [ { "coin": 1, "result": "heads" }, { "coin": 2, "result": "tails" }, { "coin": 3, "result": "heads" } ], "summary": { "heads": 2, "tails": 1 }, "coin_count": 3 }, "message": "Coins flipped successfully", "timestamp": "2025-09-09T12:00:00Z" }

Card Draw Response

{ "success": true, "data": { "type": "card", "results": [ { "card": 1, "rank": "King", "suit": "Hearts", "value": "Kโ™ฅ", "unicode": "๐Ÿ‚พ" }, { "card": 2, "rank": "7", "suit": "Spades", "value": "7โ™ ", "unicode": "๐Ÿ‚ง" } ], "card_count": 2, "remaining_cards": 50 }, "message": "Cards drawn successfully", "timestamp": "2025-09-09T12:00:00Z" }

Error Response

{ "success": false, "error": "Invalid generation type. Must be one of: number, dice, coin, card", "code": "INVALID_TYPE", "timestamp": "2025-09-09T12:00:00Z" }

๐ŸŽฒ Dice Types

Dice Type Sides Range Common Use
d4 4 1-4 Damage dice in RPGs
d6 6 1-6 Standard board game die
d8 8 1-8 RPG weapon damage
d10 10 1-10 Percentile systems
d12 12 1-12 Heavy weapon damage
d20 20 1-20 D&D ability checks
d100 100 1-100 Percentage rolls

๐Ÿƒ Playing Card Information

The card drawing feature uses a standard 52-card deck with the following specifications:

Suits

  • Hearts (โ™ฅ): Red suit
  • Diamonds (โ™ฆ): Red suit
  • Clubs (โ™ฃ): Black suit
  • Spades (โ™ ): Black suit

Ranks

  • Number Cards: 2, 3, 4, 5, 6, 7, 8, 9, 10
  • Face Cards: Jack (J), Queen (Q), King (K)
  • Ace: A (can be high or low depending on game rules)

Unicode Support

Each card includes Unicode playing card symbols for easy display in applications.

โš ๏ธ Error Codes

Code Description
INVALID_TYPE Generation type is not supported
INVALID_RANGE Min/Max values are invalid or min > max
INVALID_DICE_TYPE Dice type is not supported
INVALID_COUNT Count parameter is outside valid range
INVALID_DECIMAL_PLACES Decimal places is outside valid range (0-10)
GENERATION_ERROR Error occurred during random generation

๐ŸŽฏ Common Use Cases

๐ŸŽฎ Gaming Applications

Dice rolls, card games, random events, loot generation

๐Ÿ“Š Statistical Sampling

Random sampling, A/B testing, survey randomization

๐ŸŽฐ Casino & Gambling

Fair randomization for gambling applications

๐Ÿงช Research & Testing

Random data generation, simulation, testing scenarios

๐Ÿšฆ Rate Limits

Currently, there are no rate limits imposed on this API. However, please use it responsibly and avoid excessive requests that might impact service availability for other users.

๐ŸŽฏ Ready to Try?

Test the Random Generator API with our interactive web interface or start integrating it into your application.

Try Web Interface Test API Endpoint