fittings-time-sunrise-sunset

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sunrise, sunset and solar noon

日出、日落与太阳正午

time.sunrise-sunset
on
https://fittings.sh
. One endpoint, deterministic compute.
UTC sunrise, sunset, solar noon and day length for a date and coordinate, including polar day/night.
time.sunrise-sunset
部署于
https://fittings.sh
,是一个确定性计算的单一接口。
根据指定日期和坐标获取UTC日出、日落、太阳正午时间以及白昼时长,包括极昼/极夜情况。

The call

调用方式

GET https://fittings.sh/v1/time/sunrise-sunset
FieldTypeRequiredNotes
date
stringyesISO date YYYY-MM-DD
lat
numberyes
lon
numberyes
Example input:
json
{
  "date": "2026-06-21",
  "lat": 51.4779,
  "lon": -0.0015
}
GET https://fittings.sh/v1/time/sunrise-sunset
FieldTypeRequiredNotes
date
stringyesISO日期格式 YYYY-MM-DD
lat
numberyes
lon
numberyes
示例输入:
json
{
  "date": "2026-06-21",
  "lat": 51.4779,
  "lon": -0.0015
}

Cost and provenance

费用与来源

Price$0.003
Sourcenone (pure compute)
Licencenone-needed
Price$0.003
Source无(纯计算)
Licence无需授权

Why call it rather than answer from memory

为何调用该接口而非凭记忆获取结果

An energy, imaging or scheduling agent needs daylight bounds at a location before it can plan solar yield, a shoot, or a delivery window.
能源、影像拍摄或调度类Agent在规划太阳能产量、拍摄任务或配送窗口前,需要了解指定地点的日光时段。

Calling it

调用指南

A skill is loaded on its own, so this document has to be enough by itself. It does not assume the general
fittings
skill is also loaded.
call.mjs
ships alongside this file; if it is missing (this document reached you without the rest of the skill), fetch it once with
curl -sO https://fittings.sh/skill/call.mjs
.
Free, and needs no wallet. Read the schema and see what a call would cost:
bash
curl -s https://fittings.sh/catalog/time.sunrise-sunset | jq
Paying. The endpoint answers
402 Payment Required
with a signed quote, you sign an authorization, and a facilitator settles it — you never send a transaction and never pay gas. Before it spends anything, the client checks its own hash against the gateway and refuses rather than sign with logic the gateway has moved past:
bash
undefined
该Skill可独立加载,因此本文档本身已包含全部所需信息,无需依赖通用的
fittings
Skill。
call.mjs
文件与本文档一同分发;若缺失(即您仅收到本文档而未获得Skill的其余部分),可通过
curl -sO https://fittings.sh/skill/call.mjs
命令一次性获取该文件。
免费,无需钱包。查看接口schema并了解调用成本:
bash
curl -s https://fittings.sh/catalog/time.sunrise-sunset | jq
付费调用。该端点会返回
402 Payment Required
状态码及签名报价,您需签署授权信息,由服务商完成结算——您无需发送交易,也无需支付Gas费。在产生任何费用前,客户端会将自身哈希值与网关进行比对,若网关逻辑已更新则会拒绝签署:
bash
undefined

Dry run. Prints the quote and pays nothing, because no key is set.

试运行。仅打印报价,不产生费用,因为未设置密钥。

node call.mjs time.sunrise-sunset date=2026-06-21 lat=51.4779 lon=-0.0015
node call.mjs time.sunrise-sunset date=2026-06-21 lat=51.4779 lon=-0.0015

For real: a wallet holding USDC on Base, and nothing else.

正式调用:需使用持有Base链USDC的钱包,无需其他资产。

export FITTINGS_PRIVATE_KEY=0x... node call.mjs time.sunrise-sunset date=2026-06-21 lat=51.4779 lon=-0.0015

Spending is never a side effect of curiosity: with no `FITTINGS_PRIVATE_KEY`
the client fetches the quote and stops. `FITTINGS_MAX_PRICE` caps what it will
pay without asking, and defaults to $0.05.

**Use a throwaway wallet holding a few dollars, not a main one.** The key sits
in plaintext wherever the agent runs, and the whole cost of entry is USDC on
Base — no account, no API key, and no ETH, because the payer signs off-chain and
the facilitator broadcasts and pays the gas.

Writing your own client instead of using this one? `@x402/core` and
`@x402/evm` on npm, and the `fittings` skill records the two things that cost
real debugging time: the challenge is in a response header rather than the body,
and it must be re-signed from the exact request being retried.

If this is not the right service, `https://fittings.sh/catalog/search?q=...`
searches all of them for free.
export FITTINGS_PRIVATE_KEY=0x... node call.mjs time.sunrise-sunset date=2026-06-21 lat=51.4779 lon=-0.0015

仅出于好奇测试不会产生费用:未设置`FITTINGS_PRIVATE_KEY`时,客户端仅获取报价即停止操作。`FITTINGS_MAX_PRICE`用于设置无需确认即可支付的最高费用,默认值为0.05美元。

**请使用仅持有少量资金的临时钱包,而非主钱包**。密钥以明文形式存储在Agent运行的环境中,唯一的准入成本是Base链上的USDC——无需账户、无需API密钥,也无需ETH,因为付款方进行链下签名,由服务商负责广播交易并支付Gas费。

不想使用该客户端,希望自行编写?可使用npm上的`@x402/core`和`@x402/evm`包,`fittings` Skill记录了两个耗时调试的关键点:挑战信息位于响应头而非响应体中,且必须针对重试的精确请求重新签名。

若该服务不符合需求,可通过`https://fittings.sh/catalog/search?q=...`免费搜索所有可用服务。