金融与汇率

The Calendar

该API提供美国各州及30个国家的公共假日数据,以及体育和金融日历,以静态JSON格式返回。

查看官方文档 ↗

接入教程

1. 访问The Calendar官网注册获取API密钥。
2. 选择所需日历端点(如节假日、体育赛事)。
3. 使用HTTP GET请求调用API,传入参数如国家代码。
4. 解析返回的JSON数据并集成到您的应用中。

获取美国假日列表

python
import requests

url = "https://api.the-calendar.net/v1/holidays"
params = {
    "country": "US",
    "year": 2024,
    "api_key": "YOUR_API_KEY"
}
response = requests.get(url, params=params)
data = response.json()
print(data)

查询体育赛事日历

php
<?php
$url = 'https://api.the-calendar.net/v1/calendars/sports';
$params = [
    'sport' => 'nba',
    'date' => '2024-05-20',
    'api_key' => 'YOUR_API_KEY'
];
$ch = curl_init($url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
?>

获取金融日历数据

javascript
const url = new URL('https://api.the-calendar.net/v1/calendars/financial');
url.searchParams.append('region', 'US');
url.searchParams.append('start_date', '2024-06-01');
url.searchParams.append('end_date', '2024-06-07');
url.searchParams.append('api_key', 'YOUR_API_KEY');

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

常见问题

如何获取API密钥?

请访问 https://the-calendar.net/api/ 并注册免费账户以获取您的API密钥。

API有调用频率限制吗?

是的,免费套餐每分钟最多100次请求,每月最多10,000次请求。如需更高限制,请查看付费计划。

数据更新频率如何?

公共假日数据每年更新一次。体育和金融日历数据每日更新,确保信息的时效性。

相似接口推荐

AWS Import/Export

AWS Import/Export服务通过邮寄物理存储设备的方式,在AWS云和用户本地环境间高效传输海量数据。该服务利用亚马逊高速内部网络直接读写存储设备,适用于大规模数据迁移场景。

待确认
AWS Greengrass

AWS IoT Greengrass可将AWS功能无缝扩展至物理设备,使设备能够本地处理生成的数据,同时仍利用云端进行管理、分析和持久存储。该服务确保设备能够快速响应本地事件,并在间歇性连接下稳定运行。

待确认
Amazon ElastiCache

Amazon ElastiCache是一项Web服务,可简化云端分布式缓存的设置、操作和扩展。它让客户能够获得高性能内存缓存的所有优势,同时减少管理负担。

待确认
Amazon Elastic Inference

Elastic Inference是AWS提供的弹性推理服务公共API。自2023年4月15日起,AWS不再接受新客户使用该服务,并协助现有客户迁移至性价比更优的替代方案。该API用于管理云端AI推理的加速计算资源。

待确认