In this post, we will learn how to use the Fetch GET command with parameters in react js. we will also learn how we can pass query string GET API.

In this post,We will discuses the below point-

  • GET with query string with Fetch in React
  • How to Get info from API request with parameters in ReactJS

Below we have a sample test that takes the city as a parameter and then returns the user belongs to that city. We are going to use that API for our demonstration.



"Id": 2,
"Name": "Liu Wong",
"Address": "DaVinci",
"City": "Paris",
"ZipCode": "243232"

Component Code

import React, { useState, useEffect } from "react";

const FetchDataParam = () => {
const [userList, setusers] = useState(null);
  useEffect(() => {
  }, []);
const getuesers = () => {
      .then((res) => res.json())
        (result) => {          
        (error) => {

if (!userList) return <div>No Record Found</div>;
return (
      <h2>Users List Funcational Component </h2>
      <table className="table">
            <th>User Id</th>
          { => (
export default FetchDataParam;

react fetch data from api with params

React is flexible, declarative, and efficient for web and mobile applications.In simple, we can say react Js effectively handle the view layer of mobile and web application.

it can be used in any existing web application to develop a new feature. These are the applications that you can be using. The area is only concerned with getting data to the document object model.React has become highly popular across the globe because of its extra simplicity and flexibility. Many people are even referring to the React Js as the future of Web development.

Part of this huge popularity comes from the fact that top corporations such as Facebook, PayPal, Facebook, Uber, Instagram, and Airbnb use it to develop web user interfaces to make things a little exciting.It was deployed on Facebook’s news feed in 2011 and later on Instagram in 2014. React Native, which enables Native Android and Ios development.