Skip to content

AiratTop/uuid.api.airat.top

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

uuid.api.airat.top

uuid

Tiny Cloudflare Worker API that generates UUID v4 and UUID v7.

You can use my Open Source UUID generator to generate UUID v4/v7 in the browser (GitHub repo).

API

Default behavior:

  • UUID version defaults to v4.
  • Use ?version=7 (or ?version=v7) to generate v7.

GET

GET /

Example (default v4):

curl 'https://uuid.api.airat.top/'

Response:

{"uuid":"2f5b0b6b-2b54-4a2c-93c3-8e5f9a8e1a5c","version":"v4"}

Example (v7):

curl 'https://uuid.api.airat.top/?version=7'

Response:

{"uuid":"0194f94c-29f6-7da7-a7f8-66f0f21ff923","version":"v7"}

Test in browser:

Plain response:

curl 'https://uuid.api.airat.top/?plain=1&version=7'

Response:

0194f94c-29f6-7da7-a7f8-66f0f21ff923

POST

POST also returns a fresh UUID.

curl -X POST 'https://uuid.api.airat.top/?version=7'

Response:

{"uuid":"0194f94c-29f6-7da7-a7f8-66f0f21ff923","version":"v7"}

Validation errors

Unsupported version returns 400:

curl 'https://uuid.api.airat.top/?version=8'
{"error":"Unsupported version. Use version=4 or version=7."}

CORS

CORS is enabled for all origins (*).

Privacy

No analytics or request logs are collected by this project.

Monitoring

Health check endpoint:

GET /health

Response:

{"status":"ok"}

Test in browser: https://uuid.api.airat.top/health

Project structure

  • worker.js - Cloudflare Worker script.

Deployment

Deploy with Wrangler (the repo already includes wrangler.toml):

npx wrangler deploy

If you use Cloudflare Workers Builds (GitHub integration), set the deploy command to npx wrangler deploy and keep the root path at /.

To serve it on a custom domain, add the domain in Workers & Pages -> Domains & Routes. Cloudflare will create the DNS record and issue SSL automatically.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Author

AiratTop

Contributors