Catalog/datetime-humanize-duration

Date & Time

Humanize a duration API

Converts a raw duration in seconds or milliseconds into a human phrase ("2 days, 7 hours, ...") with a per-unit breakdown and optional maxUnits truncation. Answers 'What is 200000 seconds in plain English?', 'Humanize this millisecond duration.'.

Price$0.02per request
MethodPOST
Route/v1/datetime/humanize-duration
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
datetimedurationhumanizeformatsecondstime-agoprettyelapsed
API URLhttps://x402.hexl.dev/v1/datetime/humanize-duration
Integration docs
Example request
{
  "seconds": 200000
}
Example response
{
  "inputMilliseconds": 200000000,
  "sign": "positive",
  "components": {
    "day": 2,
    "hour": 7,
    "minute": 33,
    "second": 20,
    "millisecond": 0
  },
  "human": "2 days, 7 hours, 33 minutes, 20 seconds",
  "interpretation": "2 days, 7 hours, 33 minutes, 20 seconds"
}
Input schema
{
  "type": "object",
  "required": [],
  "properties": {
    "seconds": {
      "type": "number",
      "examples": [
        200000
      ]
    },
    "milliseconds": {
      "type": "number"
    },
    "maxUnits": {
      "type": "integer",
      "examples": [
        2
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}