Truy cập các bài báo thông qua REST API của chúng tôi.
Thân thiện với LLM: API của chúng tôi đã bật CORS, cho phép tích hợp liền mạch với các đại lý AI bên ngoài, công cụ trình duyệt và quy trình nghiên cứu tự động.
Xác thực
POST
/api/v1/auth?action=login
Nhận mã thông báo JWT để truy cập API.
{
"username": "your_username",
"password": "your_password"
}
// Response:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 86400
}
}
Tìm kiếm bài báo
GET
/api/v1/papers?q=transformer&category=cs.AI
Tìm kiếm bài báo với bộ lọc và phân trang.
curl "https://shelfhub.org/api/v1/papers?q=attention&page=1"
Tham số truy vấn:
query
category - Filter by category (e.g., cs.AI)
tag - Filter by tag
author - Author name
page - Page number (default: 1)
per_page - Results per page (max: 100)
Lấy chi tiết bài báo
GET
/api/v1/papers?id=2503.12345
Lấy siêu dữ liệu đầy đủ của bài báo.
// Response:
{
"success": true,
"data": {
"paper_id": "2503.12345",
"title": "Paper Title",
"abstract": "Abstract text...",
"authors": [{"name": "Author Name"}],
"categories": [{"code": "cs.AI", "name": "AI"}],
"tags": ["llm", "transformer"],
"download_url": "/api/v1/download?id=2503.12345"
}
}
Tải lên bài báo
POST
/api/v1/papers
Tải lên bài báo mới với siêu dữ liệu.
// Headers:
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: multipart/form-data
// Form Fields:
title - Paper title (required)
abstract - Abstract text
authors - JSON array: [{"name": "..."}]
categories - JSON array: ["cs.AI", "cs.LG"]
tags - JSON array: ["llm", "attention"]
pdf - PDF file
Tải bài báo
GET
/api/v1/download?id=2503.12345
Tải trực tiếp tệp PDF.
// CLI download:
curl -L -o paper.pdf \
"https://shelfhub.org/api/v1/download?id=2503.12345"
// Or use the CLI tool:
php preprint-cli.php download 2503.12345
Danh mục & Siêu dữ liệu
GET
/api/v1/meta?endpoint=categories
Lấy các danh mục và thẻ hiện có.
// Available endpoints:
GET /api/v1/meta?endpoint=categories
GET /api/v1/meta?endpoint=tags
GET /api/v1/meta?endpoint=stats
Trạng thái hệ thống
GET
/api/v1/meta?endpoint=health
Kiểm tra tính sẵn sàng của API và phiên bản hệ thống.
// Response:
{ "success": true, "data": { "status": "ok", "version": "1.0.0" } }
Truy cập bằng Khóa API
Đối với các công cụ CLI và quy trình tự động, hãy sử dụng khóa API của bạn:
// Header format:
Authorization: Bearer YOUR_API_KEY
// Get your API key from profile after login.