S

Schedule & Timezone Tools · Intervals Merge

by Schedule & Timezone Tools

POSTBaseArbitrumPolygon

$0.005

per call · USD Coin on Base

Time interval merger — sort, deduplicate, and combine overlapping or adjacent RFC 3339 date-time ranges.

Endpoint

POST https://schedule-tools.use.x402atlas.com/intervals-merge

2

Calls / 30d

1

Unique payers / 30d

Sep 1

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://schedule-tools.use.x402atlas.com/intervals-merge", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "intervals": [
      {
        "end": "2024-06-03T10:30:00Z",
        "start": "2024-06-03T09:00:00Z"
      },
      {
        "end": "2024-06-03T11:00:00Z",
        "start": "2024-06-03T10:00:00Z"
      },
      {
        "end": "2024-06-03T12:00:00Z",
        "start": "2024-06-03T11:00:00Z"
      }
    ],
    "merge_adjacent": true
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://schedule-tools.use.x402atlas.com/intervals-merge" \
  -H "Content-Type: application/json" \
  -d '{"intervals":[{"end":"2024-06-03T10:30:00Z","start":"2024-06-03T09:00:00Z"},{"end":"2024-06-03T11:00:00Z","start":"2024-06-03T10:00:00Z"},{"end":"2024-06-03T12:00:00Z","start":"2024-06-03T11:00:00Z"}],"merge_adjacent":true}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "algorithm_version": "schedule-v1",
  "input_count": 3,
  "intervals": [
    {
      "end": "2024-06-03T12:00:00Z",
      "start": "2024-06-03T09:00:00Z"
    }
  ],
  "merge_adjacent": true,
  "operation": "intervals-merge",
  "output_count": 1,
  "total_covered_seconds": 10800,
  "warnings": []
}

Payment details

Pay to0x8c128f1ee62bb5e47867cfbae2ad89be325df1b2
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Arbitrum, Polygon
Schemesexact

Is this your API?

Pin it to the top of Developer Tools and the homepage with a featured placement.

Get featured →

More from Schedule & Timezone Tools & similar services