How to check query param exist or not

some time my get request going be like this
/api/test
OR
/api/test?days=7
OR
/api/test?days=30
so how should verify query param exist or not and if exist do some action.