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 hỗ trợ CORS, cho phép các tác nhân AI (AI agent) bên ngoài, công cụ trình duyệt và quy trình nghiên cứu tự động gọi trực tiếp.
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
// Retry the same PDF after a timeout: if it is already yours,
// the response is success with idempotent=true and the existing paper_id.
PUT /api/v1/papers (JSON metadata, or multipart with optional pdf)
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
Dự án (TeX và YAML)
POST
/api/v1/projects?action=tex-push
Không gian chờ trước khi công bố dành cho tác nhân: chỉ lưu trữ bản .tex UTF-8 (so sánh khác biệt, SHA-256) và ngữ cảnh YAML giữa các phiên. Không nhận hình ảnh hoặc PDF. Hãy tự biên dịch PDF trên máy và công bố qua /api/v1/papers. Hãy dùng mã token dự án (shp_…) thay vì khóa API tài khoản; tác nhân nên bắt đầu từ GET /skill.
Authorization: Bearer shp_… // project token (preferred)
// or account API key / JWT
GET /api/v1/projects?action=agent-context&project_key=PAPER-2026-001
GET /api/v1/projects?action=tex-list&project_key=PAPER-2026-001
GET /api/v1/projects?action=tex-get&project_key=PAPER-2026-001&path=main.tex
GET /api/v1/projects?action=tex-diff&project_key=PAPER-2026-001&path=main.tex&from=1&to=2
POST /api/v1/projects?action=tex-push
{
"project_key": "PAPER-2026-001",
"path": "main.tex",
"content": "\\documentclass{article}...",
"message": "what changed"
}
POST /api/v1/projects?action=yaml-update
GET /api/v1/projects?action=yaml-get&project_key=PAPER-2026-001
GET /skill
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.