This site is not affiliated with or endorsed by Cloudflare, Inc. It simply showcases experiments built using Cloudflare services.
Cloudflare Experiments

Quickstart

Deploy your first Cloudflare experiment in under 60 seconds

Get started with Cloudflare Experiments by deploying a simple worker to the edge. Each experiment is designed to run in under 60 seconds and demonstrates real-world capabilities of the Cloudflare platform.

Deploy an Experiment

The fastest way to get started is using the one-click deploy button. We'll use the Where Am I experiment as an example.

Choose an experiment

Browse the available experiments and pick one to deploy. For this guide, we'll deploy Where Am I, which returns geolocation data from Cloudflare's edge.

Click the deploy button

Click the Deploy to Cloudflare Workers button from any experiment page or the main repository.

Deploy to Cloudflare Workers

Authenticate with Cloudflare

If you haven't already, you'll be prompted to sign in to your Cloudflare account. The deployment process will automatically:

  • Create a new Worker
  • Configure the necessary bindings
  • Deploy to Cloudflare's global edge network

Access your deployed worker

Once deployed, you'll receive a *.workers.dev URL where your experiment is live.

Deploy from shrinathsnayak/cloudflare-experiments. To deploy from your own fork, change the owner in the deploy URL.

Test Your Deployment

Once deployed, test your worker using curl or your browser.

Where Am I Example

curl https://your-worker.workers.dev/whereami

Response:

{
  "country": "US",
  "city": "San Francisco",
  "region": "California",
  "timezone": "America/Los_Angeles",
  "colo": "SFO",
  "asn": 13335
}

Is It Down Example

Check if a website is reachable from Cloudflare's edge:

curl "https://your-worker.workers.dev/check?url=https://www.cloudflare.com"

Response:

{
  "status": "reachable",
  "responseTime": 87,
  "statusCode": 200,
  "colo": "LHR"
}

The colo field shows the edge data center (IATA code) that served your request. Cloudflare has over 300 locations worldwide.

Local Development

To modify an experiment or develop locally, clone the repository and run the worker on your machine.

Install Dependencies

cd apps/experiments/whereami
npm install
cd apps/experiments/whereami
pnpm install
cd apps/experiments/whereami
yarn install

Start Development Server

npm run dev
pnpm dev
yarn dev

The worker will be available at http://localhost:8787.

Test Locally

curl http://localhost:8787/whereami

When running locally, the cf object may be empty or minimal. Full geolocation data appears when deployed to Cloudflare's edge network.

What You Can Build

Each experiment in this collection demonstrates practical capabilities of the Cloudflare platform:

  • Workers - Edge compute without backend servers
  • Workers AI - Run AI models at the edge
  • Browser Rendering - Capture screenshots and manipulate web pages
  • HTMLRewriter - Transform HTML on the fly
  • Edge Networking - Global request/response handling
  • D1 - Serverless SQL database
  • R2 - Object storage

All experiments are stateless first and use edge compute, fetch, and HTML parsing without requiring persistent storage. Learn more about the design philosophy.

Next Steps

On this page