{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"659c5aed-9d50-42f0-a578-1c858754c89d","name":"Students CGPA Collection","description":"The **Students CGPA API** is a RESTful service built using **Node.js**, **Express.js**, and **CORS middleware**. It manages student academic records including branch, semester, and CGPA details.\n\nThe API provides endpoints to:\n\n- Retrieve all students\n    \n- Fetch a student by ID\n    \n- Filter students by branch\n    \n- Get total student count\n    \n- Calculate average CGPA\n    \n- Retrieve the topper (highest CGPA holder)\n    \n\n## 🌐 Base URL\n\ntext\n\n```\nhttps://students-cgpa-api-rr39.onrender.com\n\n ```\n\n## 🔐 Authentication\n\nNo authentication is required for this API. All endpoints are publicly accessible.\n\n## 📌 Available Endpoints\n\n---\n\n### 1\\. Health Check\n\n**GET** `/`\n\nReturns a simple confirmation message that the API is running.\n\n**Response Example:**\n\njson\n\n```\n{\n  \"message\": \"API is running successfully\"\n}\n\n ```\n\n---\n\n### 2\\. Get All Students\n\n**GET** `/students`\n\nReturns the complete list of student records.\n\n**Response Example:**\n\njson\n\n```\n[\n  {\n    \"id\": 1,\n    \"name\": \"Aarav Sharma\",\n    \"branch\": \"CSE\",\n    \"semester\": 8,\n    \"cgpa\": 9.3\n  },\n  {\n    \"id\": 2,\n    \"name\": \"Priya Patel\",\n    \"branch\": \"ECE\",\n    \"semester\": 6,\n    \"cgpa\": 8.7\n  },\n  {\n    \"id\": 3,\n    \"name\": \"Rahul Kumar\",\n    \"branch\": \"CSE\",\n    \"semester\": 8,\n    \"cgpa\": 8.9\n  }\n]\n\n ```\n\n---\n\n### 3\\. Get Topper Student\n\n**GET** `/students/topper`\n\nReturns the student with the highest CGPA.\n\n**Success Response (200 OK):**\n\njson\n\n```\n{\n  \"id\": 1,\n  \"name\": \"Aarav Sharma\",\n  \"branch\": \"CSE\",\n  \"semester\": 8,\n  \"cgpa\": 9.3\n}\n\n ```\n\n**Error Response (404 Not Found):**\n\njson\n\n```\n{\n  \"error\": \"No students found\"\n}\n\n ```\n\n_Returns 404 if no students exist._\n\n---\n\n### 4\\. Get Average CGPA\n\n**GET** `/students/average`\n\nCalculates and returns the average CGPA of all students.\n\n**Response Example:**\n\njson\n\n```\n{\n  \"averageCGPA\": 8.97\n}\n\n ```\n\n---\n\n### 5\\. Get Total Student Count\n\n**GET** `/students/count`\n\nReturns the total number of students.\n\n**Response Example:**\n\njson\n\n```\n{\n  \"totalStudents\": 10\n}\n\n ```\n\n---\n\n### 6\\. Get Student By ID\n\n**GET** `/students/:id`\n\nRetrieves a student record based on unique ID.\n\n**Path Parameter:**\n\n- `id` (number) – Unique identifier of the student\n    \n\n**Success Response (200 OK):**\n\njson\n\n```\n{\n  \"id\": 2,\n  \"name\": \"Priya Patel\",\n  \"branch\": \"ECE\",\n  \"semester\": 6,\n  \"cgpa\": 8.7\n}\n\n ```\n\n**Error Response (404 Not Found):**\n\njson\n\n```\n{\n  \"error\": \"Student not found\"\n}\n\n ```\n\n_Returns 404 if student with given ID does not exist._\n\n---\n\n### 7\\. Get Students By Branch\n\n**GET** `/students/branch/:branchName`\n\nReturns all students belonging to a specific branch (case-insensitive).\n\n**Path Parameter:**\n\n- `branchName` (string) – Branch code (e.g., `CSE`, `ECE`, `MECH`)\n    \n\n**Example Request:**\n\ntext\n\n```\nGET /students/branch/CSE\n\n ```\n\n**Response Example:**\n\njson\n\n```\n[\n  {\n    \"id\": 1,\n    \"name\": \"Aarav Sharma\",\n    \"branch\": \"CSE\",\n    \"semester\": 8,\n    \"cgpa\": 9.3\n  },\n  {\n    \"id\": 3,\n    \"name\": \"Rahul Kumar\",\n    \"branch\": \"CSE\",\n    \"semester\": 8,\n    \"cgpa\": 8.9\n  }\n]\n\n ```\n\n**Empty Response (if no students in branch):**\n\njson\n\n```\n[]\n\n ```\n\n---\n\n## 📊 Student Data Model\n\nEach student object has the following structure:\n\njson\n\n```\n{\n  \"id\": 1,\n  \"name\": \"Aarav Sharma\",\n  \"branch\": \"CSE\",\n  \"semester\": 8,\n  \"cgpa\": 9.3\n}\n\n ```\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | number | Unique student identifier |\n| `name` | string | Full name of the student |\n| `branch` | string | Academic branch (e.g., CSE, ECE) |\n| `semester` | number | Current semester (1-8 typically) |\n| `cgpa` | number | Cumulative Grade Point Average (0-10) |\n\n---\n\n## ⚠️ Error Handling\n\nThe API returns standard HTTP status codes and consistent error responses:\n\n| Status Code | Meaning | Response Body Example |\n| --- | --- | --- |\n| 200 | OK – Request succeeded | Varies by endpoint |\n| 404 | Not Found – Resource missing | `{ \"error\": \"Student not found\" }` |\n| 500 | Internal Server Error | `{ \"error\": \"Internal server error\" }` |\n\n---\n\n---\n\n## 🛠 Technical Stack\n\n- **Node.js** – JavaScript runtime\n    \n- **Express.js** – Web framework\n    \n- **CORS** – Cross-Origin Resource Sharing middleware\n    \n- **JSON middleware** – Built-in Express JSON parser\n    \n\n---\n\n## 📝 Notes for Developers\n\n- All endpoints return JSON responses.\n    \n- The branch filter is case-insensitive (`/branch/cse` works the same as `/branch/CSE`).\n    \n- The student data is currently in-memory (resets on server restart). For production, consider connecting a database.\n    \n- Rate limiting is not implemented; please use responsibly.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"50839260","team":12206675,"collectionId":"659c5aed-9d50-42f0-a578-1c858754c89d","publishedId":"2sBXcGCyi5","public":true,"publicUrl":"https://documenter-api.postman.tech/view/50839260/2sBXcGCyi5","privateUrl":"https://go.postman.co/documentation/50839260-659c5aed-9d50-42f0-a578-1c858754c89d","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.0","publishDate":"2026-02-24T06:33:50.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/5a227f4f2f3d842f4373453d5152f577d0be6e6fc7868ac832c61bfe46411ff5","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2sBXcGCyi5"}