REST API to fetch data from Amizone using puppeteer
Live endpoint : https://amizone-fetch.herokuapp.com
or
npm install
npm run dev
- Use
POST
request method for all requests. - Pass the following JSON body for all requests:
{
"username": "<YOUR-AMIZONE-USERNAME>",
"password": "<YOUR-AMIZONE-PASSWORD>"
}
These Amizone login credentials are required for authentication while fetching data.
Get all courses
[
{
"code": "IFTXXXX",
"name": "Android Programming",
"type": "Compulsory",
"attendance": {
"attended": 17,
"total": 17,
"unattended": 0,
"percent": 100
}
},
...
]
Get all credentials available on the amizone home page
{
"amityEmail": {
"id": "",
"password": ""
},
"msTeams": {
"id": "",
"password": ""
},
"opac": {
"id": "",
"password": ""
},
"formNumber": ""
}
Get faculty info
[
{
"subjectShort": "[Android Progr] [IFTXXXX]",
"subject": " Android Programming [Android Progr] [IFTXXXX] ",
"facultyPhoto": "https://...",
"name": "Dr Someone"
},
...
]
Get grades info
[
{
"semester": "1",
"sgpa": "9.36",
"cgpa": "",
"backPapers": "0"
},
{
"semester": "2",
"sgpa": "9.44",
"cgpa": "9.40",
"backPapers": "0"
},
...
]
Get photo link
{
"photoUrl": "https://..."
}
Get registration info
{
"semester": "5",
"photo": "https://...",
"enrollmentno": "A...",
"name": "John Doe",
"program": "B.Sc. Comp. Sci.",
"batch": "2018-2021",
"dob": "",
"email": "",
"contactaddress": "",
"contactpincode": "",
"contactphone": "",
"contactmobile": "",
"fax": "",
"fathername": "",
"permanentaddress": "",
"permanentpincode": "",
"permanentphone": "",
"permanentfax": "",
"hostel": "",
"homeaddress": "",
"homecity": "",
"homepincode": "",
"hometelephone": "",
"homemobile": "",
"homeemail": ""
}
Get today's schedule
[
{
"courseTitle": "ASP.NET with C# Programming",
"courseCode": "IFTXXXX",
"facultyName": "Mr Someone",
"start": "9/15/2020 9:10:00 AM",
"end": "9/15/2020 10:00:00 AM",
"roomNumber": "320",
"attendanceColor": "#3a87ad",
"allDay": false
},
...
]
Get weekly schedule (Sunday to Saturday)
{
"Monday": [
{
"fromTime": "09:10",
"toTime": "10:00",
"courseCode": "IFTXXXX",
"courseTeacher": "Mr Someone",
"classLocation": "120"
},
...
],
"Tuesday": [
{
"fromTime": "09:10",
"toTime": "10:00",
"courseCode": "IFTXXXX",
"courseTeacher": "Ms Someone",
"classLocation": "230"
}
...
],
...
}
HTTP Code: 408
{
"error": "Request Timeout"
}
You can use the browser's Fetch API
const endpoint = 'https://amizone-fetch.herokuapp.com';
fetch(`${endpoint}/courses`, {
method: 'POST',
body: JSON.stringify({
'username': '<YOUR-AMIZONE-USERNAME>',
'password': '<YOUR-AMIZONE-PASSWORD>'
}),
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
console.log(data);
});
or you can choose to use the axios library
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
axios.post(`/courses`, {
'username': '<YOUR-AMIZONE-USERNAME>',
'password': '<YOUR-AMIZONE-PASSWORD>'
},{
baseURL: 'https://amizone-fetch.herokuapp.com'
})
.then(function (response) {
console.log(response.data);
});
Install requests library
pip install requests
Make request
import requests
response = requests.post("https://amizone-fetch.herokuapp.com/courses", data = {
'username': '<YOUR-AMIZONE-USERNAME>',
'password': '<YOUR-AMIZONE-PASSWORD>'
})
print(response.json())
This software is open source, licensed under the MIT License.