Inspiration

Getting data from an API is complex and hard in JavaScript. A quick google search will direct you to a difficult code block that either use fetch or axios. APIs are a crucial aspect of the developer ecosystem. Hackathons, companies, developers, and programmers of all levels use APIs. However, there's a huge problem. Getting API data in JavaScript is very VERY difficult and intimidating, especially for beginners. The API Request JS project comes with an npm package that allows programmers of all levels to easily install, use, and set up in a matter of seconds with just 3 lines of code. Instead of having to understand what async, await, promises, and handling errors, API-request-js replaces them all with just one line. The equivalent of what Python requests is, but to JavaScript.

What it does

It replaces the need to understand complex concepts such as asynchronous programming, async/await, promises, streams, downloading images, and .then/.catch keywords. Rather all you need to do is install the package (npm i api-request-js) and then just dorequest.get(api_endpoint)orrequest.get(api_endpoint, path)``` depending on your use case. This is so much more understandable to any person than having to write and debug upwards of 16-50+ lines of code. Website for documentation: https://requestjs.netlify.app/

How we built it

This was built all using JavaScript. The package was built in JavaScript and the website was also built using JavaScript using ReactJS. Check out the website! https://requestjs.netlify.app/. The package was built entirely using JavaScript and I found ways to get API data, download data from URL, log out this data, and wrapped these in functions. It checks and error handles for most (if not all cases) making the package very reliable for any programmer to use. The frontend was built using ReactJS and implemented components and lots of styling to give the website a modern and sharp look. Github for package: https://github.com/eric-prog/api-requests-js Github for frontend: https://github.com/eric-prog/api-request-frontend

Challenges we ran into

Deployment was probably one of the most difficult aspects of this project. Deploying the package, and the website took some time to debug as there were some errors in the beginning but they were eventually all resolved and the package is completely working and stable! Check it out!: https://www.npmjs.com/package/api-request-js

Accomplishments that we're proud of

I am proud that I was able to build an innovative solution to making API calls in JavaScript. For so long, people learning JavaScript and beginners have suffered because of the complexity of making just one request. Compared to Python (which is one line request.get), JavaScript's way of handling is quite unideal and hard. I am hoping this package will allow beginners and programmers of all levels to finally enjoy using and accessing APIs easily without any sign of struggle.

What we learned

I learned how to deploy an npm package, deploy a ReactJS website, and lots of ways to get data and make API calls using JavaScript.

What's next for API Request JS

I am hoping to continue to work on the package, upgrade some features and new releases, and hopefully, thousands of JavaScript developers and/or programmers around the world will use this package to make API requests! One line to replace them all.

Built With

Share this project:

Updates