API Documentation

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

Schema

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
  }
}
Reference

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.

GET/health

Health check endpoint for verifying the SRM PYQ API is running and responsive.

Path Parameters

None

Query Parameters

None

Code Example

Python
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.

GET/v1/courses

Browse 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

NameTypeRequiredDescription
qstringnoSearch against course_code and course_name.
cursorstringnoLast seen course_code for pagination.
limitint (1-200)noPage size, defaults to 50.

Code Example

Python
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.

GET/v1/courses/{course_code}

Retrieve full details for a specific SRM course including department, program, and semester information.

Path Parameters

NameTypeRequiredDescription
course_codestringyesUse URL-encoding for special characters.

Query Parameters

None

Code Example

Python
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.

GET/v1/courses/{course_code}/papers

List all previous year question papers for a given SRM course. Filter by exam year or term to find specific papers.

Path Parameters

NameTypeRequiredDescription
course_codestringyesCourse code (URL-encode when needed).

Query Parameters

NameTypeRequiredDescription
yearintnoFilter by exam year.
termstringnoFilter by exam term like nov_dec.
cursorstringnoLast seen source_item_url for paging.
limitint (1-200)noPage size, defaults to 50.

Code Example

Python
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.

GET/v1/papers/{paper_id}

Get detailed metadata for a specific SRM question paper including exam year, term, and source information.

Path Parameters

NameTypeRequiredDescription
paper_iduuidyesUnique identifier of a paper.

Query Parameters

None

Code Example

Python
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.

GET/v1/papers/{paper_id}/files

List all PDF files attached to a question paper, including storage details and public download URLs.

Path Parameters

NameTypeRequiredDescription
paper_iduuidyesUnique identifier of a paper.

Query Parameters

None

Code Example

Python
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.

GET/v1/files/{file_id}/download

Generate a time-limited signed URL or retrieve a public link to download SRM question paper PDFs.

Path Parameters

NameTypeRequiredDescription
file_iduuidyesUnique identifier of the file record.

Query Parameters

NameTypeRequiredDescription
ttl_secondsint (60-3600)noSigned URL TTL, defaults to 900 seconds.

Code Example

Python
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.

Guides

SRM API Integration Patterns

A

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.

B

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.

C

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.

Handling

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.