The FreecourseAPI is built with node.js/express. This API is simple yet useful and a very much easy to use. With different route end points this API can return 'Free udemy courses, Datacamp and amazon coupons' from real.discount API
.
This can be very much useful for developers and mostly students who are wanting to create any personal project related to this API, mainly this one is helpful cause there are currently no exclusive official API that provides the Free Coupon of Udemy courses data.
This API returns a JSON object with all the details of courses like 'Course name','Price' and 'Url' as well.
There are many use cases are possible, such as
- You can get the data of 10 FREE courses AND COUPONS each day and add the data to you personal website.
- Create an webpage where users can get 'Course URL' so that they don't have to look for many sites individually.
The API is not an RESTful API, there are no CURD operation available, it just takes an simple and cute get
requests and returns you your wanted data.
Though with differenct route points requests you can specify what data you want the API to fetch.
This is the main API endpoints: https://freecoursefetch.onrender.com
GET //freecoursefetch.onrender.com
Then you can go on and add your specific routes. Here are all the endpoints you can fetch the API from:
GET //freecoursefetch.onrender.com/courses
- fetches
Courses
and returs you a JSON, This JSON contains a object full of other courses for a total of 10 courses.
GET //freecoursefetch.onrender.com/courses/course1
- fetches only the
Course1 JSON
, which contains details likeCourse Image
,Course Price
,Sale Price
,Course Name
,Course Url
and some more details like 'id' etc.
GET //freecoursefetch.onrender.com/courses/course2
-
fetches only the
Course2 JSON
contains same details ascourse 1
. -
Like above routes you can access total 10 routes upto
https://freecoursefetch.onrender.com/courses/course9
. There you can get separate JSON for every course.
- Home route preview
/courses
route preview
- Separate courses route previw i.e.
/course/course1
.
Here is JavaSript
request format
fetch("https://freecoursefetch.onrender.com/")
.then(response => data.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
the response
json will return so many things:
if you have done console.log(result)
it will be in console though.
fetch("https://freecoursefetch.onrender.com/courses")
.then(response => data.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
fetch("https://freecoursefetch.onrender.com/courses/course1")
.then(response => data.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
fetch("https://freecoursefetch.onrender.com/courses/course2")
.then(response => data.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
FreecoursesAPI returns the following status codes in its API:
Status Code | Description |
---|---|
200 | OK |
400 | BAD REQUEST |
404 | NOT FOUND |