The (editing) API supports a query for retrieving GPS traces in a given area. Each page returns a maximum of 5,000 points so you may have to make several calls for retrieving all of them.
Don't forget to read the terms of use and the usage policy. This API is not suited for running bulk queries!
If you don't know the bounding box of the city you want to query, you can use Nominatim to geolocate it.