API Documentation
RESTful API for AI-Horizon Ed Platform
About the API: Our RESTful API provides access to emerging AI skills and educational resources.
All endpoints return JSON data and support standard HTTP methods.
Available Endpoints
Skills Endpoints
GET
Try it
/api/skills
Get all active emerging skills
Response: Array of skill objects with id, skill_name, description, category, urgency_score, etc.
GET
Try it
/api/skills/{skill_id}/resources
Get all educational resources for a specific skill
Response: Array of resource objects with learning path informationResources Endpoints
GET
Try it
/api/resources/{resource_id}
Get detailed information about a specific educational resource
Response: Resource object with full details including AI analysisAdmin Endpoints Authentication Required
POST
Admin Only
/api/admin/ai/discover-skills
Discover new emerging skills using AI
Body: {"domain": "AI and Cybersecurity"}Response: Discovery results with new skills found
POST
Admin Only
/api/admin/ai/discover-resources/{skill_id}
Discover educational resources for a specific skill using AI
Response: Discovery results with new resources found
GET
Admin Only
/api/admin/ai/status
Check AI services availability status
Response: {"ai_services_available": true/false}Response Format
Skills Object Structure
{
"id": 1,
"skill_name": "AI Security Engineering",
"description": "Specialized engineering role for securing AI systems",
"category": "AI/ML",
"urgency_score": 8.5,
"market_demand_evidence": "High demand evidence...",
"created_date": "2025-01-01T00:00:00",
"last_updated": "2025-01-01T00:00:00",
"status": "active",
"source": "ai_horizon_discovery"
}
Resource Object Structure
{
"id": 1,
"title": "AI Security Fundamentals Course",
"description": "Comprehensive course covering AI security basics",
"url": "https://example.com/course",
"resource_type": "course",
"difficulty_level": "intermediate",
"estimated_duration_minutes": 120,
"quality_score": 4.5,
"ai_analysis_summary": "High-quality content with practical examples",
"created_date": "2025-01-01T00:00:00",
"status": "approved"
}
Usage Examples
JavaScript/Fetch API
// Get all skills
fetch('/api/skills')
.then(response => response.json())
.then(skills => console.log(skills));
// Get resources for a specific skill
fetch('/api/skills/1/resources')
.then(response => response.json())
.then(resources => console.log(resources));
Python/Requests
import requests
# Get all skills
response = requests.get('https://ed.theaihorizon.org/api/skills')
skills = response.json()
# Get specific resource
response = requests.get('https://ed.theaihorizon.org/api/resources/1')
resource = response.json()
cURL
# Get all skills
curl -X GET https://ed.theaihorizon.org/api/skills
# Get resources for skill ID 1
curl -X GET https://ed.theaihorizon.org/api/skills/1/resources
Rate Limiting & Authentication
Rate Limits
- Public endpoints: 100 requests/minute
- No authentication required for read endpoints
- Admin endpoints require session authentication
Response Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=300
HTTP Status Codes
Success Codes
- 200OK - Request successful
- 201Created - Resource created successfully
Error Codes
- 400Bad Request - Invalid request format
- 401Unauthorized - Authentication required
- 404Not Found - Resource not found
- 500Internal Server Error - Server error