Skip to main content
Hoppscotch allows you to pass variables in the query to fetch data dynamically. To demonstrate the use of variables let’s write a query to get the Ninja whose id is 61bd1dbc918f12c17b9c6483.

Variables

Go to the variables section and define the variable.

Using the variable in the query

Now create a query getCharacter with variables as shown below:
Hoppscotch will retrieve the value of the variable and execute the query to get the below response.