Skip to content

For Developers

HTTP API

Generate UUIDs straight from your terminal or app — no key, no sign-up. Responses are JSON by default; send Accept: text/plain for newline-delimited output that's easy to pipe.

Endpoints

Method & path Description
GET /api/uuidA UUID (v4 by default), or use the query parameters below.
GET /api/uuid/v4Alias for ?version=4.
GET /api/uuid/v7Alias for ?version=7.

Query parameters

Parameter Values Default
version1, 4, 7, nil4
count1–10001
formatlowercase, uppercase, braces, hyphenlesslowercase

Invalid parameters return 400 with a JSON {"error": "…"} explaining the allowed values.

Examples

# One v4 UUID
curl https://getuuid.sh/api/uuid
# → {"version":"4","format":"lowercase","uuid":"…"}

# Five v7 UUIDs
curl 'https://getuuid.sh/api/uuid?version=7&count=5'

# Aliases
curl https://getuuid.sh/api/uuid/v4
curl https://getuuid.sh/api/uuid/v7

# Plain text, 100 uppercase UUIDs
curl -H 'Accept: text/plain' 'https://getuuid.sh/api/uuid?count=100&format=uppercase'

Responses

Single (count=1)

{
  "version": "4",
  "format": "lowercase",
  "uuid": "…"
}

Multiple (count > 1)

{
  "version": "7",
  "format": "lowercase",
  "count": 5,
  "uuids": ["…", "…"]
}

Generate a UUID in your language

Each snippet produces a random (version 4) UUID locally — no network needed. Don't want a dependency? Call the API above instead.

Bash

uuidgen
# Linux box without uuidgen:
cat /proc/sys/kernel/random/uuid

Python

import uuid

print(uuid.uuid4())

JavaScript

// Browsers + Node 19+
const id = crypto.randomUUID();

TypeScript

const id: string = crypto.randomUUID();

C#

Guid.NewGuid().ToString();

// .NET 9+ — time-ordered v7:
Guid.CreateVersion7().ToString();

Go

import "github.com/google/uuid"

id := uuid.New().String()

Java

import java.util.UUID;

String id = UUID.randomUUID().toString();

Kotlin

import java.util.UUID

val id = UUID.randomUUID().toString()

Ruby

require "securerandom"

id = SecureRandom.uuid

Rust

// uuid = { version = "1", features = ["v4"] }
use uuid::Uuid;

let id = Uuid::new_v4();

PHP

// composer require ramsey/uuid
use Ramsey\Uuid\Uuid;

echo Uuid::uuid4()->toString();

Perl

use Data::UUID;

print Data::UUID->new->create_str;
← Back to the generator