Navigation
POST datetime

humanize

1 credit

Convert a datetime to a relative human-readable string like '3 hours ago' or 'in 2 days'

Endpoint

POST /api/v1/tools/datetime/humanize

Body Parameters

date string required
reference string | null optional default: null

Example

input Request
{
    "date": "2024-01-15T10:00:00",
    "reference": "2024-01-15T13:00:00"
}
output Response
"3 hours ago"

Response Format

HTTP/1.1 200 OK SUCCESS
{
  "success": true,
  "data": "3 hours ago",
  "meta": {
    "tool": "humanize",
    "credits_consumed": 1
  }
}
HTTP/1.1 422 Unprocessable Entity ERROR
{
  "success": false,
  "data": null,
  "error": {
    "code": "validation_error",
    "message": "The given data was invalid."
  }
}

Sign in to try this tool directly from the docs.

Code Examples
Request Example
lightbulb Developer Tip

Credits are deducted before execution. If the upstream tool fails, credits are automatically refunded to your account.