Gov APIupsc.gov.in ↗
Access UPSC Civil Services and Indian Forest Service Main exam question-paper PDF links and structured question content via a clean JSON API.
What is the Gov API?
The UPSC Question Papers API exposes 3 endpoints that surface PDF links and structured question content from the UPSC Previous Year Question Papers pages, covering both Civil Services (Main) and Indian Forest Service (Main) examinations. The list_all_question_papers endpoint spans the full archive across all published years, while get_question_paper_content parses an individual PDF and returns each question with its section, page number, and text.
curl -X GET 'https://api.parse.bot/scraper/926e1695-7f06-406d-a9bb-cfb409d07576/list_question_papers?exam=all&years=2024%2C2025&subject=Agriculture' \ -H 'X-API-Key: $PARSE_API_KEY'
Returns one record per question-paper PDF link found on the UPSC Previous Year Question Papers page for the selected Main examination(s), year(s) and optional subject. Each record carries the exam name and year as the site labels them, the paper label exactly as shown (e.g. one shape is 'Agriculture Paper - I'), the paper number, the absolute PDF URL and the file size shown beside the link. A subject matches only paper labels that begin with '<subject> Paper', so 'Agriculture' never matches 'Agricultural Engineering' papers. The whole listing is fetched in one request (no pagination); the page currently publishes roughly the last four years, so years outside that window return an empty papers array, which is a valid result. Records are sorted by exam, year, then paper label.
| Param | Type | Description |
|---|---|---|
| exam | string | Which Main examination to include. 'all' returns both Civil Services (Main) and Indian Forest Service (Main). |
| years | string | Comma-separated list of 4-digit exam years, e.g. 2024,2025. The scraper splits on commas — do NOT pass an array. |
| subject | string | Optional subject name prefix of the paper label, matched case-insensitively against labels of the form '<subject> Paper - <number>'. |
{
"type": "object",
"fields": {
"count": "number of paper records returned",
"years": "array of year strings that were applied",
"papers": "array of paper records: exam (site exam name), year (string), paper (label as shown on the site), paper_number (roman numeral from the label), pdf_url (absolute PDF link), file_size (size text shown beside the link)",
"subject": "subject prefix that was applied"
},
"sample": {
"data": {
"count": 8,
"years": [
"2024",
"2025"
],
"papers": [
{
"exam": "Civil Services (Main) Examination",
"year": "2024",
"paper": "Agriculture Paper - I",
"pdf_url": "https://www.upsc.gov.in/sites/default/files/QP-CSM-24-AGRICULTURE-PAPER-I-031024.pdf",
"file_size": "2 MB",
"paper_number": "I"
},
{
"exam": "Indian Forest Service (Main) Examination",
"year": "2025",
"paper": "Agriculture Paper - II",
"pdf_url": "https://www.upsc.gov.in/sites/default/files/QP-IFSM-25-AGRICULTURE-PAPER-II-241125.pdf",
"file_size": "1.16 MB",
"paper_number": "II"
}
],
"subject": "Agriculture"
},
"status": "success"
}
}About the Gov API
What the API Covers
The API indexes question-paper PDF links published on the UPSC Previous Year Question Papers listing and its Archives page. Records carry the exam name and year exactly as labeled on the site, a paper field with the full label as printed (e.g. "General Studies Paper I"), a paper_number in roman numerals extracted from that label, a subject field, and a direct pdf_url pointing to the PDF on upsc.gov.in. Both list_question_papers and list_all_question_papers support filtering by exam (Civil Services (Main), Indian Forest Service (Main), or all), a comma-separated years string, and a case-insensitive subject prefix.
Listing Endpoints
list_question_papers reads the current Previous Year Question Papers page and returns a papers array plus a count and the years array that was applied. list_all_question_papers reads both the main listing and the Archives page in a single call, returning the same papers structure plus a years_covered array of every distinct year present in the results — useful for knowing the actual span without filtering first. Omitting years on this endpoint returns every available year from both pages.
PDF Content Endpoint
get_question_paper_content accepts a pdf_url exactly as emitted by either listing endpoint and returns a structured breakdown of the document. The header object includes exam_header_raw, header_lines_raw (verbatim OCR of the cover-page stamp), the 4-digit year parsed from it, and subject. The questions array gives each question a number, label_raw, section (letter or null), page (1-based), and text. The response also reports page_count, question_count, and flagged_entry_count for records that carry parse-quality flags. Each PDF is roughly 1–5 MB and consumes one API call.
The Gov API is a managed, monitored endpoint for upsc.gov.in — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when upsc.gov.in changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official upsc.gov.in API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a searchable archive of UPSC Civil Services Main question papers filtered by year and subject.
- Extract and index full question text from past papers for keyword or topic frequency analysis.
- Generate subject-wise question banks for exam preparation platforms using the
subjectfilter. - Track which subjects appear across years using
years_coveredfromlist_all_question_papers. - Automate download and parsing of new question papers each year by polling
list_question_papersfor the latest year. - Compare syllabus coverage across Indian Forest Service and Civil Services Main exams using the
examparameter.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does UPSC provide an official developer API for accessing question papers?+
What does `get_question_paper_content` return beyond raw PDF text?+
header object with verbatim OCR of the cover-page stamp (exam_header_raw, header_lines_raw), the 4-digit year, and subject. The questions array includes each question's integer number, label_raw, section, 1-based page, and text. A flagged_entry_count field indicates how many records carry quality flags for manual review.Does the API cover UPSC Preliminary examination papers or other exam types beyond the two Main exams?+
How should the `years` parameter be passed to the listing endpoints?+
2022,2023,2024. Do not pass a JSON array. Omitting years on list_all_question_papers returns records across all published years; omitting it on list_question_papers returns whatever the current (non-archive) page shows.