ID Generator API

Simple REST API for generating UUID, ULID, and CUID2 identifiers

Overview

Our ID Generation API provides four simple endpoints for generating Universally Unique Identifiers (UUID v4/v7), ULIDs, and CUID2s. All endpoints return JSON responses and support CORS for cross-origin requests.

Base URL

https://uuid.guru/api
GET

Generate UUID v4 (Random)

Endpoint

/api/v4

Description

Generates a UUID version 4 using cryptographically secure random numbers. This is the most commonly used UUID format.

Example Request

curl https://uuid.guru/api/v4

Example Response

{
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "version": "v4",
  "timestamp": "2023-12-07T10:30:00.000Z"
}
GET

Generate UUID v7 (Time-ordered)

Endpoint

/api/v7

Description

Generates a UUID version 7 with timestamp information embedded. These UUIDs maintain chronological sort order while remaining unique.

Example Request

curl https://uuid.guru/api/v7

Example Response

{
  "uuid": "01902ec8-7462-7000-a98b-3c4d92c6d9e5",
  "version": "v7",
  "timestamp": "2023-12-07T10:30:00.000Z"
}
GET

Generate ULID (Sortable)

Endpoint

/api/ulid

Description

Generates a Universally Unique Lexicographically Sortable Identifier (ULID). ULIDs are 128-bit compatible with UUID and naturally sort by time.

Example Request

curl https://uuid.guru/api/ulid

Example Response

{
  "ulid": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "version": "ulid",
  "timestamp": "2023-12-07T10:30:00.000Z"
}
GET

Generate CUID2 (Collision-resistant)

Endpoint

/api/cuid2

Description

Generates a CUID2 (Collision-resistant Unique Identifier version 2). CUID2s are shorter, URL-safe, and highly collision-resistant.

Example Request

curl https://uuid.guru/api/cuid2

Example Response

{
  "cuid2": "c4u6pxk1r0000h0me6q1234ft",
  "version": "cuid2",
  "timestamp": "2023-12-07T10:30:00.000Z"
}

Error Responses

500 Internal Server Error

Returned when UUID generation fails (rare occurrence).

{
  "error": "Failed to generate UUID",
  "code": 500,
  "timestamp": "2023-12-07T10:30:00.000Z"
}

404 - Not Found

Returned for unsupported endpoints.

{
  "error": "Endpoint not found",
  "code": 404,
  "timestamp": "2023-12-07T10:30:00.000Z"
}

Additional Information

CORS Support

All endpoints support Cross-Origin Resource Sharing (CORS) for browser-based applications.

Content-Type

All responses are returned with Content-Type: application/json

Performance

UUID generation is performed server-side with optimized algorithms for maximum performance and security.