how to solve The "srsearch" parameter must be set error in wikipedia api

Viewed 31
 useEffect(() => {
    const search = async () => {
      await axios.get("https://en.wikipedia.org/w/api.php", {
        params: {
          action: "query",
          list: "search",
          origin: "*",
          format: "json",
          srsearch: input,
        },
      });
    };
    search();
  }, [input]);

the error is :

{code: "missingparam", info: "The "srsearch" parameter must be set.",…}

1 Answers
    srsearch:{input}

i did this mistake of putting input without {}

Related