其他

LectServe

LectServe是一个专门提供新教礼拜日历的免费API。它返回指定日期的经文阅读安排,帮助教会和信徒规划礼拜活动。该API支持多种历法格式和自定义查询。

查看官方文档 ↗

接入教程

1. 访问LectServe官网查看API文档
2. 注册获取API密钥(如需)
3. 使用日期参数调用API端点
4. 解析返回的JSON格式礼拜日历数据
5. 将数据集成到您的应用或网站中

使用Python查询指定日期的礼拜日历

python
import requests

url = 'https://api.lectserve.com/v1/readings'
params = {
    'date': '2023-12-25',
    'calendar': 'lectionary-a',
    'language': 'zh'
}
headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Accept': 'application/json'
}

response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
    data = response.json()
    print(f"经文: {data.get('readings', [])}")
else:
    print(f"请求失败: {response.status_code}")
    print(response.text)

使用PHP获取当前礼拜周期的经文安排

php
<?php

$url = 'https://api.lectserve.com/v1/readings/today';
$options = [
    'http' => [
        'method' => 'GET',
        'header' => "Authorization: Bearer YOUR_API_KEY\r\n" .
                   "Accept: application/json\r\n"
    ]
];

$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);

if ($response !== false) {
    $data = json_decode($response, true);
    echo "日期: " . $data['date'] . "\n";
    echo "经文: " . implode(', ', $data['readings']) . "\n";
} else {
    echo "请求失败\n";
}

?>

使用JavaScript在网页中显示今日经文

javascript
async function fetchTodaysReadings() {
    const url = 'https://api.lectserve.com/v1/readings/today';
    const options = {
        method: 'GET',
        headers: {
            'Authorization': 'Bearer YOUR_API_KEY',
            'Accept': 'application/json'
        }
    };

    try {
        const response = await fetch(url, options);
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        const data = await response.json();
        
        document.getElementById('date').textContent = data.date;
        document.getElementById('readings').innerHTML = 
            data.readings.map(r => `<li>${r}</li>`).join('');
    } catch (error) {
        console.error('获取数据失败:', error);
        document.getElementById('readings').textContent = '加载失败,请稍后重试。';
    }
}

// 页面加载后调用
window.addEventListener('DOMContentLoaded', fetchTodaysReadings);

常见问题

LectServe API是免费的吗?

是的,LectServe是一个完全免费的API服务,为教会和信徒提供新教礼拜日历数据。无需付费订阅,只需注册获取API密钥即可使用。

API返回的数据包含哪些内容?

API返回指定日期的完整礼拜安排,包括经文阅读(旧约、诗篇、新约书信、福音书)、节日名称、礼拜周期(如将临期、复活期)以及可选的自定义注释。

支持哪些日期格式和查询参数?

API支持ISO 8601标准日期格式(YYYY-MM-DD),并可查询特定年份的完整礼拜日历。主要参数包括:date(日期)、calendar(历法类型,如lectionary-a)、language(返回语言,支持zh、en等)。

相似接口推荐

AWS SSO Identity Store

AWS SSO Identity Store是AWS IAM Identity Center(原AWS单点登录)使用的身份存储服务,提供一个统一的位置检索所有身份信息(用户和群组)。该服务简化了身份管理流程,帮助集中管理

待确认
Amazon Honeycode

Amazon Honeycode是一项全托管服务,让您无需编程即可快速为团队构建移动和Web应用。可用于管理项目、客户、运营、审批、资源乃至团队协作等各类事务。

待确认
AWS Glue

AWS Glue 是一项完全托管的提取、转换和加载(ETL)服务,可简化数据准备和集成工作。它自动发现、编目数据,并支持在数据湖和数据仓库之间进行ETL操作。

待确认
亚马逊Glacier

亚马逊S3 Glacier(简称Glacier)是一款针对“冷数据”的存储解决方案。这项超低成本的存储服务为数据备份和归档提供安全、持久且易于使用的存储方案。用户可经济高效地存储数据数月、数年甚至数十年。

待确认