Why do we use query parameters for GET endpoints?

I'm starting to learn about axios endpoints, and I was wondering why would we use query parameters for an endpoint?

Google states we use it as it "helps to retrieve specific data and performs actions based on the inputs passed by the user"

I believe there is a "filter" function we can use to filter the responses and I assumed we could use query parameters to do something similar, but I'm not sure if that's what they meant. I created a client and server example where I passed query parameters to the server and it returned a response with the parameters I sent. This makes sense, but what is the point?


Query parameters are used to target more specific queries. Imagine if you were ordering items from an e-commerce website.

By putting search parameters in the url, it will allow us to filter out our exact requests in order to grab the data that we want.

Here's another Stack answer that may be helpful! https://stackoverflow.com/a/25405668/15492085