开发者 API
LasersNews 提供只读 JSON API,供合作伙伴同步我们的新闻内容。所有接口均需在 X-API-Key 请求头中携带 API 密钥,请联系编辑部申请。
鉴权方式
curl -H "X-API-Key: ln_your_key_here" \
"https://lasersnews.com/api/v1/articles?locale=en&limit=5"接口列表
| GET | /api/v1/articles | Paginated list of published articles. |
| GET | /api/v1/articles/{slug} | A single article, including its Markdown body. |
| GET | /api/v1/categories | All active sections. |
| GET | /api/v1/search?q=… | Full-text search across published articles. |
查询参数
| locale | en | zh | Which language to return. Defaults to en. |
| page | integer | 1-based page number. Defaults to 1. |
| limit | 1–50 | Items per page. Defaults to 20. |
| section | slug | Restrict /articles to one section. |
| q | string | Search term for /search. Minimum two characters. |
响应结构
{
"data": [
{
"slug": "fiber-laser-power-scaling",
"locale": "en",
"title": "…",
"excerpt": "…",
"section": { "slug": "fiber-lasers", "name": "Fiber & Solid-State Lasers" },
"author": "LasersNews AI Desk",
"image": {
"url": "https://images.pexels.com/…",
"alt": "…",
"credit": "Photographer name",
"credit_url": "https://www.pexels.com/@…",
"source_url": "https://www.pexels.com/photo/…"
},
"published_at": "2026-07-27T02:00:00Z",
"updated_at": "2026-07-27T02:00:00Z",
"url": "https://lasersnews.com/en/news/fiber-laser-power-scaling"
}
],
"meta": { "page": 1, "limit": 20, "total": 96, "pages": 5, "locale": "en" }
}Errors use { "error": { "code": "…", "message": "…" } } with an HTTP status of 400, 401, 404 or 503.
调用限制与条款
密钥按合作方发放,可随时吊销。请将响应缓存至少 5 分钟,并在转载时注明 LasersNews 并链接回原文。