• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
willemhelmet

willemhelmet

coin-flip-api

Public
Like
coin-flip-api
Home
Code
6
.vtignore
AGENTS.md
README.md
H
coinflip.http.ts
deno.json
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
coinflip.http.ts
https://willemhelmet--399bde0aa2ee11f089a10224a6c84d84.web.val.run
README.md

Coin Flip API

A hilarious API that randomly succeeds or fails with 50/50 probability.

How it works

Each time you call the API, it flips a virtual coin:

  • Heads (50%): Returns success (200) with a winning message
  • Tails (50%): Returns failure (500) with a losing message

Usage

Simply make a request to the endpoint:

curl https://your-username-coinflip.web.val.run

Response Examples

Success Response (200)

{ "success": true, "message": "πŸŽ‰ You won! The coin landed on heads!", "result": "heads" }

Failure Response (500)

{ "success": false, "message": "πŸ’₯ You lost! The coin landed on tails!", "result": "tails" }

Use Cases

  • Testing error handling in your applications
  • Chaos engineering experiments
  • Making important life decisions
  • Having fun with unpredictable APIs
Code
.vtignoreAGENTS.mdREADME.md
H
coinflip.http.ts
deno.jsonmain.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.