API BUTTER
  • List countriesData / countries · /v1/data/countriesGET
  • List currenciesData / currencies · /v1/data/currenciesGET
  • Format a concise time rangeDates / range · /v1/dates/rangeGET
GET/v1/dates/rangeMarkdown ↗Try it live ↗

Format a concise time range

Free during preview · test keys only

Request

start=10:00end=11:00

Result · Shared am/pm

10 - 11am

Turn two times into a compact English label: 10 - 11am, 1:30 - 6:15pm, or 10am - 12pm. The 12-hour clock drops leading zeros and :00 minutes. Equal times at hour:minute collapse to one label, such as 1:30pm; seconds are ignored for display and ordering.

Datetimes normalize to UTC. Returned start and end use RFC 3339 with Z at whole-second precision. Two clock-only inputs use 1970-01-01 UTC; a single clock borrows the dated side’s UTC date. Leap seconds are not supported.

Different UTC dates prefix each side with month and day, without a year: Oct 13, 10pm - Oct 14, 2am. Use dated inputs for overnight ranges; an earlier end is refused. Scoped test keys must allow dates.range. No balance or payment is required.

Parameters

  • Name
    start
    Type
    string · query
    Required
    Required
    Description
    RFC 3339 datetime with an offset, or HH:MM[:SS] in UTC.
  • Name
    end
    Type
    string · query
    Required
    Required
    Description
    Same formats as start. Must not precede start at minute precision.
  • Name
    locale
    Type
    string · query
    Required
    Optional
    Default
    Default "en"
    Description
    English only. Other values return unsupported_locale.
  • Name
    separator
    Type
    string · query
    Required
    Optional
    Default
    Default " - "
    Description
    Literal text between the times. Whitespace and empty strings are preserved.

Make a call

GET
curl --request GET 'https://api.butter.pub/v1/dates/range?start=10%3A00&end=11%3A00&locale=en&separator=%20-%20' \
  --header "Authorization: Bearer $APIBUTTER_TEST_KEY"

Use your test key as $APIBUTTER_TEST_KEY or key. Keep it out of source control.

Or ask your agent

Call dates_range on the authenticated MCP server at https://mcp.butter.pub/mcp.

Tool errors carry the same problem in structured content and JSON text, with isError: true.

tools/call
{
    "name": "dates_range",
    "arguments": {
        "start": "10:00",
        "end": "11:00",
        "locale": "en",
        "separator": " - "
    }
}

Responses

200The concise label and normalized UTC inputs. Nothing is charged. · application/json

  • Name
    object
    Type
    string · always "time_range"
    Required
    Required
  • Name
    text
    Type
    string
    Required
    Required
  • Name
    start
    Type
    string · date-time
    Required
    Required
  • Name
    end
    Type
    string · date-time
    Required
    Required
  • Name
    locale
    Type
    string · always "en"
    Required
    Required
{
    "object": "time_range",
    "text": "10 - 11am",
    "start": "1970-01-01T10:00:00Z",
    "end": "1970-01-01T11:00:00Z",
    "locale": "en"
}
401Missing, invalid, or revoked bearer key.1 example

application/problem+json

unauthorized · application/problem+json
{
    "type": "https://apibutter.com/docs/errors/unauthorized",
    "title": "Unauthorized",
    "status": 401,
    "detail": "A valid, unrevoked bearer API key is required.",
    "code": "unauthorized",
    "param": null,
    "errors": null,
    "request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}
403Live keys are refused during preview; scoped test keys must allow dates.range.2 examples

application/problem+json

{
    "type": "https://apibutter.com/docs/errors/test_keys_only",
    "title": "Forbidden",
    "status": 403,
    "detail": "This operation is free during preview and accepts abk_test_ keys only.",
    "code": "test_keys_only",
    "param": null,
    "errors": null,
    "request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}
422Invalid input. The detail names the parameter to correct.3 examples

application/problem+json

{
    "type": "https://apibutter.com/docs/errors/end_before_start",
    "title": "Unprocessable Content",
    "status": 422,
    "detail": "The end parameter must not precede start at minute precision.",
    "code": "end_before_start",
    "param": "end",
    "errors": {
        "end": [
            "The end parameter must not precede start at minute precision."
        ]
    },
    "request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}

When a call fails

Error codes, statuses and meanings
CodeStatusMeaning
unauthorized401A valid, unrevoked bearer API key is required.
test_keys_only403This operation is free during preview and accepts abk_test_ keys only.
forbidden403The API key does not allow this operation.
end_before_start422The end parameter must not precede start at minute precision.
invalid_parameter422The start parameter must be a valid RFC 3339 datetime or HH:MM[:SS].
unsupported_locale422The locale parameter supports en only.