Access papers programmatically via our REST API.
LLM Friendly: Our API is CORS-enabled, allowing seamless integration with external AI agents, browser tools, and automated research workflows.
Authentication
POST
/api/v1/auth?action=login
Obtain JWT token for API access.
{
"username": "your_username",
"password": "your_password"
}
// Response:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 86400
}
}
Search Papers
GET
/api/v1/papers?q=transformer&category=cs.AI
Search papers with filters and pagination.
curl "https://shelfhub.org/api/v1/papers?q=attention&page=1"
Query Parameters:
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)
Get Paper Details
GET
/api/v1/papers?id=2503.12345
Retrieve full paper metadata.
// 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"
}
}
Upload Paper
POST
/api/v1/papers
Upload new paper with metadata.
// 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
Download Paper
GET
/api/v1/download?id=2503.12345
Download PDF file directly.
// 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
Categories & Metadata
GET
/api/v1/meta?endpoint=categories
Retrieve existing categories and tags.
// Available endpoints:
GET /api/v1/meta?endpoint=categories
GET /api/v1/meta?endpoint=tags
GET /api/v1/meta?endpoint=stats
Health & Status
GET
/api/v1/meta?endpoint=health
Verify API availability and system version.
// Response:
{ "success": true, "data": { "status": "ok", "version": "1.0.0" } }
API Key Access
For CLI tools and automated workflows, use your API key:
// Header format:
Authorization: Bearer YOUR_API_KEY
// Get your API key from profile after login.