Git-based Viral Taxonomy Management System
The ICTV-git REST API provides comprehensive programmatic access to 20 years of viral taxonomy history with 30+ endpoints across four main modules:
# Start the API server
python scripts/run_api_server.py --dev
# API available at
http://localhost:8000
# Interactive documentation
http://localhost:8000/docs
Currently, the API does not require authentication for read operations. This may change in future versions.
All API endpoints are relative to:
http://localhost:8000
Core endpoints for accessing taxonomic data.
GET /taxonomy/species/{scientific_name}
Example:
curl http://localhost:8000/taxonomy/species/Tobacco%20Mosaic%20Virus
Response:
{
"scientific_name": "Tobacco Mosaic Virus",
"taxonomy": {
"family": "Virgaviridae",
"genus": "Tobamovirus"
},
"classification": {
"msl_version": "MSL40",
"msl_year": 2024
}
}
GET /taxonomy/family/{family_name}
Returns complete family hierarchy including all genera and species.
GET /taxonomy/families
GET /taxonomy/hierarchy
Returns complete taxonomy tree structure with statistics.
POST /taxonomy/validate
Request Body:
{
"scientific_name": "Test Virus",
"taxonomy": {
"family": "Virgaviridae",
"genus": "Tobamovirus"
}
}
Track taxonomic changes across 20 years (2005-2024).
GET /historical/releases
Returns all 18 MSL releases with metadata.
GET /historical/releases/{msl_version}
Example:
curl http://localhost:8000/historical/releases/MSL40
GET /historical/compare/{from_version}/{to_version}
Example:
curl http://localhost:8000/historical/compare/MSL35/MSL40
Shows detailed comparison including added, deleted, and modified files.
GET /historical/species/{scientific_name}/history
Track a species across all releases.
GET /historical/family/{family_name}/evolution
Monitor family changes over time.
GET /historical/caudovirales-dissolution
Detailed information about the historic 2019 reorganization.
GET /historical/timeline
High-level 20-year overview with major milestones.
AI-powered features for advanced analysis.
POST /ai/query
Request Body:
{
"query": "What happened to Caudovirales in 2019?",
"use_cache": true
}
Example:
curl -X POST http://localhost:8000/ai/query \
-H "Content-Type: application/json" \
-d '{"query": "How many families exist?"}'
POST /ai/classify
Request Body:
{
"organism_name": "Novel RNA Virus",
"metadata": {
"genome_type": "RNA",
"genome_size": "12kb",
"host": "plants"
}
}
GET /ai/stability/{family_name}
Get stability analysis based on historical changes.
GET /ai/features
GET /ai/health
GET /ai/examples
Advanced search capabilities with faceted filtering.
POST /search/species
Request Body:
{
"query": "coronavirus",
"family_filter": "Coronaviridae",
"genus_filter": null,
"exact_match": false,
"limit": 100
}
GET /search/facets
Returns available filters with counts.
POST /search/faceted
Request Body:
{
"family": "virgaviridae",
"msl_version": "MSL40"
}
GET /search/family/{family_name}/summary
Comprehensive family statistics and species list.
POST /search/advanced
Request Body:
{
"query": "tobacco",
"filters": {
"family": "virgaviridae",
"era": "AI Era"
},
"sort_by": "alphabetical",
"limit": 50
}
GET /search/statistics
All responses are in JSON format. Successful responses have HTTP status 200.
{
"error": "Error message",
"detail": "Detailed error information",
"type": "ErrorType"
}
Status Codes:
200
: Success404
: Resource not found422
: Validation error500
: Internal server errorimport requests
import json
# Base URL
BASE_URL = "http://localhost:8000"
# Natural language query
response = requests.post(
f"{BASE_URL}/ai/query",
json={"query": "How has Coronaviridae changed since COVID?"}
)
print(response.json()['response'])
# Search species
response = requests.post(
f"{BASE_URL}/search/species",
json={
"query": "coronavirus",
"family_filter": "Coronaviridae",
"limit": 10
}
)
results = response.json()
print(f"Found {results['total_matches']} species")
# Compare releases
response = requests.get(f"{BASE_URL}/historical/compare/MSL35/MSL40")
comparison = response.json()
print(f"Total changes: {comparison['changes']['total_changes']}")
# Get family evolution
response = requests.get(f"{BASE_URL}/historical/family/siphoviridae/evolution")
evolution = response.json()
for event in evolution['major_events']:
print(f"{event['msl_version']}: {event['description']}")
// Using fetch API
const BASE_URL = 'http://localhost:8000';
// Natural language query
async function askQuestion(query) {
const response = await fetch(`${BASE_URL}/ai/query`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ query, use_cache: true }),
});
const data = await response.json();
return data.response;
}
// Search species
async function searchSpecies(query, family = null) {
const response = await fetch(`${BASE_URL}/search/species`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query,
family_filter: family,
limit: 100,
}),
});
return response.json();
}
// Usage
(async () => {
const answer = await askQuestion('What is the largest viral family?');
console.log(answer);
const results = await searchSpecies('virus', 'Coronaviridae');
console.log(`Found ${results.total_matches} species`);
})();
Currently, there are no rate limits. For production deployment, we recommend: