Skip to main content

🧪 Science Olympiad API Documentation

Comprehensive REST API for Science Olympiad question management, AI-powered features, collaborative testing, and content moderation

For developers. Check your API usage.

Base URL: https://www.scio.ly
API Version: 1.0.0
Content-Type: application/json
Authentication: Scoped keys for external question and answer access
Rate Limiting: Per-key quotas and endpoint limits apply
CORS: Use keys from trusted server-side clients

🔄 Recent API Updates

Simplified Explanations API: The AI explanations endpoint has been streamlined to use simple JSON request/response patterns. Streaming functionality has been removed for improved reliability and easier integration. See the AI-Powered Features section for details.

📋 Table of Contents

Overview

Response Format

All endpoints return JSON responses with consistent structure:

Standard Response Schema

{
  "success": boolean,
  "data": any,
  "message": string,
  "error": string
}

Success Response Example

{
  "success": true,
  "data": { ... },
  "message": "Operation completed successfully"
}

Error Response Example

{
  "success": false,
  "error": "Invalid request parameters"
}

Data Types

Question Object

{
  "id": "uuid",
  "question": "string",
  "tournament": "string",
  "division": "string",
  "event": "string",
  "options": ["string"],
  "answers": ["string" | "number"],
  "subtopics": ["string"],
  "difficulty": number,
  "imageData": "string",
  "created_at": "ISO8601",
  "updated_at": "ISO8601",
  "base52": "string"
}

ID Question Object

{
  "id": "uuid",
  "question": "string",
  "tournament": "string",
  "division": "string",
  "event": "string",
  "options": ["string"],
  "answers": ["string" | "number"],
  "subtopics": ["string"],
  "difficulty": number,
  "images": ["string"],
  "created_at": "ISO8601",
  "updated_at": "ISO8601"
}

Authentication and developer access

Request a developer key from team.scio.ly@gmail.com. Include your organization and intended use. Each key has its own permissions, request limits, and expiration date. Keys are issued by the Scio.ly team; there is no public self-service registration.

Developer keys work with GET /api/questions, GET /api/id-questions, and GET /api/developer/usage. The questions:read permission retrieves questions. The separate answers:read permission includes answer keys automatically; include_answers=1 is not needed. A question-only key receives sealed answers, just like anonymous practice.

Send the key in a header

Retrieve Division B questions and answers

curl --get 'https://www.scio.ly/api/questions' \
  -H "X-API-Key: $SCIOLY_API_KEY" \
  --data-urlencode 'event=Meteorology' \
  --data-urlencode 'division=B' \
  --data-urlencode 'limit=10'

Alternatively use Authorization: Bearer YOUR_KEY. Send only one credential. URL query keys (api_key=...) are rejected. Keep keys on a trusted computer or server; do not embed them in public websites, repositories, shared notebooks, or browser applications.

Anonymous question reads and metadata endpoints remain available without a key. Anonymous question responses omit answer keys. Developer keys grant no editing, deletion, account, AI, or private tournament access. Administrative endpoints require separate site-admin credentials.

Usage and limits

Visit the API usage page to see your limits, this month’s requests, and daily request, question, and error totals for the last 30 days. Usage lookups do not consume the question-request allowance. The page does not save your key in browser storage.

Default limits are 60 requests per minute and 1,000 requests per calendar month, unless arranged otherwise. Every admitted question or team request counts once, including empty responses and errors; invalid credentials and over-quota requests do not count. Repeated questions count again in the question totals. Windows and reports use UTC. Approved developer keys use their configured per-key limits; invalid credentials are throttled per IP.

Responses include X-RateLimit-Limit, X-MonthlyLimit-Limit, and X-MonthlyLimit-Remaining. A quota rejection returns HTTP 429 with Retry-After in seconds. Wait before retrying. Invalid, expired, or revoked keys return 401; missing permission returns 403. A temporary access or usage-store outage returns 503. Keyed responses use Cache-Control: private, no-store.

Read usage programmatically

curl 'https://www.scio.ly/api/developer/usage' \
  -H "X-API-Key: $SCIOLY_API_KEY"

Filters and answer formats

Use /api/meta/events and /api/meta/subtopics?event=EVENT_NAME to discover the bank’s labels. Pass exact labels with event, subtopic or comma-separated subtopics, and division=B. Subtopic coverage varies; event names and labels do not guarantee alignment with a particular competition season. Review questions against that season’s official rules.

Responses use {"success":true,"data":[...]}. For multiple-choice questions, numeric entries in answers are zero-based indices into options. Free-response answers may be strings. Check answer formats and source context before preparing student materials.

Permitted use and corrections

Approved keys may be used for the non-commercial educational practice described in the access request, including team handouts. Credit Scio.ly and retain supplied source and image attribution. Do not redistribute keys, republish or resell the bank, bypass limits, or use API calls to earn practice rewards or affect rankings. Source materials may carry their own attribution and license requirements. Contact us before other uses.

Report question or answer errors to team.scio.ly@gmail.com with the question’s id, event, proposed correction, and supporting source. The site’s question-report button is also available during practice. If a key is exposed, contact us immediately for revocation and replacement.

Team access

Team access is granted separately to specific teams after authorization. Existing keys have no team access by default. Requests use the same header and per-key quotas as question requests.

GET /api/developer/teams lists your allowed active teams. GET /api/developer/teams/{teamId}/progress?days=30 returns active members and their individual practice and assignment summaries, plus team totals. Days may be 7, 30 (default), or 90; assignment summaries cover all team assignments.

Pending and removed members are excluded. Names, usernames, roles, practice activity and assignment summaries are included; email addresses, invitation codes and individual answers are not. A team outside your grant returns 404. Treat these records as private and keep the key on a trusted server.

Question Retrieval

Developer keys support the GET question endpoints below. Answer access requires the answers:read scope. Write endpoints require site-admin credentials and cannot be authorized with a developer key.

Metadata & Statistics

Sharing & Codes

Quotes Management

🧠 Using the Explanations API

Basic Usage

The explanations API is designed for simple integration. Here's how to use it in your frontend application:

React Hook Example

Here's how to create a custom React hook for managing explanations:

Error Handling

The API returns structured error responses that you should handle appropriately:

Best Practices

  • • Rate Limiting: Implement client-side rate limiting to respect the 2-second delay between requests
  • • Loading States: Show loading indicators while waiting for explanations
  • • Error Handling: Display user-friendly error messages for different error types
  • • Caching: Consider caching explanations to avoid repeated requests for the same question
  • • Progressive Enhancement: Ensure your app works without explanations if the API is unavailable
  • • Accessibility: Provide alternative text for users who can't access explanations

Rate Limiting Implementation

Here's how to implement client-side rate limiting:

📚 Question Management APIs

Fetching Questions

Use the /api/questions endpoint to retrieve filtered questions. Keep the API key in a trusted server or local script; never bundle it in a public browser app:

React Hook for Questions

Browser example for anonymous questions only (answers remain sealed). Use your own authenticated server for keyed access; do not put a developer key in React code:

System Endpoints

Error Codes

• 400 - Bad Request (invalid parameters)
• 404 - Not Found (resource doesn't exist)
• 429 - Too Many Requests (rate limit exceeded)
• 500 - Internal Server Error
• 503 - Service Unavailable (service temporarily unavailable)

Best Practices

• Implement exponential backoff for rate-limited endpoints
• Cache metadata endpoints (events, tournaments, subtopics)
• Use appropriate limits to avoid overwhelming the system
• Handle errors gracefully with user-friendly messages
• Validate input data before sending requests