Filter mock API by 'city'

Is it possible to filter ‘mock api’ by ‘city’ e.g.

‘api handler script’
set “city”, city: params[‘city’]

‘api call’
https://mockapi.json?key=xxxxx&city=Miami