SRM PYQ API
Access Previous Year Question Papers
A comprehensive read-only REST API for accessing SRM university previous year question papers and exam materials. No authentication required. Built for developers creating study apps, exam preparation tools, and educational platforms that need programmatic access to SRM course papers and question paper data.
Quick Start with Vibe Coding Reference
Download the VIBE_CODING_REFERENCE.md file and drop it into your project. It contains everything you need — endpoint specs, response schemas, and integration patterns — ready for AI-assisted coding tools or manual implementation.
Base URL
https://srm-pyq-api.onrender.com
Data Models
Core entities returned by the SRM PYQ API. Each response follows a consistent JSON schema wrapped in a data key, making it straightforward to integrate SRM exam paper data into your applications.
Course — SRM Course Catalog Entry
{
"id": "uuid",
"course_code": "string",
"course_name": "string",
"department": "string|null",
"program": "string|null",
"semester": "number|null",
"is_active": true
}Paper — Exam Question Paper Record
{
"id": "uuid",
"course_id": "uuid",
"title": "string",
"exam_year": "number|null",
"exam_month": "number|null",
"exam_term": "string|null",
"session_label": "string|null",
"source_subject_url": "string|null",
"source_item_url": "string",
"publisher": "string|null",
"created_at": "iso-datetime"
}File — Question Paper PDF Metadata
{
"id": "uuid",
"paper_id": "uuid",
"storage_provider": "r2",
"bucket": "string",
"object_key": "string",
"source_pdf_url": "string|null",
"public_url": "string|null",
"mime_type": "application/pdf",
"size_bytes": "number|null",
"sha256": "string|null",
"is_primary": true,
"created_at": "iso-datetime"
}Download Response — Signed PDF Access URL
{
"data": {
"file_id": "uuid",
"download_url": "https://...",
"url_type": "signed|public",
"expires_in": 900
}
}API Endpoints
Complete reference for every SRM PYQ API endpoint with live request testing. Each endpoint includes runnable code examples in Python, cURL, JavaScript, Go, PHP, and Ruby — plus an interactive playground to test queries against the production API in real time.
/healthHealth check endpoint for verifying the SRM PYQ API is running and responsive.
Path Parameters
None
Query Parameters
None
Code Example
import requests
BASE_URL = "https://srm-pyq-api.onrender.com"
response = requests.get(f"{BASE_URL}/health", timeout=15)
response.raise_for_status()
print(response.json())Response Schema
{
"ok": true
}Live Playground
https://srm-pyq-api.onrender.com/health
Ready to execute
Click Run Request to see a live response from the production API.
/v1/coursesBrowse and search the SRM course catalog with cursor-based pagination. Filter courses by code or name to find the right exam papers.
Path Parameters
None
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | no | Search against course_code and course_name. |
| cursor | string | no | Last seen course_code for pagination. |
| limit | int (1-200) | no | Page size, defaults to 50. |
Code Example
import requests
BASE_URL = "https://srm-pyq-api.onrender.com"
params = {"q": "spring", "limit": 5}
response = requests.get(f"{BASE_URL}/v1/courses", params=params, timeout=15)
response.raise_for_status()
payload = response.json()
print(payload["data"])
print(payload["page"])Response Schema
{
"data": [
{
"id": "uuid",
"course_code": "string",
"course_name": "string",
"department": "string|null",
"program": "string|null",
"semester": "number|null",
"is_active": true
}
],
"page": {
"has_more": true,
"next_cursor": "string|null",
"limit": 50
}
}Live Playground
https://srm-pyq-api.onrender.com/v1/courses?limit=3
Ready to execute
Click Run Request to see a live response from the production API.
/v1/courses/{course_code}Retrieve full details for a specific SRM course including department, program, and semester information.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| course_code | string | yes | Use URL-encoding for special characters. |
Query Parameters
None
Code Example
from urllib.parse import quote
import requests
BASE_URL = "https://srm-pyq-api.onrender.com"
course_code = ",20PCSE85J"
encoded = quote(course_code, safe="")
response = requests.get(f"{BASE_URL}/v1/courses/{encoded}", timeout=15)
response.raise_for_status()
print(response.json()["data"])Response Schema
{
"data": {
"id": "uuid",
"course_code": "string",
"course_name": "string",
"department": "string|null",
"program": "string|null",
"semester": "number|null",
"is_active": true
}
}Live Playground
https://srm-pyq-api.onrender.com/v1/courses/%2C20PCSE85J
Ready to execute
Click Run Request to see a live response from the production API.
/v1/courses/{course_code}/papersList all previous year question papers for a given SRM course. Filter by exam year or term to find specific papers.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| course_code | string | yes | Course code (URL-encode when needed). |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| year | int | no | Filter by exam year. |
| term | string | no | Filter by exam term like nov_dec. |
| cursor | string | no | Last seen source_item_url for paging. |
| limit | int (1-200) | no | Page size, defaults to 50. |
Code Example
from urllib.parse import quote
import requests
BASE_URL = "https://srm-pyq-api.onrender.com"
course_code = ",20PCSE85J"
encoded = quote(course_code, safe="")
params = {"term": "nov_dec", "limit": 5}
response = requests.get(
f"{BASE_URL}/v1/courses/{encoded}/papers",
params=params,
timeout=15,
)
response.raise_for_status()
payload = response.json()
print(payload["course"])
print(payload["data"])
print(payload["page"])Response Schema
{
"data": ["Paper", "..."],
"course": {
"id": "uuid",
"course_code": "string",
"course_name": "string"
},
"page": {
"has_more": true,
"next_cursor": "string|null",
"limit": 50
}
}Live Playground
https://srm-pyq-api.onrender.com/v1/courses/%2C20PCSE85J/papers?limit=3
Ready to execute
Click Run Request to see a live response from the production API.
/v1/papers/{paper_id}Get detailed metadata for a specific SRM question paper including exam year, term, and source information.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| paper_id | uuid | yes | Unique identifier of a paper. |
Query Parameters
None
Code Example
import requests
BASE_URL = "https://srm-pyq-api.onrender.com"
paper_id = "5aebb8f3-2946-4442-81ce-af1a64efad42"
response = requests.get(f"{BASE_URL}/v1/papers/{paper_id}", timeout=15)
response.raise_for_status()
print(response.json()["data"])Response Schema
{
"data": {
"id": "uuid",
"course_id": "uuid",
"title": "string",
"exam_year": "number|null",
"exam_month": "number|null",
"exam_term": "string|null",
"session_label": "string|null",
"source_subject_url": "string|null",
"source_item_url": "string",
"publisher": "string|null",
"metadata": {
"exam_month": "number|null",
"exam_year": "number|null",
"semester": ["number", "..."] ,
"page_found": "number|null"
},
"created_at": "iso-datetime",
"course": {
"id": "uuid",
"course_code": "string",
"course_name": "string"
}
}
}Live Playground
https://srm-pyq-api.onrender.com/v1/papers/5aebb8f3-2946-4442-81ce-af1a64efad42
Ready to execute
Click Run Request to see a live response from the production API.
/v1/papers/{paper_id}/filesList all PDF files attached to a question paper, including storage details and public download URLs.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| paper_id | uuid | yes | Unique identifier of a paper. |
Query Parameters
None
Code Example
import requests
BASE_URL = "https://srm-pyq-api.onrender.com"
paper_id = "5aebb8f3-2946-4442-81ce-af1a64efad42"
response = requests.get(f"{BASE_URL}/v1/papers/{paper_id}/files", timeout=15)
response.raise_for_status()
files = response.json()["data"]
print(files)Response Schema
{
"data": [
{
"id": "uuid",
"paper_id": "uuid",
"storage_provider": "r2",
"bucket": "string",
"object_key": "string",
"source_pdf_url": "string|null",
"public_url": "string|null",
"mime_type": "application/pdf",
"size_bytes": "number|null",
"sha256": "string|null",
"is_primary": true,
"created_at": "iso-datetime"
}
]
}Live Playground
https://srm-pyq-api.onrender.com/v1/papers/5aebb8f3-2946-4442-81ce-af1a64efad42/files
Ready to execute
Click Run Request to see a live response from the production API.
/v1/files/{file_id}/downloadGenerate a time-limited signed URL or retrieve a public link to download SRM question paper PDFs.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_id | uuid | yes | Unique identifier of the file record. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ttl_seconds | int (60-3600) | no | Signed URL TTL, defaults to 900 seconds. |
Code Example
import requests
BASE_URL = "https://srm-pyq-api.onrender.com"
file_id = "603c3731-865a-43eb-96c1-d46da96f5814"
response = requests.get(
f"{BASE_URL}/v1/files/{file_id}/download",
params={"ttl_seconds": 900},
timeout=15,
)
response.raise_for_status()
print(response.json()["data"])Response Schema
{
"data": {
"file_id": "uuid",
"download_url": "https://...",
"url_type": "signed|public",
"expires_in": "number|null"
}
}Live Playground
https://srm-pyq-api.onrender.com/v1/files/603c3731-865a-43eb-96c1-d46da96f5814/download?ttl_seconds=900
Ready to execute
Click Run Request to see a live response from the production API.
SRM API Integration Patterns
Search & Drill Down
Search the SRM course catalog with /v1/courses?q=, select a course_code, fetch its previous year question papers, retrieve file metadata, and download the PDF. Ideal for building study apps and exam preparation tools.
Cursor Pagination
Efficiently paginate through large SRM course and paper listings using page.next_cursor whilehas_more is true. This pattern ensures your app can handle the full SRM question paper catalog without missing results.
Fresh Downloads
Always request a fresh /download URL right before fetching SRM question paper PDFs. Signed URLs expire after a set duration, so generate them on-demand for reliable paper downloads.
Error Handling & Retry Strategies
Retry Recommended
500 server errors and network timeouts. Use exponential backoff with jitter. Start at 1s, max 30s.
Fix Request First
404 not found and 422 validation errors. Check your request parameters before retrying.