Skip to content

A JavaScript practice project demonstrating API usage with Axios. Fetches fake user details, random dog images, and college data using query parameters. Includes async/await handling, dynamic DOM updates, and clean UI structure for learning modern JS concepts.

Notifications You must be signed in to change notification settings

shanusingh01/js-api-practice-suite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

js-api-practice-suite

A collection of small JavaScript projects demonstrating how to interact with public APIs using Axios. This suite includes three separate features: fetching fake user data, generating random dog images, and searching universities by country. It serves as a practical hands-on learning project for mastering API requests, async/await, DOM manipulation, and error handling in JavaScript.


📌 Features Overview

🔹 1. Fake User Information (RandomUser API)

Fetches a random fake user profile including:

  • Name
  • Gender
  • Email
  • Address
  • Additional personal details

The details are displayed in JSON format inside the webpage.

🔹 2. Random Dog Images (Dog CEO API)

Displays a random dog image with each button click.
Uses Axios to retrieve image URLs and updates the DOM instantly.

🔹 3. College Finder by Country (Hipolabs Universities API)

Enter any country name to retrieve a list of universities.
Useful for understanding:

  • Query string API requests
  • Rendering dynamic lists
  • Handling API errors gracefully

🛠️ Tech Stack

Frontend:

  • HTML
  • CSS
  • Vanilla JavaScript

Networking:

  • Axios (CDN version)

APIs Used:

  • RandomUser API
  • Dog CEO API
  • Hipolabs Universities API

📂 Project Structure

  • index.html – Page layout and UI
  • style.css – Minimal styling
  • json.js – All API logic and event handling

🚀 How to Use

⭐ Fake User Generator

  1. Click Show the details
  2. A random fake user profile is fetched and displayed

⭐ Random Dog Image

  1. Click show
  2. A new dog image appears on the screen

⭐ College Finder

  1. Enter a country (e.g., "Canada", "India", "Australia")
  2. Click search
  3. A list of universities loads below

🎯 Concepts Practiced

  • Making GET requests using Axios
  • Understanding async/await
  • Handling errors with try/catch
  • Working with query parameters
  • Updating DOM elements dynamically
  • Rendering JSON responses on screen
  • Creating reusable asynchronous functions

🧠 What I Learned

  • How to fetch data from APIs efficiently
  • How to debug API errors
  • How to update UI elements using JavaScript
  • How to format JSON output for readability
  • How multiple APIs can be combined into one project

📜 License

This project is for learning and practice purposes.
You may use or modify it freely.

About

A JavaScript practice project demonstrating API usage with Axios. Fetches fake user details, random dog images, and college data using query parameters. Includes async/await handling, dynamic DOM updates, and clean UI structure for learning modern JS concepts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published