Using APIs in website,the easy way

Ever felt that you want to use API search results in your website or web app, yet thought that its to cumbersome to use it.

Using Jquery, you can do it in a snap.Irrespective of the framework you use, React, Angular or pure Vanilla.

Make the basic structure :

Here I have included the CDN link for jquery,you can also download and include it.

Getting the API key:

Here I am airvisual API, as an example.

Visit:, to read documentation and get an API key to use in your website.

After getting the API key, we’ll get back to our code.

Getting API results in website:

To make a JSON call, use the simple syntax, with your API link and key.

Here JSON.stringify is used to display the raw JSON in a parsed format.

Here is the sample response:

Suppose, if you want to see only the pollution part of the response, just use,

See the response,

Now use the results in your website, as you need it.Integrate any API easily and create wonderful results.

Happy Coding!!!



Deep Learning enthusiast | Adobe WIT Scholar'21

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store